<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="usermodify.aspx.cs" Inherits="HySoft.BaseCallCenter.Web.sysmanage.usermodify" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>编辑用户</title>
    <link href="../../scripts/ui/skins/Aqua/css/ligerui-all.css" rel="stylesheet" type="text/css" />
    <link href="../images/style.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="../../scripts/jquery/jquery-1.8.3.min.js"></script>
    <script type="text/javascript" src="../../scripts/jquery/jquery.form.js"></script>
    <script type="text/javascript" src="../../scripts/jquery/jquery.validate.min.js"></script>
    <script type="text/javascript" src="../../scripts/jquery/messages_cn.js"></script>
    <script type="text/javascript" src="../../scripts/ui/js/ligerBuild.min.js"></script>
    <script type="text/javascript" src="../../scripts/function.js"></script>
    <script src="../scripts/ui/js/core/base.js" type="text/javascript"></script>
    <script src="../scripts/ui/js/plugins/ligerDialog.js" type="text/javascript"></script>
    <script src="../scripts/ui/js/plugins/ligerDrag.js" type="text/javascript"></script>
    <script src="../scripts/ui/js/plugins/ligerComboBox.js" type="text/javascript"></script>
    <script src="../scripts/ui/js/plugins/ligerTree.js" type="text/javascript"></script>
    <script src="../scripts/ui/js/plugins/ligerRadioList.js" type="text/javascript"></script>
    <script src="../scripts/ui/js/plugins/ligerSpinner.js" type="text/javascript"></script>
     <script src="../scripts/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
         <script type="text/javascript">
             function validatelogin_name() {
                 if ($("#F_UserName").val() == "" || $("#F_UserName").val() == undefined) {
                     document.getElementById("lbF_UserName").innerHTML = "* 登录名不为空！";
                     document.getElementById("lbF_UserName").style.color = "red";
                     return false;
                 }
                 else {
                     document.getElementById("lbF_UserName").innerHTML = "*";
                     document.getElementById("lbF_UserName").style.color = "#414141";
                     return true;
                 }
             }
             function validatelogin_code() {
                 if ($("#F_UserCode").val() == "" || $("#F_UserCode").val() == undefined) {
                     document.getElementById("lbF_UserCode").innerHTML = "* 员工工号不为空！";
                     document.getElementById("lbF_UserCode").style.color = "red";
                     return false;
                 }
                 else {
                     document.getElementById("lbF_UserCode").innerHTML = "*";
                     document.getElementById("lbF_UserCode").style.color = "#414141";
                     return true;
                 }
             }
             function validateone_role() {
                 if ($("#F_RoleName").val() == "" || $("#F_RoleName").val() == undefined) {
                     document.getElementById("lbF_RoleName").innerHTML = "* 角色不为空！";
                     document.getElementById("lbF_RoleName").style.color = "red";
                     return false;
                 }
                 else {
                     document.getElementById("lbF_RoleName").innerHTML = "*";
                     document.getElementById("lbF_RoleName").style.color = "#414141";
                     return true;
                 }
             }
             function validateone_ope() {
                 if ($("#F_DeptName").val() == "" || $("#F_DeptName").val() == undefined) {
                     document.getElementById("lbF_DeptName").innerHTML = "* 部门不为空！";
                     document.getElementById("lbF_DeptName").style.color = "red";
                     return false;
                 }
                 else {
                     document.getElementById("lbF_DeptName").innerHTML = "*";
                     document.getElementById("lbF_DeptName").style.color = "#414141";
                     return true;
                 }
             }
             function validate() {
                 document.getElementById("hdradiolist").value = liger.get("radiolist1").getValue();
                 document.getElementById("hfzuoxiquanxian").value = liger.get("radiolist2").getValue();
                 document.getElementById("hfzuoxileixing").value = liger.get("radiolist3").getValue();
                 document.getElementById("hfxinbie").value = liger.get("radiolist4").getValue();
                 var i = 0;
                 if (!validateone_ope()) {
                     i++;
                 }
                 if (!validateone_role()) {
                     i++;
                 }
                 if (!validatelogin_name()) {
                     i++;
                 }
                 if (!validatelogin_code()) {
                     i++;
                 }
                 
                 if (i > 0) {
                     return false;
                 }
                 return true;
             }

             function CloseThis() {
                 var dialog = frameElement.dialog;
                 parent.LoadList("");
                 dialog.close();
             }

             $(function () {
                 InitDropList();
                 InitTreeList();
                 InitRadioList();
                 //InitSpinnerList();
                 InitTreeZXZList();
                 InitTreeTeamList();
             });

             function InitRadioList() {
                 var data = [
            { id: 1, name: '使用' },
            { id: 0, name: '不使用' }
            ];
                 $('#radiolist1').ligerRadioList({
                     data: data,
                     textField: 'name'
                 });
                 if (document.getElementById("hdradiolist").value != "") {
                     liger.get("radiolist1").setValue(document.getElementById("hdradiolist").value);
                 } else {
                     liger.get("radiolist1").setValue("0");
                 }

                 var data2 = [
            { id: 0, name: '普通坐席' },
            { id: 1, name: '班长坐席' }
            ];
                 $('#radiolist2').ligerRadioList({
                     data: data2,
                     textField: 'name'
                 });
                 if (document.getElementById("hfzuoxiquanxian").value != "") {
                     liger.get("radiolist2").setValue(document.getElementById("hfzuoxiquanxian").value);
                 } else {
                     liger.get("radiolist2").setValue("0");
                 }


                 var data3 = [
            { id: 0, name: '呼入' },
            { id: 1, name: '呼出' }
            ];
                 $('#radiolist3').ligerRadioList({
                     data: data3,
                     textField: 'name'
                 });
                 if (document.getElementById("hfzuoxileixing").value != "") {
                     liger.get("radiolist3").setValue(document.getElementById("hfzuoxileixing").value);
                 } else {
                     liger.get("radiolist3").setValue("0");
                 }

                 var data4 = [
            { id: 1, name: '男' },
            { id: 0, name: '女' }
            ];
                 $('#radiolist4').ligerRadioList({
                     data: data4,
                     textField: 'name'
                 });
                 if (document.getElementById("hfxinbie").value != "") {
                     liger.get("radiolist4").setValue(document.getElementById("hfxinbie").value);
                 } else {
                     liger.get("radiolist4").setValue("1");
                 }
             }
             function InitDropList() {
                 try {
                     $("#F_RoleName").ligerComboBox({
                         url: '../sysmanage/ajax/ligerComboBox.ashx?action=getF_RoleNamelist',
                         valueField: '_f_roleid',
                         textField: '_f_rolename',
                         autocomplete: true,
                         onSelected: function (newvalue) {
                             document.getElementById("hfRoleText").value = newvalue;
                         },
                         onSuccess: function (data) {
                             if (document.getElementById("hfRoleText").value != "") {
                                 liger.get("F_RoleName").setValue(document.getElementById("hfRoleText").value);
                             } else {
                                 liger.get("F_RoleName").setValue(data[0]._f_roleid);
                                 document.getElementById("hfRoleText").value = data[0]._f_roleid;
                             }
                         }
                     });
                 }
                 catch (e) {
                     alert(e.Message);
                 }
             }
             function InitTreeList() {
                 treelist = $("#F_DeptName").ligerComboBox({
                     valueField: 'id', resize: false, treeLeafOnly: false, isMultiSelect: false,
                     onSelected: function (newvalue) {
                         document.getElementById("hfDeptText").value = newvalue;
                     },
                     tree: {
                         url: '../sysmanage/ajax/deptcategory.ashx?action=gettreelist',
                         checkbox: false,
                         ajaxType: 'get',
                         isExpand: false,
                         onSuccess: function (data) {
                             if (document.getElementById("hfDeptText").value != "") {
                                 liger.get("F_DeptName").setValue(document.getElementById("hfDeptText").value);
                             } else {
                                 liger.get("F_DeptName").setValue(data[0].id);
                                 document.getElementById("hfDeptText").value = data[0].id;
                             }
                         }
                     }
                 });
             }
             function InitSpinnerList() {
                 treelist = $("#txtSJBH").ligerComboBox({
                     valueField: 'id', resize: false, treeLeafOnly: false,
                     tree: {
                         url: '../SalePlan/ajax/PlanList.ashx?action=gettreelist',
                         checkbox: false,
                         ajaxType: 'get',
                         onSuccess: function (data) {
                             liger.get("txtSJBH").setValue(data[0].id);
                         }
                     }
                 });
             }
             function InitTreeZXZList() {
                 treelist = $("#ZXZ").ligerComboBox({
                     valueField: 'id', resize: false, treeLeafOnly: false,
                     onSelected: function (newvalue) {
                         document.getElementById("hfF_GroupId").value = newvalue;
                     },
                     tree: {
                         url: 'ajax/deptcategory.ashx?action=getZXZlist',
                         checkbox: false,
                         ajaxType: 'get',
                         onSuccess: function (data) {
                             if (document.getElementById("hfF_GroupId").value != "") {
                                 liger.get("ZXZ").setValue(document.getElementById("hfF_GroupId").value);
                             } else {
                                 liger.get("ZXZ").setValue(data[0].id);
                                 document.getElementById("hfF_GroupId").value = data[0].id;
                             }

                         }
                     }
                 });
             }
             function InitTreeTeamList() {
                 treelist = $("#txtTeam").ligerComboBox({
                     valueField: 'id', resize: false, treeLeafOnly: false,
                     onSelected: function (newvalue) {
                         document.getElementById("hfTeam").value = newvalue;
                     },
                     tree: {
                         url: 'ajax/deptcategory.ashx?action=getTeamlist',
                         checkbox: false,
                         ajaxType: 'get',
                         onSuccess: function (data) {
                             if (document.getElementById("hfTeam").value != "") {
                                 liger.get("txtTeam").setValue(document.getElementById("hfTeam").value);
                             } else {
                                 liger.get("txtTeam").setValue(data[0].id);
                                 document.getElementById("hfTeam").value = data[0].id;
                             }

                         }
                     }
                 });
             }
    </script>
