<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/ExhibitorMaster.Master" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>


<asp:Content ID="Content2" ContentPlaceHolderID="HeadContent" runat="server">
    <script src="<%=FamousFurnitureExpo.Models.Helper.VRoot %>/Scripts/CheckInfo.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(function () {
            selectMenu("用户信息","")
            hideMenuLeft();
        });

        function Save() {
            if (checkInfo()) {
                $("#f1").submit();
            }
        }

        function checkInfo() {
            var password = $("#Password").val();
            var passwordCheck = $("#PasswordCheck").val();
            if (password.length < 4 || password.length > 12) {
                alert("请输入密码，4-12个字符！");
                $("#Password").focus();
                return false;
            }
            if (passwordCheck == "") {
                alert("请输入确认密码！");
                $("#PasswordCheck").focus();
                return false;
            }
            if (password != passwordCheck) {
                alert("两次输入的密码不一致！");
                $("#PasswordCheck").focus();
                return false;
            }

            var email = $("#Email").val();
            if (email == "") {
                alert("请输入Email！");
                $("#Email").focus();
                return false;
            } else {
                if (!checkEmail(email)) {
                    alert("输入的Email格式不正确！");
                    $("#Email").focus();
                    return false;
                }
            }

            var name = $("#Name").val();
            if (name == "") {
                alert("请输入联系人姓名！");
                $("#Name").focus();
                return false;
            }

            var rank = $("#Rank").val();
            if (rank == "") {
                alert("请输入职称！");
                $("#Rank").focus();
                return false;
            }
            //
            var countryCode = $("#Country").val();
            if (countryCode == "") {
                alert("请选择国家或地区！");
                return false;
            }
            //
            var tel0 = $("#tel0").val();
            if (tel0 == "") {
                alert("请输入电话国家号！");
                $("#tel0").focus();
                return false;
            }
            var tel1 = $("#tel1").val();
            if (tel1 == "") {
                alert("请输入电话区号！");
                $("#tel1").focus();
                return false;
            }
            var tel2 = $("#tel2").val();
            if (tel2 == "") {
                alert("请输入电话号码！");
                $("#tel2").focus();
                return false;
            }
            var fax0 = $("#fax0").val();
            if (fax0 == "") {
                alert("请输入传真国家号！");
                $("#fax0").focus();
                return false;
            }
            var fax1 = $("#fax1").val();
            if (fax1 == "") {
                alert("请输入传真区号！");
                $("#fax1").focus();
                return false;
            }
            var fax2 = $("#fax2").val();
            if (fax2 == "") {
                alert("请输入传真号！");
                $("#fax2").focus();
                return false;
            }

            $("#CountryStr").val($("#Country").find("option:selected").text());
            $("#Tel").val(tel0 + "-" + tel1 + "-" + tel2);
            $("#Fax").val(fax0 + "-" + fax1 + "-" + fax2);

            return true;
        }
    </script>
