<%@ Page Language="C#" MasterPageFile="~/Dialog/DialogEdit.Master" AutoEventWireup="true"
    CodeBehind="ContactEdit.aspx.cs" Inherits="OAWeb.crm.contact.ContactEdit" EnableViewState="true"  %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <script type="text/javascript">
        function OpenWin() {
            OpenRadioDialog('/Dialog/CustomerDialog.aspx', '选择客户', CallbackFun);
            return false;
        }

        function CallbackFun(text, value) {
            $('#<%=txtCustomerName.ClientID %>').val(text);
            $('#<%=txtCustomerID.ClientID %>').val(value);
        } 
    </script>
    <div style="width: 650px; height: 500px; overflow-y: scroll">
        <table class="TableBorder" align="center" bordercolor="#e6e6e6" cellspacing="0" cellpadding="2"
            border="1" style="width: 620px; height: 440px;">
            <tr class="AlterColor">
                <td align="right" colspan="4" bgcolor="#e6e6e6">
                    <p align="center">
                        <b>联系人信息</b>
                </td>
            </tr>
            <tr>
                <td align="left" class="st12pt" colspan="4" style="height: 23px">
                    <font color="#003399"><b>联系人 </b><span style="font-size: 9pt">(<font color="#ff0000"
                        face="Wingdings">v</font>表示必填字段)</span></font>
                </td>
            </tr>
            <tr>
                <td align="right" class="st12pt" style="width: 80px">
                    <span style="color: #ff0000; font-family: Wingdings">v</span>姓名：
                </td>
                <td align="left" class="st12pt" style="width: 190px">
                    <asp:TextBox ID="txtName" runat="server" Width="180px" MaxLength="25"></asp:TextBox>
                </td>
                <td align="right" class="st12pt" style="width: 80px">
                    <span style="color: #ff0000; font-family: Wingdings">v</span>对应客户：
                </td>
                <td align="left" class="st12pt" style="width: 221px">
                    <asp:TextBox ID="txtCustomerName" runat="server" Width="180px" Enabled="False"></asp:TextBox>
                    <input name="button" type="button" id="btnSelect" onclick="return OpenWin();" value="..."
                        runat="server" />
                </td>
            </tr>
            <tr>
                <td align="right" class="st12pt" style="width: 80px; height: 25px;">
                    性别：
                </td>
                <td align="left" class="st12pt" style="width: 190px; height: 25px;">
                    <asp:DropDownList ID="ddlSex" runat="server">
                        <asp:ListItem Value="1">男</asp:ListItem>
                        <asp:ListItem Value="2">女</asp:ListItem>
                    </asp:DropDownList>
                </td>
                <td align="right" class="st12pt" style="width: 80px; height: 25px;">
                    分类：
                </td>
                <td align="left" class="st12pt" style="width: 221px; height: 25px">
                    <asp:DropDownList ID="ddlContactTypeID" runat="server">
                    <asp:ListItem Value="0">请选择</asp:ListItem>
                    </asp:DropDownList>
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td align="right" class="st12pt" style="width: 80px; height: 25px">
                    主联系人：
                </td>
                <td align="left" class="st12pt" style="height: 25px; width: 190px;">
                    <asp:CheckBox ID="chkIsPrimary" runat="server" Text="是" />
                </td>
                <td align="right" class="st12pt" style="height: 25px; width: 80px;">
                    称谓：
                </td>
                <td align="left" class="st12pt" style="height: 25px; width: 221px;">
                    &nbsp;<asp:TextBox ID="txtTitle" runat="server" Width="180px" MaxLength="10"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td align="right" class="st12pt" style="width: 80px; height: 25px;">
                    部门：
                </td>
                <td align="left" class="st12pt" style="width: 190px; height: 25px;">
                    <asp:TextBox ID="txtDepartment" runat="server" Width="180px" MaxLength="10"></asp:TextBox>
                </td>
                <td align="right" class="st12pt" style="width: 80px; height: 25px;">
                    &nbsp;职务：
                </td>
                <td align="left" class="st12pt" style="width: 221px; height: 25px">
                    &nbsp;<asp:TextBox ID="txtJobTitle" runat="server" Width="180px" MaxLength="10"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td align="left" class="st12pt" colspan="4" style="height: 23px">
                    <b><font color="#003399">联系方式：</font></b>
                </td>
            </tr>
            <tr class="AlterColor">
                <td align="right" class="st12pt" style="width: 80px; height: 25px;">
                    工作电话：
                </td>
                <td align="left" class="st12pt" style="width: 190px; height: 25px;">
                    <asp:TextBox ID="txtTelphone" runat="server" Width="180px" MaxLength="50"></asp:TextBox>
                </td>
                <td align="right" class="st12pt" style="width: 80px; height: 25px;" nowrap="nowrap">
                    移动电话：
                </td>
                <td align="left" class="st12pt" style="width: 221px; height: 25px">
                    <asp:TextBox ID="txtMobilePhone" runat="server" Width="180px" MaxLength="50"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td align="right" class="st12pt" style="width: 80px; height: 25px;">
                    传真：
                </td>
                <td align="left" class="st12pt" style="width: 190px; height: 25px;">
                    <asp:TextBox ID="txtFax" runat="server" Width="180px" MaxLength="50"></asp:TextBox>
                </td>
                <td align="right" class="st12pt" style="width: 80px; height: 25px;">
                    家庭电话：
                </td>
                <td align="left" class="st12pt" style="width: 221px; height: 25px">
                    <asp:TextBox ID="txtHomePhone" runat="server" Width="180px" MaxLength="50"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td align="right" class="st12pt" style="width: 80px; height: 25px;">
                    邮件地址：
                </td>
                <td colspan="3" align="left" class="st12pt" style="height: 25px">
                    <asp:TextBox ID="txtEmail" runat="server" Width="180px" MaxLength="50"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td align="right" class="st12pt" style="width: 80px; height: 25px;">
                    QQ：
                </td>
                <td align="left" class="st12pt" style="width: 190px; height: 25px;">
                    <asp:TextBox ID="txtQQ" runat="server" Width="180px" MaxLength="20"></asp:TextBox>
                </td>
                <td align="right" class="st12pt" style="width: 80px; height: 25px;">
                    MSN：
                </td>
                <td align="left" class="st12pt" style="width: 221px; height: 25px">
                    <asp:TextBox ID="txtMSN" runat="server" Width="180px" MaxLength="50"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td align="left" class="st12pt" colspan="4" style="height: 23px">
                    <b><font color="#003399">其他：</font></b>
                </td>
            </tr>
            <tr class="AlterColor">
                <td align="right" class="st12pt" style="width: 80px">
                    生日：
                </td>
                <td align="left" class="st12pt" style="width: 190px">
                    <asp:TextBox ID="txtBirthday" runat="server" onfocus="WdatePicker()" Width="180px"></asp:TextBox>
                </td>
                <td align="right" class="st12pt" style="width: 80px">
                    爱好：
                </td>
                <td align="left" class="st12pt" style="width: 221px">
                    <asp:TextBox ID="txtHobby" runat="server" Width="180px" MaxLength="50"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td align="right" valign="top" class="st12pt" style="width: 80px" nowrap="nowrap">
                    备注说明：
                </td>
                <td colspan="3" align="left" class="st12pt">
                    <asp:TextBox ID="txtRemark" runat="server" Width="460px" MaxLength="50"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td align="center" valign="top" class="st12pt" colspan="4" style="height: 25px">
                    <input id="btnSave" type="button" value=" 保 存 " class="btn_77px" />&nbsp;
                    <asp:Button ID="btnCannel" runat="server"   OnClientClick="art.dialog.close();" Text="返 回" CssClass="btn_77px" />
                </td>
            </tr>
            <tr>
                <td align="left" class="st12pt" colspan="4" style="height: 25px" valign="top">
                    内容填写帮助：<br />
                    <ul>
                        <li><b>称谓</b>：和客户交往过程中，称谓的使用很频繁，注意这个字段的重要性。常见的有：李总、王老师、赵女士、张部长等，注意和客户的关系和尺度</li>
                        <li><b>主联系人：</b>主联系人不一定是客户中的职务最高的联系人，而是可以决定双方合作趋向的联系人，或者叫主要负责人</li>
                    </ul>
                </td>
            </tr>
        </table>
        <asp:HiddenField ID="txtCustomerID" runat="server" />
    </div>
    <script type="text/javascript">
        $(document).ready(function () {
            $("#btnSave").click(function () {
                $("#aspnetForm").ajaxSubmit({
                    url: "/crm/contact/ContactEdit.aspx?op=Save&CustomerID=<%=CustomerID %>&ContactID=<%=ContactID %>",
                    success: function (result) {
                        if (result.indexOf("url:") > -1) {
                            window.location.href = result.replace("url:", "");
                            return;
                        }
                        if (result == "ok") {
                            alert("保存成功");
                            CloseReload();
                        } else {
                            alert(result);
                        }
                    }
                });
                return false;
            })
        });
    </script>
</asp:Content>
