<%@ Page Language="C#" %>
<%@ Register TagPrefix="aspxform" Namespace="XFormDesigner.Framework.Web.UI" Assembly="XFormDesigner.Framework" %>
<script runat="server">

    // Insert page code here
    //
        protected void Page_Load(object sender, EventArgs e)
    {
      string item = Request.QueryString["itemid"];
      string customerID=Request.QueryString["CustomerID"];
      this.XTextBox15.Text=customerID;
      if(!string.IsNullOrEmpty(item)){
    
         }
          string AAA= Request.QueryString["AAA"];
          if(!string.IsNullOrEmpty(AAA)){
    
         }
          string cus = Request.QueryString["cusid"];
    
    
          string itemID = Request.QueryString["edititem"];
    
    }

</script>
<html xmlns:xform="xmlns:xform">
<head runat="server">
    <link href="/Oimec/Styles/css/StyleSheet.css" rel="stylesheet" type="text/css" />
    <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" />
    <title>BPM Form</title> <style>
    BODY {FONT-SIZE: 12px; FONT-FAMILY: verdana}
    TABLE {border-collapse: collapse; FONT-SIZE: 12px; FONT-FAMILY: verdana}
    P {PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px; FONT-SIZE: 12px; FONT-FAMILY: verdana}
    TD {PADDING-RIGHT: 0px; PADDING-LEFT: 2px; PADDING-BOTTOM: 0px}
    TD.NoPadding {PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px}
    INPUT {HEIGHT: 20px}
    INPUT.UL {BORDER-RIGHT: medium none; BORDER-TOP: medium none; BORDER-LEFT: medium none; BORDER-BOTTOM: #33ff33 1px solid}
    TEXTAREA {FONT-SIZE:12px}
    </style>
    <script type="text/javascript">

        //验证手机号位数必须11位
        function Isverify(mobile)
        {
            if (mobile.length > 0 && mobile.length != 11) {
                return 1;
            }else return 0;
        }

        //验证邮箱
        function EmailVerification(email) {
            var flag = 0;
            var reg = /^([a-zA-Z0-9]+[_|\-|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\-|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/gi;
            if (!reg.test(email)) {
                flag = 1;
            }
            return flag;
        }

        //保存
        agent.on('beforeSubmit', function (action, actionname) {

            //是否默认收货地址
  
            var IsDefaultReceipt= checkedVaule("IsDefaultReceipt");
            //默认收票地址
            var IsDefaultTicketCollection = checkedVaule("IsDefaultTicketCollection");
            //默认合同地址
            var IsDefaultContract = checkedVaule("IsDefaultContract");
            var CustomerID =  agent.Eles[document.getElementById("XTextBox15").getAttribute("xform_xele_index")].getValue();
            
            YZSoft.Ajax.request({
                async: false,
                url: YZSoft.$url('Oimec/WorkFlow/Services/MasterDataHandler.ashx'),
                params: {
                    method: 'UpdateMasterContract',
                    IsDefaultReceipt: IsDefaultReceipt,
                    IsDefaultTicketCollection: IsDefaultTicketCollection,
                    IsDefaultContract: IsDefaultContract,
                    CustomerID: CustomerID
                },
                success: function (action) {
                    var data = action.result;
                    var code = data.code;
                    return true;

                },
                failure: function (response) {
                }
            });
        });

        function  checkedVaule (name) {
            var obj = document.getElementsByName(name);
            for (var i = 0; i < obj.length; i++) {
                if (obj[i].checked) {
                    return obj[i].value;
                }
            }

        }

</script>
</head>
<body>
    <form runat="server">
        <table width="1200" align="center" class="head" border="0" cellspacing="0" cellpadding="0">
            <tbody>
                <tr>
                    <td class="logo">
                    </td>
                    <td class="biaoti">
                        <asp:Label id="XLabel2" runat="server" text="联系人" value valuetodisplaytext></asp:Label></td>
                    <td class="formno">
                    </td>
                </tr>
            </tbody>
        </table>
        <br />
        <table width="1200" align="center" class="table">
            <tbody>
                <tr>
                    <td width="106" class="td">
                        <asp:Label id="XLabel20" runat="server" text="创建用户" value valuetodisplaytext></asp:Label></td>
                    <td width="9" class="td1">
                        <aspxform:XTextBox id="XTextBox4" runat="server" backColor="#e6f1f8" ValueToDisplayText="TableName:V_Users;FilterColumn:Account;DisplayColumn:DisplayName" XDataBind="DF_Partner_ContactZK.AppAccount" CssClass="text" Width="70%"></aspxform:XTextBox>
                    </td>
                    <td width="50" class="td">
                        <asp:Label id="XLabel21" runat="server" text="创建日期" value valuetodisplaytext></asp:Label></td>
                    <td width="8" class="td1">
                        <aspxform:XDateTimePicker id="XDateTimePicker1" runat="server" backColor="#e6f1f8" XDataBind="DF_Partner_ContactZK.CreateDate" CssClass="text" Width="50%" DisplayOnly="True"></aspxform:XDateTimePicker>
                    </td>
                </tr>
                <tr>
                    <td class="td">
                        <asp:Label id="XLabel12" runat="server" text="拥有人" value valuetodisplaytext></asp:Label></td>
                    <td class="td1">
                        <aspxform:XTextBox id="XTextBox12" runat="server" backColor="#e6f1f8" ValueToDisplayText="TableName:V_Users;FilterColumn:Account;DisplayColumn:DisplayName" XDataBind="DF_Partner_ContactZK.OwnerAccount" CssClass="text" Width="220px"></aspxform:XTextBox>
                        &nbsp;<aspxform:XDataBrowserButton id="XDataBrowserButton1" runat="server" Width="41px" XDataSource="TableName:V_DF_HR_BasicInfo" Height="25px" Text="查询" DisplayColumns="Name:姓名,;Department:部门,;AttendanceKakaNO:帐号," DataMap="AttendanceKakaNO->DF_Partner_ContactZK.OwnerAccount"></aspxform:XDataBrowserButton>
                    </td>
                    <td class="td">
                    </td>
                    <td class="td1">
                    </td>
                </tr>
            </tbody>
        </table>
        <br />
        <table width="1200" align="center" class="table">
            <tbody>
                <tr>
                    <td height="22" class="title1" colspan="4">
                        <asp:Label id="XLabel1" runat="server" text="联系人基本信息 " value valuetodisplaytext></asp:Label>
                        <aspxform:XTextBox id="XTextBox7" runat="server" ValueToDisplayText XDataBind="DF_Partner_ContactZK.ContactType" Width="50px" Max="0" Min="0" Height="20px" BorderWidth="1px" BorderColor="Gainsboro" HiddenInput="True">客户</aspxform:XTextBox>
                        <aspxform:XTextBox id="XTextBox15" runat="server" ValueToDisplayText XDataBind="DF_Partner_ContactZK.PartnerID" Width="55px" Height="20px" HiddenInput="True" Value></aspxform:XTextBox>
                        &nbsp;&nbsp; 
                        <aspxform:XTextBox id="XTextBox9" runat="server" ValueToDisplayText Max="0" Min="0" BorderWidth="1px" BorderColor="Gainsboro" HiddenInput="True" Express='javascript("Isverify",DF_Partner_ContactZK.ContactMobile)' width="50px">0</aspxform:XTextBox>
                        <aspxform:XTextBox id="XTextBox10" runat="server" ValueToDisplayText Max="0" Min="0" BorderWidth="1px" BorderColor="Gainsboro" HiddenInput="True" width="50px">0</aspxform:XTextBox>
                          <aspxform:XTextBox id="XTextBox17" runat="server" ValueToDisplayText Max="0" Min="0" BorderWidth="1px" BorderColor="Gainsboro" HiddenInput="True" Express='javascript("EmailVerification",DF_Partner_ContactZK.ContactEmail)' width="50px">0</aspxform:XTextBox>
                         <aspxform:XTextBox id="XTextBox18" runat="server" ValueToDisplayText Max="0" Min="0" BorderWidth="1px" BorderColor="Gainsboro" HiddenInput="True" width="50px">0</aspxform:XTextBox>
                    </td>
                </tr>
                <tr>
                    <td height="23" class="td" style="width:5.3%">
                        <asp:Label id="XLabel15" runat="server" text="*" value valuetodisplaytext forecolor="Red"></asp:Label><asp:Label id="XLabel7" runat="server" text="联系人姓名" value valuetodisplaytext></asp:Label></td>
                    <td class="td1" >
                        <aspxform:XTextBox id="XTextBox5" runat="server" XDataBind="DF_Partner_ContactZK.ContactName" CssClass="text" width="70%"></aspxform:XTextBox>
                    </td>
                    <td class="td" style="width: 25%">
                        <asp:Label id="XLabel3" runat="server" text="SAP编号" value valuetodisplaytext></asp:Label></td>
                    <td class="td1">
                        <aspxform:XTextBox id="XTextBox1" runat="server" XDataBind="DF_Partner_ContactZK.ContactSAPID" CssClass="text1" width="70%" ReadOnly="True"></aspxform:XTextBox>
                    </td>
                </tr>
                <tr>
                    <td height="23" class="td">
                        <asp:Label id="XLabel16" runat="server" text="*" value valuetodisplaytext forecolor="Red"></asp:Label><asp:Label id="XLabel9" runat="server" text="固定电话" value valuetodisplaytext></asp:Label></td>
                    <td class="td1">
                        <%--<aspxform:XTextBox id="XTextBox7" runat="server" ValueToDisplayText Value XDataBind="DF_Partner_ContactZK.ContactTelCode" CssClass="text" Width="55px"></aspxform:XTextBox>--%>
                        <aspxform:XTextBox id="XTextBox8" runat="server" ValueToDisplayText XDataBind="DF_Partner_ContactZK.ContactTel" CssClass="text" Width="200px" Value></aspxform:XTextBox>
                        <%--<aspxform:XTextBox id="XTextBox9" runat="server" ValueToDisplayText Value XDataBind="DF_Partner_ContactZK.ContactTelExt" CssClass="text" Width="55px"></aspxform:XTextBox>--%></td>
                    <td height="23" class="td">
                        <asp:Label id="XLabel4" runat="server" text="传真" value valuetodisplaytext></asp:Label></td>
                    <td class="td1">
                        <%--<aspxform:XTextBox id="XTextBox2" runat="server" ValueToDisplayText Value XDataBind="DF_Partner_ContactZK.FaxCode" CssClass="text" Width="55px"></aspxform:XTextBox>--%>
                        <aspxform:XTextBox id="XTextBox3" runat="server" ValueToDisplayText XDataBind="DF_Partner_ContactZK.Fax" CssClass="text" Width="200px" Value></aspxform:XTextBox>
                        <%--<aspxform:XTextBox id="XTextBox10" runat="server" ValueToDisplayText Value XDataBind="DF_Partner_ContactZK.FaxExt" CssClass="text" Width="55px"></aspxform:XTextBox>--%></td>
                </tr>
                <tr>
                    <td height="24" class="td">
                        <asp:Label id="XLabel17" runat="server" text="*" value valuetodisplaytext forecolor="Red"></asp:Label><asp:Label id="XLabel8" runat="server" text="移动电话" value valuetodisplaytext></asp:Label></td>
                    <td class="td1">
                        <aspxform:XTextBox id="XTextBox13" runat="server" XDataBind="DF_Partner_ContactZK.ContactMobile" CssClass="text" width="70%"></aspxform:XTextBox>
                    </td>
                    <td class="td">
                        <asp:Label id="XLabel18" runat="server" text="*" value valuetodisplaytext forecolor="Red"></asp:Label><asp:Label id="XLabel13" runat="server" text="电子邮件" value valuetodisplaytext></asp:Label></td>
                    <td class="td1">
                        <aspxform:XTextBox id="XTextBox14" runat="server" XDataBind="DF_Partner_ContactZK.ContactEmail" CssClass="text" width="70%"></aspxform:XTextBox>
                    </td>
                </tr>
                <tr>
                    <td class="td" style="HEIGHT: 23px">
                        <asp:Label id="XLabel19" runat="server" text="*" value valuetodisplaytext forecolor="Red"></asp:Label><asp:Label id="XLabel14" runat="server" text="联系人地址" value valuetodisplaytext></asp:Label>
                        <aspxform:XTextBox id="XTextBox24" runat="server" ValueToDisplayText XDataBind="ProvinceID" Max="0" Min="0" BorderWidth="1px" BorderColor="Gainsboro" HiddenInput="True" width="25px"></aspxform:XTextBox>
                    </td>
                    <td class="td1">
                        <aspxform:XDropDownList id="XDropDownList19" runat="server" XDataBind="DF_Partner_ContactZK.Province" XDataSource="TableName:DF_Comm_Province" DataMap="ProvinceID->ProvinceID" ValueColumn="ProvinceName" DisplayColumn="ProvinceName" PromptText="----请选择----"></aspxform:XDropDownList>
                        <aspxform:XDropDownList id="XDropDownList6" runat="server" XDataBind="DF_Partner_ContactZK.City" XDataSource="TableName:DF_Comm_City;Filter:ProvinceID->ProvinceID" ValueColumn="CityName" DisplayColumn="CityName" PromptText="----请选择----"></aspxform:XDropDownList>
                        <aspxform:XTextBox id="XTextBox11" runat="server" XDataBind="DF_Partner_ContactZK.ContactAddr" CssClass="text" width="60%"></aspxform:XTextBox>
                    </td>
                    <td class="td" style="HEIGHT: 24px">
                        <asp:Label id="XLabel24" runat="server" text="*" value valuetodisplaytext forecolor="Red"></asp:Label><asp:Label id="XLabel6" runat="server" text="部门名称" value valuetodisplaytext></asp:Label>
                        <aspxform:XTextBox id="XTextBox2" runat="server" XDataBind="DF_Partner_ContactZK.ContactDept" Width="10px" Height="20px" BorderWidth="1" BorderColor="#DCDCDC" HiddenInput="True"></aspxform:XTextBox>
                    </td>
                    <td class="td1">
                        <aspxform:XDropDownList id="XDropDownList1" runat="server" XDataBind="DF_Partner_ContactZK.DepartType" Width="50%" XDataSource="TableName:DF_DataSourceList;Filter:Type->varDept;OrderBy:OrderID" Height="23px" DataMap="Value->DF_Partner_ContactZK.ContactDept" ValueColumn="Name" DisplayColumn="Name">
                            <asp:ListItem Selected="True">未绑定</asp:ListItem>
                        </aspxform:XDropDownList>
                        <aspxform:XLabel id="XLabel25" runat="server" text="部门" ValueToDisplayText XDataBind="varDept" Value HiddenExpress="1"></aspxform:XLabel>
                    </td>
                </tr>
                <tr>
                    <td class="td" style="HEIGHT: 24px">
                        <asp:Label id="Label1" runat="server" text="邮编"></asp:Label></td>
                    <td class="td1">
                        <aspxform:XTextBox id="XTextBox16" runat="server" XDataBind="DF_Partner_ContactZK.ZipCode" CssClass="text" width="70%"></aspxform:XTextBox>
                    </td>
                    <td class="td">
                        <asp:Label id="XLabel5" runat="server" text="职位名称" value valuetodisplaytext></asp:Label></td>
                    <td class="td1">
                        <aspxform:XTextBox id="XTextBox6" runat="server" XDataBind="DF_Partner_ContactZK.Position" CssClass="text" width="70%"></aspxform:XTextBox>
                    </td>
                </tr>
                <tr>
                      <td class="td" style="HEIGHT: 24px">
                          <asp:Label id="Label2" runat="server" text="默认收货地址"></asp:Label></td>
                           <td class="td1">
                                <aspxform:XRadioButtonList id="IsDefaultReceipt" runat="server"  XDataBind="DF_Partner_ContactZK.IsDefaultReceipt" RepeatDirection="Horizontal" name="IsDefaultReceipt">
                            <asp:ListItem>是</asp:ListItem>
                            <asp:ListItem>否</asp:ListItem>
                        </aspxform:XRadioButtonList>
                          </td>
                      <td class="td1">
                           
                          </td>
                       <td class="td1">
                          </td>
                </tr>
                <tr>
                    <td class="td" style="HEIGHT: 24px">
                          <asp:Label id="Label3" runat="server" text="默认收票地址"></asp:Label></td>
                           <td class="td1" colspan="3">
                                <aspxform:XRadioButtonList id="IsDefaultTicketCollection" runat="server" XDataBind="DF_Partner_ContactZK.IsDefaultTicketCollection"  RepeatDirection="Horizontal" name="IsDefaultTicketCollection">
                            <asp:ListItem>是</asp:ListItem>
                            <asp:ListItem>否</asp:ListItem>
                        </aspxform:XRadioButtonList>
                          </td>
                </tr>
                <tr>
                    <td class="td" style="HEIGHT: 24px">
                          <asp:Label id="Label4" runat="server" text="默认合同地址"></asp:Label></td>
                           <td class="td1" colspan="3">
                                <aspxform:XRadioButtonList id="IsDefaultContract" runat="server" XDataBind="DF_Partner_ContactZK.IsDefaultContract" RepeatDirection="Horizontal" name="IsDefaultContract">
                            <asp:ListItem>是</asp:ListItem>
                            <asp:ListItem>否</asp:ListItem>
                        </aspxform:XRadioButtonList>
                          </td>
                </tr>
            </tbody>
        </table>
        <aspxform:XRequiredFieldValidator id="XRequiredFieldValidator1" runat="server" ErrorMessage="请填写联系人姓名" ControlToValidate="XTextBox5"></aspxform:XRequiredFieldValidator>
        &nbsp;<aspxform:XRequiredFieldValidator id="XRequiredFieldValidator3" runat="server" ErrorMessage="请填写联系人固定电话" ControlToValidate="XTextBox8"></aspxform:XRequiredFieldValidator>
        &nbsp; <%--<aspxform:XRequiredFieldValidator id="XRequiredFieldValidator4" runat="server" ControlToValidate="XTextBox9" ErrorMessage="请填写分机号" DisableExpress="1"></aspxform:XRequiredFieldValidator>--%>&nbsp;&nbsp;<aspxform:XRequiredFieldValidator id="XRequiredFieldValidator2" runat="server" ErrorMessage="请填写联系人移动电话" ControlToValidate="XTextBox13"></aspxform:XRequiredFieldValidator>
        &nbsp;<aspxform:XCompareValidator id="XCompareValidator1" runat="server" ErrorMessage="移动电话必须11位!" ControlToValidate="XTextBox9" ControlToCompare="XTextBox10" ForeColor="Red" Display="None">手机号必须11位!</aspxform:XCompareValidator>
        &nbsp;&nbsp;&nbsp;<aspxform:XRequiredFieldValidator id="XRequiredFieldValidator5" runat="server" ErrorMessage="请填写电子邮件" ControlToValidate="XTextBox14"></aspxform:XRequiredFieldValidator>
         &nbsp;<aspxform:XCompareValidator id="XCompareValidator2" runat="server" ErrorMessage="邮箱格式不正确!" ControlToValidate="XTextBox17" ControlToCompare="XTextBox18" ForeColor="Red" Display="None">邮箱格式不正确</aspxform:XCompareValidator>
        &nbsp;<aspxform:XRequiredFieldValidator id="XRequiredFieldValidator6" runat="server" ErrorMessage="请选择部门名称" ControlToValidate="XDropDownList1"></aspxform:XRequiredFieldValidator>
        &nbsp;<aspxform:XRequiredFieldValidator id="XRequiredFieldValidator7" runat="server" ErrorMessage="请填写联系人地址" ControlToValidate="XTextBox11"></aspxform:XRequiredFieldValidator>
    </form>
</body>
</html>
