<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Admin/AdminMain.Master" Inherits="System.Web.Mvc.ViewPage<MvcEnterprise.Models.DataSet1+MembersRow>" %>

<asp:Content ID="Content0" ContentPlaceHolderID="HeadContent" runat="server">
    <script src="../../Scripts/MicrosoftAjax.js" type="text/javascript"></script>
    <script src="../../Scripts/MicrosoftMvcAjax.js" type="text/javascript"></script>
    <script src="../../Scripts/MicrosoftMvcValidation.js" type="text/javascript"></script>
    <script src="../../Scripts/jquery-1.3.2.min.js" type="text/javascript"></script>
    <script src="../../Scripts/Admin.js" type="text/javascript"></script>
    <script src="<%=Url.Content("~/Content/fckeditor/fckeditor.js")%>" type="text/javascript"></script>
    <%Html.EnableClientValidation(); %>
</asp:Content>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    编辑内容
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div>
        <%= Html.ActionLink("返回列表","MembersList") %></div>
    <hr />
    <% using (Html.BeginForm())
       {%>
    <div>
        <%--会员帐号--%>
        <span class="editor-label"><%= Html.LabelFor(model => model.MemName) %>：</span>
        <span class="editor-field"><%= Html.TextBoxFor(model => model.MemName, new { @readonly = "readonly" })%> <%= Html.DisplayToolTipFor(model => model.MemName) %> <%= Html.ValidationMessageFor(model => model.MemName) %></span>
        <%--是否锁定--%>
        <span><%= Html.LabelFor(model => model.Locked) %>：<%= Html.CheckBoxFor(model => model.Locked) %> <%= Html.DisplayToolTipFor(model => model.Locked) %> <%= Html.ValidationMessageFor(model => model.Locked) %></span>
    </div>
    <div>
        <%--会员密码--%>
        <span class="editor-label"><%= Html.LabelFor(model => model.Password) %>：</span>
        <span class="editor-field"><input type="text" name="Password" /> <%= Html.DisplayToolTip("不修改请留空。") %> <% if (Request.HttpMethod.ToLower() == "post") { Response.Write(Html.ValidationMessage("Password")); }%></span>
    </div>
    <div>
        <%--性别--%>
        <span class="editor-label"><%= Html.LabelFor(model => model.Sex) %>：</span>
        <span class="editor-field">
            <label><%= Html.RadioButtonFor(model => model.Sex,"先生") %>先生</label>
            <label><%= Html.RadioButtonFor(model => model.Sex,"女士") %>女士</label>
        </span>
    </div>
    <div>
        <%--会员组别--%>
        <span class="editor-label"><%= Html.LabelFor(model => model.GroupID) %>：</span>
        <span class="editor-field"><%= Html.DropDownListFor(model => model.GroupID, new SelectList(new MemGroupService().GetAll(), "ID", "GroupName"), new { onchange = "$('#GroupName').val(this.options[this.selectedIndex].text)"})%>
        </span>
    </div>
    <div style="display: none">
        <%--分组名称--%>
        <span class="editor-label"><%= Html.LabelFor(model => model.GroupName) %>：</span>
        <span class="editor-field"><%= Html.TextBoxFor(model => model.GroupName) %> <%= Html.DisplayToolTipFor(model => model.GroupName) %> <%= Html.ValidationMessageFor(model => model.GroupName) %></span>
    </div>
    <div>
        <%--电子邮件--%>
        <span class="editor-label"><%= Html.LabelFor(model => model.Email) %>：</span>
        <span class="editor-field"><%= Html.TextBoxFor(model => model.Email) %> <%= Html.DisplayToolTipFor(model => model.Email) %> <%= Html.ValidationMessageFor(model => model.Email) %></span>
    </div>
    <div>
        <%--真实姓名--%>
        <span class="editor-label"><%= Html.LabelFor(model => model.RealName) %>：</span>
        <span class="editor-field"><%= Html.TextBoxFor(model => model.RealName) %> <%= Html.DisplayToolTipFor(model => model.RealName) %> <%= Html.ValidationMessageFor(model => model.RealName) %></span>
    </div>
    <div>
        <%--公司名称--%>
        <span class="editor-label"><%= Html.LabelFor(model => model.Company) %>：</span>
        <span class="editor-field"><%= Html.TextBoxFor(model => model.Company) %> <%= Html.DisplayToolTipFor(model => model.Company) %> <%= Html.ValidationMessageFor(model => model.Company) %></span>
    </div>
    <div>
        <%--联系地址--%>
        <span class="editor-label"><%= Html.LabelFor(model => model.Address) %>：</span>
        <span class="editor-field"><%= Html.TextBoxFor(model => model.Address) %> <%= Html.DisplayToolTipFor(model => model.Address) %> <%= Html.ValidationMessageFor(model => model.Address) %></span>
    </div>
    <div>
        <%--邮政编码--%>
        <span class="editor-label"><%= Html.LabelFor(model => model.ZipCode) %>：</span>
        <span class="editor-field"><%= Html.TextBoxFor(model => model.ZipCode) %> <%= Html.DisplayToolTipFor(model => model.ZipCode) %> <%= Html.ValidationMessageFor(model => model.ZipCode) %></span>
    </div>
    <div>
        <%--联系电话--%>
        <span class="editor-label"><%= Html.LabelFor(model => model.Telephone) %>：</span>
        <span class="editor-field"><%= Html.TextBoxFor(model => model.Telephone) %> <%= Html.DisplayToolTipFor(model => model.Telephone) %> <%= Html.ValidationMessageFor(model => model.Telephone) %></span>
    </div>
    <div>
        <%--传真号码--%>
        <span class="editor-label"><%= Html.LabelFor(model => model.Fax) %>：</span>
        <span class="editor-field"><%= Html.TextBoxFor(model => model.Fax) %> <%= Html.DisplayToolTipFor(model => model.Fax) %> <%= Html.ValidationMessageFor(model => model.Fax) %></span>
    </div>
    <div>
        <%--手机号码--%>
        <span class="editor-label"><%= Html.LabelFor(model => model.Mobile) %>：</span>
        <span class="editor-field"><%= Html.TextBoxFor(model => model.Mobile) %> <%= Html.DisplayToolTipFor(model => model.Mobile) %> <%= Html.ValidationMessageFor(model => model.Mobile) %></span>
    </div>
    <div>
        <%--注册时间--%>
        <span class="editor-label"><%= Html.LabelFor(model => model.AddTime) %>：</span>
        <span class="editor-field"><%= Html.TextBoxFor(model => model.AddTime, new { @readonly = "readonly" })%> <%= Html.DisplayToolTipFor(model => model.AddTime) %> <%= Html.ValidationMessageFor(model => model.AddTime) %></span>
    </div>
    <div>
        <%--登陆时间--%>
        <span class="editor-label"><%= Html.LabelFor(model => model.LastLoginTime) %>：</span>
        <span class="editor-field"><%= Html.TextBoxFor(model => model.LastLoginTime, new { @readonly = "readonly" })%> <%= Html.DisplayToolTipFor(model => model.LastLoginTime) %> <%= Html.ValidationMessageFor(model => model.LastLoginTime) %></span>
    </div>
    <div>
        <%--登陆ip--%>
        <span class="editor-label"><%= Html.LabelFor(model => model.LastLoginIP) %>：</span>
        <span class="editor-field"><%= Html.TextBoxFor(model => model.LastLoginIP, new { @readonly = "readonly" })%> <%= Html.DisplayToolTipFor(model => model.LastLoginIP) %> <%= Html.ValidationMessageFor(model => model.LastLoginIP) %></span>
    </div>
    <div>
        <%--登陆次数--%>
        <span class="editor-label"><%= Html.LabelFor(model => model.LoginTimes) %>：</span>
        <span class="editor-field"><%= Html.TextBoxFor(model => model.LoginTimes, new { value = 0, @readonly = "readonly" }) %> <%= Html.DisplayToolTipFor(model => model.LoginTimes) %> <%= Html.ValidationMessageFor(model => model.LoginTimes) %></span>
    </div>
	<%
		   if (!string.IsNullOrEmpty(Model.CustomFields) && Model.CustomFields.Contains("|ffcms.com|") && Model.CustomFields.Contains(":ffcms.com:"))
		   {
			   var cf = Model.CustomFields.Split(new string[] { "|ffcms.com|" }, StringSplitOptions.RemoveEmptyEntries);
			   foreach (var item in cf)
			   {
				   var field = item.Split(new string[] { ":ffcms.com:" }, StringSplitOptions.None);
			 %>
	<div>
		<span class="editor-label"><label for="<%= field[0] %>"><%= field[0]%></label></span>
		<span class="editor-field"><input type="text" id="<%= field[0] %>" name="<%= field[0] %>" value="<%= field[1] %>" /></span>
	</div>
			<%
			   }
		   }
		   else
		   {
			   var table = CustomFields.Context.XPathSelectElement("/table[@name='" + Model.Table.TableName + "']");
				var fields = table.Elements();
			   foreach (var field in fields)
			   {
				   var fieldName = field.Attribute("name").Value;
				   var defaultvalue = field.Attribute("defaultvalue").Value;
				   %>
	<div>
		<span class="editor-label"><label for="<%= fieldName %>"><%= fieldName %></label></span>
		<span class="editor-field"><input type="text" id="<%= fieldName %>" name="<%= fieldName %>" value="<%= defaultvalue %>" /></span>
	</div>
				   <%
			   }
		   }
	 %>
    <div>
        <%----%> <%= Html.HiddenFor(model=>model.ID) %></div>
    <p><input type="submit" value="保 存" /> </p>
    <% } %>
</asp:Content>

