<%@ Page Title="" Language="C#" MasterPageFile="~/Styles/MasterPage/MasterPage_Edit.master" AutoEventWireup="true" CodeFile="Role_Edit.aspx.cs" Inherits="System_Role_Role_Edit" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <script type="text/javascript">
        function save() {
            
            var id = $("#id").val();
            var role_name = $("#role_name").val();
            if (role_name == "") {
                parent.AlertNO('请输入角色名!');
                return;
            }
            var nickname = $("#nickname").val();
            var status = $("#status").val();
            var action = '<%=xview["action"]%>';
            parent.ShowLoadingMask(); //显示遮罩
            $.ajax({
                type: "POST",
                contentType: "application/json",
                url: 'Role_Service.asmx/<%=xview["action"]%>',
                data: "{id:'" + id + "',role_name:'" + role_name + "',status:'" + status + "'}",
                dataType: 'json',
                success: function (result) {
                    parent.HideLoadingMask(); //关闭遮罩
                    var r = result.d;
                    if (r == "success") {
                        parent.AlertOK('保存成功!');
                        parent.search_grid();
                        CloseDivWin(); //关闭窗口
                    } else {
                        parent.AlertNO(r);
                    }
                }
            });
        }

        //弹出窗口_选择上级主管
        function Boss_SearchDialog() {
            var keyid = $("#boss_nickname").val();
            var url = "../../CommonControl/SearchDialog/Role_List.aspx"
            var win_style = "center:yes;resizable:no;status:no;dialogHeight:530px;dialogWidth:600px";
            var m_recipientsText = ""
            var r = window.showModalDialog(url, m_recipientsText, win_style);
            if (r != null) {
                var id = r[0][0];
                Boss_SearchService(id);
            }
            //Boss_SearchService(keyid);
        }

    </script>

    <div style="width:350px;height:220px;overflow:auto;">
	    <table style="margin:auto;">
            <tr>
                <td style="text-align:right">角色ID:</td>
                <td><input type="text" class="edit_text_box" id="id" disabled="disabled" value="<%=xview["id"]%>"/></td>
            </tr>
            <tr>
                <td style="text-align:right">角色名:</td>
                <td><input type="text" class="edit_text_box" id="role_name" value="<%=xview["role_name"]%>"/></td>
            </tr>
            <tr>
                <td style="text-align:right">状态:</td>
                <td>
                    <select id="status" class='N_select'>
                        <option value="1">启用</option>
                        <option value="0">停用</option>
                    </select>
                    <script type="text/javascript">
                        if ('<%=xview["status"]%>' != '') 
                        {
                            document.getElementById("status").value = '<%=xview["status"]%>';
                        }
                    </script>
                </td>
            </tr>
	    </table>
        <div style="text-align:center;margin-top:20px">
            <input type="button" class='SiteButton' value="保存" onclick="save()" style='<%=auth.AuthView("System_Role_Edit")%>'/>
        </div>
    </div>
</asp:Content>

