<%@ Page Language="C#" AutoEventWireup="True" MasterPageFile="~/Admin/MasterPage.master"
    Inherits="PowerEasy.Module.General.WebSite.Admin.User.UserUI" Title="用户添加/修改" CodeBehind="User.aspx.cs"
    EnableEventValidation="false" ValidateRequest="false" %>

<asp:Content ID="Content1" ContentPlaceHolderID="CphNavigation" runat="Server">
    <pe:ExtendedSiteMapPath ID="SmpNavigator" SiteMapProvider="AdminMapProvider" runat="server" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="CphContent" runat="Server">
    <asp:ScriptManager ID="SmgeRegion" runat="server" EnablePartialRendering="true">
    </asp:ScriptManager>
    <script language="javascript" type="text/javascript">
        function ShowTabs(ID) {
            for (i = 0; i < 7; i++) {
                if (i == ID) {
                    document.getElementById("TabTitle" + i).className = "titlemouseover";
                    document.getElementById("Tabs" + i).style.display = "";
                }
                else {
                    document.getElementById("TabTitle" + i).className = "tabtitle";
                    document.getElementById("Tabs" + i).style.display = "none";
                }
            }
        }
    </script>
    <table width="100%" border="0" cellpadding="0" cellspacing="0">
        <tr align="center">
            <td id="TabTitle0" class="titlemouseover" onclick="ShowTabs(0)">
                会员信息
            </td>
            <td id="TabTitle1" class="tabtitle" onclick="ShowTabs(1)">
                联系信息
            </td>
            <td id="TabTitle2" class="tabtitle" onclick="ShowTabs(2)">
                个人信息
            </td>
            <td id="TabTitle3" class="tabtitle" onclick="ShowTabs(3)">
                业务信息
            </td>
            <td id="TabTitle4" class="tabtitle" style="<%= IsShow()%>" onclick="ShowTabs(4)">
                单位信息
            </td>
            <td id="TabTitle5" class="tabtitle" onclick="ShowTabs(5)">
                会员选项
            </td>
            <td id="TabTitle6" class="tabtitle" style="<%= IsShow()%>" onclick="ShowTabs(6)">
                企业选项
            </td>
            <td>
                &nbsp;
            </td>
        </tr>
    </table>
    <table width="100%" border="0" cellpadding="5" cellspacing="1" class="border">
        <tr class="tdbg">
            <td valign="top">
                <table style="width: 100%; table-layout: fixed;" cellpadding="2" cellspacing="1"
                    class="border" id="Tabs0">
                    <tr class="tdbg">
                        <td class="tdbgleft" style="width: 10%; text-align: right">
                            会 员 组：
                        </td>
                        <td align="left" colspan="3">
                            <asp:DropDownList ID="DropGroupId" runat="server">
                            </asp:DropDownList>
                        </td>
                    </tr>
                    <tr class="tdbg">
                        <td class="tdbgleft" style="width: 10%; text-align: right">
                            用 户 名：
                        </td>
                        <td align="left" style="width: 44%;">
                            <asp:TextBox ID="TxtUserName" TabIndex="1" runat="server" Width="150px"></asp:TextBox>
                            <pe:RequiredFieldValidator ID="ValrUserName" ControlToValidate="TxtUserName" runat="server"
                                ErrorMessage="用户名不能为空！" Display="Dynamic"></pe:RequiredFieldValidator>
                        </td>
                        <td colspan="2" id="trPhoto" style="width: 44%" rowspan="7">
                           <pe:FileUploadControl ID="ExtenFileUpload" runat="server" ModuleName="User"
                               IsAddFileRecord="true" Width="170" Height="170" Pattern="Img">
                               </pe:FileUploadControl>
                        </td>
                    </tr>
                    <tr class="tdbg">
                        <td class="tdbgleft" style="width: 10%; text-align: right">
                            用户密码：
                        </td>
                        <td align="left" style="width: 44%;">
                            <asp:TextBox ID="TxtUserPassword" TabIndex="2" runat="server" Width="150px" TextMode="password" AutoComplete="off"
                                onkeydown="isSecurity(this.value);" onblur="Bardisplaynone();" onfocus="Bardisplayshow();"></asp:TextBox>
                            <br /><asp:Label Text="" runat="server" ID="LabelStrongPwd" />
                            <pe:RequiredFieldValidator ID="ValrUserPassword" ControlToValidate="TxtUserPassword"
                                runat="server" ErrorMessage="密码不能为空！" Display="Dynamic"></pe:RequiredFieldValidator>
                            <asp:RegularExpressionValidator ID="RegularExpressionPassword" runat="server" ControlToValidate="TxtUserPassword"
                                ErrorMessage="请输入新密码(至少6位)！" ValidationExpression="^.{6,}$" Display="Dynamic"></asp:RegularExpressionValidator>
                            <span id="BarBorder_TxtUserPassword"></span>
                        </td>
                    </tr>
                    <tr class="tdbg">
                        <td class="tdbgleft" style="width: 10%; text-align: right">
                            提示问题：
                        </td>
                        <td align="left" style="width: 44%;">
                            <asp:TextBox ID="TxtQuestion" TabIndex="3" runat="server" Width="150px"></asp:TextBox>
                            <pe:RequiredFieldValidator ID="ValrQuestion" ControlToValidate="TxtQuestion" runat="server"
                                ErrorMessage="提示问题不能为空！" Display="Dynamic"></pe:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr class="tdbg">
                        <td class="tdbgleft" style="width: 10%; text-align: right">
                            提示答案：
                        </td>
                        <td align="left" style="width: 44%;">
                            <asp:TextBox ID="TxtAnswer" runat="server" TabIndex="4" Width="150px"></asp:TextBox>
                            <pe:RequiredFieldValidator ID="ValrAnswer" ControlToValidate="TxtAnswer" runat="server"
                                ErrorMessage="提示答案不能为空！" Display="Dynamic"></pe:RequiredFieldValidator><asp:PlaceHolder
                                    ID="PhAnswer" runat="server" Visible="false"><span style="color: Green">不修改请留空</span></asp:PlaceHolder>
                        </td>
                    </tr>
                    <tr class="tdbg">
                        <td class="tdbgleft" style="width: 10%; text-align: right">
                            电子邮件：
                        </td>
                        <td align="left" style="width: 44%;">
                            <asp:TextBox ID="TxtEmail" runat="server" TabIndex="5" Width="150px"></asp:TextBox>
                            <pe:RequiredFieldValidator ID="ValrEmail" ControlToValidate="TxtEmail" runat="server"
                                ErrorMessage="Email不能为空！" Display="Dynamic"></pe:RequiredFieldValidator>
                            <pe:RegexValidator ValidateType="Email" ID="Vmail" runat="server" ControlToValidate="TxtEmail"
                                Display="Dynamic" ErrorMessage="电子邮件格式不对"></pe:RegexValidator>
                        </td>
                    </tr>
                    <tr class="tdbg">
                        <td class="tdbgleft" style="width: 10%; text-align: right">
                            隐私设定：
                        </td>
                        <td align="left" style="width: 44%;">
                            <asp:RadioButtonList ID="RadlPrivacySetting" Width="222px" runat="server" RepeatDirection="Horizontal">
                                <asp:ListItem Selected="True" Value="0">全部公开</asp:ListItem>
                                <asp:ListItem Value="1">部分公开</asp:ListItem>
                                <asp:ListItem Value="2">完全保密</asp:ListItem>
                            </asp:RadioButtonList>
                        </td>
                    </tr>
                    <tr class="tdbg">
                        <td class="tdbgleft" style="width: 10%; text-align: right">
                            偏爱语言：
                        </td>
                        <td align="left" style="width: 44%;">
                            <asp:DropDownList ID="DropCultureName" runat="server">
                            </asp:DropDownList>
                            <asp:Label ID="LblCultureName" runat="server" Text="中文(中国) [zh-CN] (默认)" Visible="false" />
                        </td>
                    </tr>
                    <tr class="tdbg" valign="top">
                        <td class="tdbgleft" style="width: 10%; text-align: right">
                            签名信息：
                        </td>
                        <td align="left" style="width: 44%;">
                            <asp:TextBox ID="TxtSign" runat="server" Height="74px" TextMode="MultiLine" Width="218px"></asp:TextBox>
                        </td>
                        <td colspan="2" style="width: 44%; height: 100%">
                            <table style="width: 100%; height: 74px">
                                <tr class="tdbg">
                                    <td class="tdbgleft" style="width: 24%; text-align: right; height: 50%">
                                        头像高度：
                                    </td>
                                    <td>
                                        <asp:TextBox ID="TxtFaceHeight" runat="server" Columns="4" MaxLength="4"></asp:TextBox>
                                        像素
                                        <pe:RegexValidator ValidateType="Number" ID="NumberValidatorFaceHeight" ControlToValidate="TxtFaceHeight"
                                            runat="server">
                                        </pe:RegexValidator>
                                    </td>
                                </tr>
                                <tr class="tdbg">
                                    <td class="tdbgleft" style="width: 24%; text-align: right; height: 50%">
                                        头像宽度：
                                    </td>
                                    <td>
                                        <asp:TextBox ID="TxtFaceWidth" runat="server" Columns="4" MaxLength="4"></asp:TextBox>
                                        像素
                                        <pe:RegexValidator ValidateType="Number" ID="NumberValidatorFaceWidth" ControlToValidate="TxtFaceWidth"
                                            runat="server">
                                        </pe:RegexValidator>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </table>
                <table style="width: 100%; display: none" cellpadding="2" cellspacing="1" class="border"
                    id="Tabs1">
                    <tr class="tdbg">
                        <td class="tdbgleft" style="text-align: right">
                            真实姓名：
                        </td>
                        <td align="left">
                            <asp:TextBox ID="TxtTrueName" runat="server" Width="150px"></asp:TextBox>
                        </td>
                        <td class="tdbgleft" style="text-align: right">
                            称谓：
                        </td>
                        <td align="left">
                            <asp:TextBox ID="TxtTitle" runat="server" Width="150px"></asp:TextBox>
                        </td>
                    </tr>
                    <pec:LiaisonInformation ID="LiaisonInformation1" runat="server"></pec:LiaisonInformation>
                </table>
                <table style="width: 100%; display: none" cellpadding="2" cellspacing="1" class="border"
                    id="Tabs2">
                    <pec:PersonalInformation ID="PersonalInformation1" runat="server" />
                </table>
                <table style="width: 100%; display: none" cellpadding="2" cellspacing="1" class="border"
                    id="Tabs3">
                    <tr class="tdbg">
                        <td class="tdbgleft" style="width: 12%; text-align: right">
                            单位名称：
                        </td>
                        <td align="left">
                            <asp:TextBox ID="TxtCompany" runat="server" Width="150px"></asp:TextBox>
                        </td>
                        <td class="tdbgleft" style="width: 12%; text-align: right">
                            所属部门：
                        </td>
                        <td style="width: 38%;" align="left">
                            <asp:TextBox ID="TxtDepartment" runat="server" Width="150px"></asp:TextBox>
                        </td>
                    </tr>
                    <tr class="tdbg">
                        <td class="tdbgleft" style="text-align: right">
                            职位：
                        </td>
                        <td align="left">
                            <asp:TextBox ID="TxtPosition" runat="server" Width="150px"></asp:TextBox>
                        </td>
                        <td class="tdbgleft" style="text-align: right">
                            负责业务：
                        </td>
                        <td align="left">
                            <asp:TextBox ID="TxtOperation" runat="server" Width="150px"></asp:TextBox>
                        </td>
                    </tr>
                    <tr class="tdbg">
                        <td class="tdbgleft" style="text-align: right">
                            单位地址：
                        </td>
                        <td colspan="3" align="left">
                            <asp:TextBox ID="TxtCompanyAddress" runat="server" Width="150px"></asp:TextBox>
                        </td>
                    </tr>
                </table>
                <table style="width: 100%; display: none" cellpadding="2" cellspacing="1" class="border"
                    id="Tabs4">
                    <pec:Company ID="Company1" Visible="false" AutoDataBind="false" runat="server"></pec:Company>
                </table>
                <table style="width: 100%; display: none" cellpadding="2" cellspacing="1" class="border"
                    id="Tabs5">
                    <tr class="tdbg">
                        <td>
                            <asp:UpdatePanel ID="UpnlUser" UpdateMode="Conditional" runat="server">
                                <ContentTemplate>
                                    <table cellpadding="2" cellspacing="1" style="width: 98%; background-color: white;">
                                        <asp:Repeater ID="RepModel" runat="server" OnItemDataBound="RepModel_OnItemDataBound">
                                            <ItemTemplate>
                                                <tr id='Tab' runat="server" class='tdbg'>
                                                    <td class='tdbgleft' align='right' style="width: 12%;">
                                                        <div class="DivWordBreak">
                                                            <strong>
                                                                <%# Eval("FieldAlias")%>
                                                                ：&nbsp;</strong><br />
                                                            <%# Eval("Tips") %>
                                                        </div>
                                                    </td>
                                                    <td class='tdbg' align='left'>
                                                        <pe:AdminFieldControl ID="Field" runat="server" EnableNull='<%# (bool)Eval("EnableNull") %>'
                                                            ModelId='<%# Eval("ModelId") %>' FieldAlias='<%# Eval("FieldAlias")%>' Tips='<%# Eval("Tips") %>'
                                                            FieldName='<%#Eval("FieldName")%>' ControlType='<%# Eval("FieldType") %>' FieldLevel='<%# Eval("FieldLevel") %>'
                                                            Description='<%# Eval("Description")%>' Settings='<%# ((PowerEasy.Module.General.Model.CommonModel.FieldInfo)Container.DataItem).Settings %>'
                                                            Value='<%# Eval("DefaultValue") %>'>
                                                        </pe:AdminFieldControl>
                                                    </td>
                                                </tr>
                                            </ItemTemplate>
                                        </asp:Repeater>
                                    </table>
                                </ContentTemplate>
                            </asp:UpdatePanel>
                        </td>
                    </tr>
                </table>
                <table style="width: 100%; display: none" cellpadding="2" cellspacing="1" class="border"
                    id="Tabs6">
                    <tr class="tdbg">
                        <td>
                            <asp:UpdatePanel ID="panCompany" runat="server">
                                <ContentTemplate>
                                    <table cellpadding="2" cellspacing="1" style="width: 98%; background-color: white;">
                                        <asp:Repeater ID="rptCompany" runat="server" OnItemDataBound="rptCompany_OnItemDataBound">
                                            <ItemTemplate>
                                                <tr id='Tab' runat="server" class='tdbg'>
                                                    <td class='tdbgleft' align='right' style="width: 12%;">
                                                        <div class="DivWordBreak">
                                                            <strong>
                                                                <%# Eval("FieldAlias")%>
                                                                ：&nbsp;</strong><br />
                                                            <%# Eval("Tips") %>
                                                        </div>
                                                    </td>
                                                    <td class='tdbg' align='left'>
                                                        <pe:AdminFieldControl ID="Field" runat="server" EnableNull='<%# (bool)Eval("EnableNull") %>'
                                                            ModelId='<%# Eval("ModelId") %>' FieldAlias='<%# Eval("FieldAlias")%>' Tips='<%# Eval("Tips") %>'
                                                            FieldName='<%#Eval("FieldName")%>' ControlType='<%# Eval("FieldType") %>' FieldLevel='<%# Eval("FieldLevel") %>'
                                                            Description='<%# Eval("Description")%>' Settings='<%# ((PowerEasy.Module.General.Model.CommonModel.FieldInfo)Container.DataItem).Settings %>'
                                                            Value='<%# Eval("DefaultValue") %>'>
                                                        </pe:AdminFieldControl>
                                                    </td>
                                                </tr>
                                            </ItemTemplate>
                                        </asp:Repeater>
                                    </table>
                                </ContentTemplate>
                            </asp:UpdatePanel>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
    <table width="100%" border="0" cellpadding="5" cellspacing="1">
        <tr align="center">
            <td style="height: 40px;">
                <asp:HiddenField ID="HdnContacterID" runat="server" />
                <pe:ExtendedButton ID="EBtnSubmit" Text="保存会员信息" IsChecked="true" OperateCode="UserModify"
                    OnClick="EBtnSubmit_Click" runat="server" IsShowTabs="true" OnClientClick="return BeginClick();" />&nbsp;&nbsp;&nbsp;
                <asp:Button ID="BtnCancel" runat="server" Text="取消" OnClick="BtnCancel_Click" ValidationGroup="BtnCancel" />
            </td>
        </tr>
    </table>
    <script type="text/javascript">
        function faceHeightChange(obj) {
            document.getElementById('showphoto').style.height = obj.value;
        }
        function faceWidthChange(obj) {
            document.getElementById('showphoto').style.width = obj.value;
        }
    </script>
    <script type="text/javascript" src="../../JS/Encrypt/BigInt.js"></script>
    <script type="text/javascript" src="../../JS/Encrypt/Encrypt.js"></script>
    <script type="text/javascript" src="../../JS/Encrypt/Barrett.js"></script>
    <script type="text/javascript" src="../../JS/Encrypt/Common.js"></script>
    <script type="text/javascript">
        var BeginClick = function () {
            if (Page_ClientValidate()) {
                GetRsaEncrypt(2);
                $("#<%=TxtUserPassword.ClientID%>").val(rsaEncrypt($("#<%=TxtUserPassword.ClientID%>").val()));
                $("#<%=TxtAnswer.ClientID%>").val(rsaEncrypt($("#<%=TxtAnswer.ClientID%>").val()));
                return true;
            } else {
                return false;
            }
        }
    </script>
</asp:Content>
