<%@ Page Title="" Language="C#" MasterPageFile="~/Dialog/DialogMaster.Master" AutoEventWireup="true"
    CodeBehind="ModuleEdit.aspx.cs" Inherits="OAWeb.Sys.ModuleEdit" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div class="form" style="width: 600px; padding: 10px;">
        <table cellpadding="0" cellspacing="0" border="0" class="table_form">
            <tr>
                <td class="right">
                    上级菜单：
                </td>
                <td>
                    <asp:DropDownList ID="ddlParentId" runat="server">
                        <asp:ListItem Value="0">选择菜单</asp:ListItem>
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td class="right">
                    <span class="red">*</span>菜单名称：
                </td>
                <td>
                    <asp:TextBox ID="txtFullName" runat="server" CssClass="text width200"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td class="right">
                    菜单地址：
                </td>
                <td>
                    <asp:TextBox ID="txtNavigateUrl" runat="server" CssClass="text width200"></asp:TextBox>
                    <span class="form_tip">以“/”开头，如:/Sys/ModuleList.aspx</span>
                </td>
            </tr>
            <tr>
                <td class="right">
                    属性：
                </td>
                <td>
                    <asp:CheckBox ID="chkEnabled" runat="server" Checked="True" Text="有效" />
                    <asp:CheckBox ID="chkIsMenu" runat="server" Text="菜单" Checked="True" />
                    <asp:CheckBox ID="chkIsWork" runat="server" Text="显示在工作台" ToolTip="显示在工作台的一级菜单将不显示在导航上" />
                </td>
            </tr>
            <tr>
                <td class="right">
                    排序号：
                </td>
                <td>
                    <asp:TextBox ID="txtSortCode" runat="server" CssClass="text width40" Text="0"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td>
                </td>
                <td>
                    <input id="btnSave" type="button" value=" 保 存 " class="btn_77px" />
                    <input id="btnClose" type="button" value=" 返 回 " onclick="art.dialog.close();return false;"
                        class="btn_77px" />
                </td>
            </tr>
        </table>
    </div>
    <script type="text/javascript">
        $(document).ready(function () {
            jQuery.validator.addMethod("FullNameIsExist", function (value, element) {
                return AjaxChecked("RoleEdit.aspx", "op=FullNameIsExist&FullName=" + value + "&Id=<%=Id %>&r=" + Math.random());
            }, "您输入的编码已经存在");
            rulesValue = { '<%=txtFullName.UniqueID %>': { required: true, FullNameIsExist: true} };
            messagesValue = { '<%=txtFullName.UniqueID %>': { required: "请输入菜单名称"} }
            var form = jQuery.validator.ValidateForm($("#aspnetForm"), rulesValue, messagesValue);
            $("#btnSave").click(function () {
                if (form.form()) {
                    $("#aspnetForm").ajaxSubmit({
                        url: "/Sys/ModuleEdit.aspx?op=Save&Id=<%=Id %>",
                        success: function (result) {
                            if (result == "ok") {
                                alert("保存成功");
                                CloseReload();
                            } else {
                                alert(result);
                            }
                        }
                    });
                }
                return false;
            })
        });
    </script>
</asp:Content>
