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

<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(); %>
	<script type="text/javascript">
		$(function () {
			$("input[type='text'],textarea[id!='ReplyContent']").each(function () {
				$(this).after(this.value).hide();
			});
		});
	</script>
</asp:Content>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	回复留言
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
	<div>
		<%= Html.ActionLink("返回列表","MessageList") %></div>
	<hr />
	<% using (Html.BeginForm())
	{%>
	<div>
		<%--联系人--%>
		<span class="editor-label"><%= Html.LabelFor(model => model.Linkman) %>：</span>
		<span class="editor-field"><%= Html.TextBoxFor(model => model.Linkman) %> <%= Html.DisplayToolTipFor(model => model.Linkman) %>
			<%= Html.ValidationMessageFor(model => model.Linkman) %></span>
		<%--是否显示--%>
		<span>&nbsp;<%= Html.LabelFor(model => model.ViewFlag) %>：<%= Html.CheckBoxFor(model => model.ViewFlag) %>
			<%= Html.DisplayToolTipFor(model => model.ViewFlag) %></span></div>
	<div>
		<%--留言内容--%>
		<span class="editor-label"><%= Html.LabelFor(model => model.Content)%>：</span>
		<span class="editor-field"><%= Html.TextAreaFor(model => model.Content)%> <%= Html.ValidationMessageFor(model => model.Content) %></span></div>
	<div>
		<%--留言时间--%>
		<span class="editor-label"><%= Html.LabelFor(model => model.AddTime) %>：</span>
		<span class="editor-field"><%= Html.TextBoxFor(model => model.AddTime, new { style = "width:80px" }) %>
			<%= Html.DisplayToolTipFor(model => model.AddTime) %> <%= Html.ValidationMessageFor(model => model.AddTime) %></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>
				   <%
			   }
		   }
	 %>
	<hr />
	<div>
		<%--回复内容--%>
		<span class="editor-label"><%= Html.LabelFor(model => model.ReplyContent) %>：</span>
		<span class="editor-field"></span></div>
		<%= Html.FckEditorFor(model => model.ReplyContent)%> <%= Html.DisplayToolTipFor(model => model.ReplyContent) %>
			<%= Html.ValidationMessageFor(model => model.ReplyContent) %>
	<div style="display: none">
		<%--会员编号--%>
		<span class="editor-label"><%= Html.LabelFor(model => model.MemID) %>：</span>
		<span class="editor-field"><%= Html.TextBoxFor(model => model.MemID, new { value = 0}) %>
			<%= Html.DisplayToolTipFor(model => model.MemID) %> <%= Html.ValidationMessageFor(model => model.MemID) %></span></div>
	<div>
		<%----%>
		<%= Html.HiddenFor(model=>model.ID) %></div>
	<p><input type="submit" value="保 存" /> </p>
	<% } %>
</asp:Content>