</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <div>
        <center>
            <form id="f1" action="" method="post">
            <table width="100%" border="0" cellpadding="0" cellspacing="0">
                <tr>
                    <td align="center">
                        <table border="0" cellpadding="0" cellspacing="0">
                            <tr>
                                <td align="left" colspan="2">
                                    <strong>用户信息</strong><br />
                                    <br />
                                    请填写您的表格联系人<br />
                                    <font color="red">*必填项</font>
                                </td>
                            </tr>
                            <tr><td>&nbsp;</td></tr>
                            <tr>
                                <td align="left" style="width:150px;">登录名：</td>
                                <td align="left" style="width:400px;"><%=ViewData["LoginName"] %></td>
                            </tr>
                            <tr><td>&nbsp;</td></tr>
                            <tr>
                                <td align="left">展位号：</td>
                                <td align="left"><%=ViewData["Booth"]%></td>
                            </tr>
                            <tr><td>&nbsp;</td></tr>
                            <tr>
                                <td align="left">修改密码：</td>
                                <td align="left">
                                    <input type="password" id="Password" name="Password" class="text" />
                                    <font color="red">*</font>
                                </td>
                            </tr>
                            <tr><td>&nbsp;</td></tr>
                            <tr>
                                <td align="left">确认密码：</td>
                                <td align="left">
                                    <input type="password" id="PasswordCheck" name="PasswordCheck" class="text" />
                                    <font color="red">*</font>
                                </td>
                            </tr>
                            <tr><td>&nbsp;</td></tr>
                            <tr>
                                <td align="left">Email：</td>
                                <td align="left">
                                    <input type="text" id="Email" name="Email" class="text" />
                                    <font color="red">*</font>
                                </td>
                            </tr>
                            <tr><td>&nbsp;</td></tr>
                            <tr>
                                <td align="left">联系人：</td>
                                <td align="left">
                                    <input type="text" id="Name" name="Name" class="text" />
                                    <font color="red">*</font>
                                </td>
                            </tr>
                            <tr><td>&nbsp;</td></tr>
                            <tr>
                                <td align="left">职称：</td>
                                <td align="left">
                                    <input type="text" id="Rank" name="Rank" class="text" />
                                    <font color="red">*</font>
                                </td>
                            </tr>
                            <tr><td>&nbsp;</td></tr>
                            <tr>
                                <td align="left">国家或地区：</td>
                                <td align="left">
                                    <select id="Country" name="Country" style="font-family:Arial; font-size: 12px;">
                                        <option value="">--请选择--</option>
                                        <option value="86">中国</option>
                                        <% 
                                            List<FamousFurnitureExpo.Models.ZipTel> countryLi = FamousFurnitureExpo.Models.ZipTel.GetZtpCountry();
                                            foreach (FamousFurnitureExpo.Models.ZipTel zipTel in countryLi)
                                            {
                                        %>
                                            <option value="<%=zipTel.ZtpCountryCode %>"><%=zipTel.ZtpCountry %></option>
                                        <%        
                                            }
                                        %>
                                    </select>
                                    <font color="red">*</font>
                                    <input type="hidden" id="CountryStr" name="CountryStr" />
                                </td>
                            </tr>
                            <tr><td>&nbsp;</td></tr>
                            <tr>
                                <td align="left">电话：</td>
                                <td align="left">
                                    国家号 <input type="text" id="tel0" name="tel0" class="text" style="width:40px;" onkeyup="value=value.replace(/[^\d]/g,'')" />&nbsp;
                                    区号 <input type="text" id="tel1" name="tel1" class="text" style="width:40px;" onkeyup="value=value.replace(/[^\d]/g,'')" />&nbsp;
                                    电话号码 <input type="text" id="tel2" name="tel2" class="text" style="width:100px;" onkeyup="value=value.replace(/[^\d]/g,'')" />&nbsp;
                                    <font color="red">*</font>
                                    <input type="hidden" id="Tel" name="Tel" />
                                </td>
                            </tr>
                            <tr><td>&nbsp;</td></tr>
                            <tr>
                                <td align="left">传真：</td>
                                <td align="left">
                                    国家号 <input type="text" id="fax0" name="fax0" class="text" style="width:40px;" onkeyup="value=value.replace(/[^\d]/g,'')" />&nbsp;
                                    区号 <input type="text" id="fax1" name="fax1" class="text" style="width:40px;" onkeyup="value=value.replace(/[^\d]/g,'')" />&nbsp;
                                    传真号码 <input type="text" id="fax2" name="fax2" class="text" style="width:100px;" onkeyup="value=value.replace(/[^\d]/g,'')" />&nbsp;
                                    <font color="red">*</font>
                                    <input type="hidden" id="Fax" name="Fax" />
                                </td>
                            </tr>
                            <tr><td>&nbsp;</td></tr>
                            <tr>
                                <td align="center" colspan="2">
                                    <table border="0" cellpadding="0" cellspacing="0">
                                        <tr>
                                            <td><div class="button" onclick="Save()">提交</div></td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
            </table>
            </form>
        </center>
    </div>
</asp:Content>
