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

<!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>
    <title>编辑客户联系人</title>
    <link href="../scripts/ui/skins/Aqua/css/ligerui-all.css" rel="stylesheet" type="text/css" />
    <script src="../scripts/jquery/jquery-1.3.2.min.js" type="text/javascript"></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/function.js"></script>
    <script src="../scripts/ui/js/core/base.js" type="text/javascript"></script>
    <script src="../scripts/ui/js/ligerui.min.js" type="text/javascript"></script>
    <link href="../scripts/ui/skins/Tab/css/tab.css" rel="stylesheet" type="text/css" />
    <link href="../images/style.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript">
        function CloseThis() {
            var dialog = frameElement.dialog;
            parent.LoadList();
            dialog.close();
        }
        function SaveInfo(res) {
            switch (res) {
                case 'success':
                    $.ligerDialog.success('保存成功', function (yes) { CloseThis(); });
                    break;
                case 'warn':
                    $.ligerDialog.error('保存失败，请确认数据正确性');
                    break;
                case 'error':
                    $.ligerDialog.error('系统错误，请联系开发商');
                    break;
                default:
                    break;
            }
        }
        $(function () {
            $("#txtCustomerName").ligerComboBox({ width: 350, selectBoxWidth: 350, autocomplete: true });
            var sexdata = [
            { id: 1, name: '男' },
            { id: 0, name: '女' }
            ];
            $('#txtSex').ligerRadioList({
                data: sexdata,
                textField: 'name',
                onSelect: function () { alert("KKK"); }
            });
            if (document.getElementById("hfSex").value != "") {
                liger.get("txtSex").setValue(document.getElementById("hfSex").value);
            } else {
                liger.get("txtSex").setValue("1");
            }
        });
        function InitList() {
            $("#txtCustomerName").ligerComboBox({
                url: 'ajax/personedit.ashx?action=getcustomerlist&key=' + $("#txtCustomerName").val(),
                valueField: '_f_customerid',
                textField: '_f_customername',
                //selectBoxWidth: 350,
                autocomplete: true,
                width: 350,
                onSelected: function (newvalue) {
                    $("#hiddCustomerId").val(newvalue);
                }
            });
        }
        
        function validate() {
            //lblCustomerName.innerHTML = "*";
            lblContactName.innerHTML = "*";
//            if (document.getElementById("txtCustomerName").value == "") {
//                lblCustomerName.innerHTML = "请选择所属客户";
//                return false;
//            }
            //            else
            if (document.getElementById("txtContactName").value == "") {
                lblContactName.innerHTML = "请填写联系人";
                return false;
            }
            //wbx 5-29 添加账户和密码字段
            lbAccount.innerHTML = "*";
            lbPwd.innerHTML = "*";
            if (document.getElementById("txtAccount").value == "") {
                lbAccount.innerHTML = "请填写账户";
                return false;
            }
            if (document.getElementById("txtPwd").value == "") {
                lbPwd.innerHTML = "请填写密码";
                return false;
            }
            return true;
        }
    </script>
</head>
<body class="mainbody" scroll="no" style="margin-top: 0px;">
    <form id="form1" runat="server">
    <div id="contentTab">
        <table class="form_table">
                <col width="85px" />
                <col />
                <col width="85px" />
                <col />
                <tbody>
                <tr>
                        <th>
                            所属客户：
                        </th>
                        <td colspan="3">
                            <asp:HiddenField ID="hiddCustomerId" runat="server" />
                            <div style="float:left"><asp:TextBox ID="txtCustomerName" runat="server"></asp:TextBox></div>
                            <input id="btnSearch" type="button" value="搜 索" class="btnSearch" onclick="InitList();" />
                               <label id="lblCustomerName" for="txtCustomerName">*</label>
                        </td>
                    </tr>
                    <tr>
                        <th>
                            联系人：
                        </th>
                        <td>
                            <asp:HiddenField ID="hiddPersonId" runat="server" />
                            <asp:TextBox ID="txtContactName" runat="server" CssClass="txtInput normal" Style="width: 120px;"></asp:TextBox>
                            <label id="lblContactName" for="txtContactName">*</label>
                        </td>
                        <th>
                            性别：
                        </th>
                        <td>
                            <div id="txtSex"></div>
                            <asp:HiddenField ID="hfSex" runat="server" />
                        </td>
                    </tr>
                    <%--wbx 5-29 添加账户和密码字段--%>
                    <tr>
                        <th>
                            账户：
                        </th>
                        <td>
                            <asp:TextBox ID="txtAccount" runat="server" CssClass="txtInput normal" Style="width: 120px;"></asp:TextBox>
                            <label id="lbAccount" for="txtAccount">*</label>
                        </td>
                        <th>
                            密码：
                        </th>
                        <td>
                            <asp:TextBox ID="txtPwd" runat="server" CssClass="txtInput normal" Style="width: 120px;"></asp:TextBox>
                            <label id="lbPwd" for="txtPwd">*</label>
                        </td>
                    </tr>
                     <tr>
                        <th>
                            职务：
                        </th>
                        <td>
                            <asp:TextBox ID="txtDuty" runat="server" CssClass="txtInput normal" Style="width: 120px;"></asp:TextBox>
                        </td>
                        <th>
                            邮箱：
                        </th>
                        <td>
                            <asp:TextBox ID="txtEmail" runat="server" CssClass="txtInput normal" Style="width: 120px;"></asp:TextBox>
                        </td>
                    </tr>
                      <tr>
                        <th>
                             办公电话：
                        </th>
                        <td>
                            <asp:TextBox ID="txtTelePhone" runat="server" CssClass="txtInput normal" Style="width: 120px;"></asp:TextBox>
                        </td>
                        <th>
                           手机：
                        </th>
                        <td>
                            <asp:TextBox ID="txtMobile" runat="server" CssClass="txtInput normal" Style="width: 120px;"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <th>
                             联系QQ：
                        </th>
                        <td>
                            <asp:TextBox ID="txtQQ" runat="server" CssClass="txtInput normal" Style="width: 120px;"></asp:TextBox>
                        </td>
                        <th>
                           传真：
                        </th>
                        <td>
                            <asp:TextBox ID="txtFax" runat="server" CssClass="txtInput normal" Style="width: 120px;"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <th>
                             备注：
                        </th>
                        <td colspan="3"><textarea
                                id="txtRemark" runat="server" class="txtInput normal" style="width:330px; height:60px;" cols="20" rows="3"></textarea>
                        </td>
                    </tr>
                </tbody>
            </table>
        <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>