</head>
<body class="mainbody"  style="margin-top: 0px;">
    <form id="form1" runat="server">
    <asp:HiddenField ID="hfRoleText" runat="server" />
    <asp:HiddenField ID="hfDeptText" runat="server" />
    <asp:HiddenField ID="hfTeam" Value="" runat="server" />
    <asp:HiddenField ID="hfF_GroupId" Value="" runat="server" />
    <asp:HiddenField ID="hdradiolist" runat="server" />
    <asp:HiddenField ID="hfzuoxiquanxian" runat="server" />
    <asp:HiddenField ID="hfzuoxileixing" runat="server" />
    <asp:HiddenField ID="hfxinbie" runat="server" />
    <asp:HiddenField ID="hfbirthday" runat="server" />
    <div id="contentTab">
        <ul class="tab_nav">
            <li class="selected"><a onclick="tabs('#contentTab',0);" href="javascript:;">基本信息</a></li>
        </ul>
        <div class="tab_con" style="display: block; ">
            <table class="form_table">
                <col width="100px" />
                <col />
                <col width="100px" />
                <col />
                <tbody>
                    <tr>
                        <th style="color:red">
                            员工姓名：
                        </th>
                        <td>
                            <asp:TextBox ID="F_UserName" runat="server" CssClass="txtInput normal" Style="width: 120px;"></asp:TextBox><label
                                id="lbF_UserName" for="F_UserName"></label>
                        </td>
                        <th style="color:red">
                            员工工号：
                        </th>
                        <td>
                            <asp:TextBox ID="F_UserCode" runat="server" CssClass="txtInput normal" Style="width: 120px;"></asp:TextBox>
                            <label id="lbF_UserCode" for="F_UserCode"></label>
                        </td>
                    </tr>
                     <tr>
                        <th style="color:red">
                            所属角色：
                        </th>
                        <td>
                        <div style="float:left;"><asp:TextBox ID="F_RoleName" runat="server" ></asp:TextBox></div><div style="float:left;"><label
                                id="lbF_RoleName" for="F_RoleName"></label></div>
                             <%--<asp:TextBox ID="F_RoleName" runat="server" ></asp:TextBox>--%>
                            <%-- <label id="lbF_RoleName" for="F_RoleName"></label>--%>
                        </td>
                        <th style="color:red">
                            所属部门：
                        </th>
                        <td>
                        <div style="float:left;"><asp:TextBox ID="F_DeptName" runat="server" ></asp:TextBox></div><div style="float:left;"><label
                                id="lbF_DeptName" for="F_DeptName"></label></div>
                           <%-- <asp:TextBox ID="F_DeptName" runat="server" ></asp:TextBox>--%>
                            <%--<label id="lbF_DeptName" for="F_DeptName"></label>--%>
                        </td>
                    </tr>

                     <tr>
                        <th>
                            话务标志：</th>
                        <td>
                         <div id="radiolist1"></div>
                        </td>
                        <th>
                        坐&nbsp; 席&nbsp; 组：
                        </th>
                        <td>
                            <asp:TextBox ID="ZXZ" runat="server" ></asp:TextBox>
                        </td>
                    </tr>

                    <tr>
                        <th>
                         坐席权限：
                            </th>
                        <td>
                        <div id="radiolist2"></div>
                        </td>
                        <th>
                        分&nbsp;&nbsp;机&nbsp;&nbsp;号：
                        </th>
                        <td>
                        <asp:TextBox ID="txtExtNo" runat="server" CssClass="txtInput normal" Style="width: 120px;"></asp:TextBox>
                        </td>
                    </tr>
                   
                    <tr>
                        <th>
                             坐席类型：
                        </th>
                        <td>
                <div id="radiolist3"></div>
                        </td>
                        <th>
                             <%--所属团队：--%>坐席工号：
                        </th>
                        <td>
                            <%--<asp:TextBox ID="txtTeam" runat="server" ></asp:TextBox>--%>
                            <asp:TextBox ID="txtWorkNumber" runat="server" CssClass="txtInput normal" Style="width: 120px;"></asp:TextBox>
                        </td>
                        <%--<th>
                           所属计划：
                        </th>
                        <td>
                            <asp:TextBox ID="txtSJBH" runat="server" ></asp:TextBox>
                        </td>--%>
                    </tr>
                      <tr>
                        <th>
                             员工性别：
                        </th>
                        <td>
                            <div id="radiolist4"></div>
                        </td>
                        <th>
                           用户生日：
                        </th>
                        <td>
                            <asp:TextBox ID="txtBirthday" runat="server" CssClass="txtInput normal" Style="width: 120px;" onfocus="WdatePicker({skin:'whyGreen'})"></asp:TextBox>
                        </td>
                    </tr>


                    <tr>
                        <th>
                           固定电话：
                        </th>
                        <td>
                            <asp:TextBox ID="txtTelphone" runat="server" CssClass="txtInput normal" Style="width: 120px;"></asp:TextBox>
                        </td>
                        <th>
                           手机号码：
                        </th>
                        <td>
                            <asp:TextBox ID="txtMobel" runat="server" CssClass="txtInput normal" Style="width: 120px;"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <th>
                            用户备注：
                        </th>
                        <td colspan="3">
                            <asp:TextBox ID="txtRemark" runat="server" CssClass="txtInput normal" TextMode="MultiLine"
                                Style="width: 355px; height: 60px;"></asp:TextBox>
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>
        <div class="foot_btn_box">
            <asp:Button ID="btnSubmit" runat="server" Text="保&nbsp;&nbsp;存" CssClass="btnSubmit"
                OnClientClick="return validate();" OnClick="btnSubmit_Click" />
        </div>
    </div>
    </form>
</body>
</html>
