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

<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("返回列表","OrderList") %></div>
	<hr />
	<% using (Html.BeginForm())
	{%>
	<div>
		<%--订单号--%>
		<span class="editor-label"><%= Html.LabelFor(model => model.OrderNo)%>：</span>
		<span class="editor-field"><%= Html.TextBoxFor(model => model.OrderNo, new { @readonly = "readonly" })%>
			<%= Html.DisplayToolTipFor(model => model.OrderNo) %> <%= Html.ValidationMessageFor(model => model.OrderNo) %></span></div>
	<div>
		<%--产品名称--%>
		<span class="editor-label"><%= Html.LabelFor(model => model.ProductName)%>：</span>
		<span class="editor-field"><%= Html.TextBoxFor(model => model.ProductName, new { @readonly = "readonly" })%>
			<%= Html.DisplayToolTipFor(model => model.ProductName) %> <%= Html.ValidationMessageFor(model => model.ProductName) %></span></div>
	<div>
		<%--产品编号--%>
		<span class="editor-label"><%= Html.LabelFor(model => model.ProductNo) %>：</span>
		<span class="editor-field"><%= Html.TextBoxFor(model => model.ProductNo, new { @readonly = "readonly" })%>
			<%= Html.DisplayToolTipFor(model => model.ProductNo) %> <%= Html.ValidationMessageFor(model => model.ProductNo) %></span></div>
	<div>
		<%--订单金额--%>
		<span class="editor-label"><%= Html.LabelFor(model => model.OrderMoney) %>：</span>
		<span class="editor-field"><%= Html.TextBoxFor(model => model.OrderMoney, new { @readonly = "readonly" })%>
			<%= Html.DisplayToolTipFor(model => model.OrderMoney) %> <%= Html.ValidationMessageFor(model => model.OrderMoney) %></span></div>
	<div>
		<%--订购数量--%>
		<span class="editor-label"><%= Html.LabelFor(model => model.Amount) %>：</span>
		<span class="editor-field"><%= Html.TextBoxFor(model => model.Amount, new { value = 0, @readonly = "readonly" })%>
			<%= Html.DisplayToolTipFor(model => model.Amount) %> <%= Html.ValidationMessageFor(model => model.Amount) %></span></div>
	<div>
		<%--联系人名--%>
		<span class="editor-label"><%= Html.LabelFor(model => model.Linkman) %>：</span>
		<span class="editor-field"><%= Html.TextBoxFor(model => model.Linkman, new { @readonly = "readonly" })%>
			<%= Html.DisplayToolTipFor(model => model.Linkman) %> <%= Html.ValidationMessageFor(model => model.Linkman) %></span>
		<%
			if (Model.MemID > 0)
			{
				var member = new MembersService().GetModel(Model.MemID);
				if (member != null)
				{
					Response.Write("会员：");
					Response.Write(Html.ActionLink(member.MemName, "MembersEdit", new { ID = Model.MemID }));
				}
			}
		%>
	</div>
	<div>
		<%--手机号码--%>
		<span class="editor-label"><%= Html.LabelFor(model => model.Mobile) %>：</span>
		<span class="editor-field"><%= Html.TextBoxFor(model => model.Mobile, new { @readonly = "readonly" })%>
			<%= Html.DisplayToolTipFor(model => model.Mobile) %> <%= Html.ValidationMessageFor(model => model.Mobile) %></span></div>
	<div>
		<%--联系电话--%>
		<span class="editor-label"><%= Html.LabelFor(model => model.Telephone) %>：</span>
		<span class="editor-field"><%= Html.TextBoxFor(model => model.Telephone, new { @readonly = "readonly" })%>
			<%= Html.DisplayToolTipFor(model => model.Telephone) %> <%= Html.ValidationMessageFor(model => model.Telephone) %></span></div>
	<div>
		<%--详细地址--%>
		<span class="editor-label"><%= Html.LabelFor(model => model.Address) %>：</span>
		<span class="editor-field"><%= Html.TextBoxFor(model => model.Address, new { style = "width:300px", @readonly = "readonly" })%>
			<%= Html.DisplayToolTipFor(model => model.Address) %> <%= Html.ValidationMessageFor(model => model.Address) %></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:140px", @readonly = "readonly" })%>
			<%= Html.DisplayToolTipFor(model => model.AddTime) %> <%= Html.ValidationMessageFor(model => model.AddTime) %></span></div>
	<div>
		<%--其他信息--%>
		<span class="editor-label"><%= Html.LabelFor(model => model.Remark) %>：</span>
		<span class="editor-field"><%= Html.TextAreaFor(model => model.Remark, new { style = "width:300px;height:80px", @readonly = "readonly" })%>
			<%= Html.DisplayToolTipFor(model => model.Remark) %> <%= Html.ValidationMessageFor(model => model.Remark) %></span></div>
	<div>
		<%--支付状态--%>
		<span class="editor-label"><%= Html.LabelFor(model => model.IsPay) %>：</span>
		<span class="editor-field"><%= Html.DropDownListFor(model => model.IsPay, new SelectList(new object[]{new { text="已支付",value=true},new {text="未支付",value=false}},"value","text",Model.IsPay))%>
			<%= Html.DisplayToolTipFor(model => model.IsPay) %> <%= Html.ValidationMessageFor(model => model.IsPay) %></span></div>
	<div>
		<%--订单状态--%>
		<span class="editor-label"><%= Html.LabelFor(model => model.OrderType) %>：</span>
		<span class="editor-field"><%= Html.DropDownListFor(model => model.OrderType,new SelectList(new string[]{"未处理订单","有问题订单","已处理订单"})) %>
			<%= Html.DisplayToolTipFor(model => model.OrderType) %> <%= Html.ValidationMessageFor(model => model.OrderType) %></span></div>
	<div>
		<%--处理时间--%>
		<span class="editor-label"><%= Html.LabelFor(model => model.ReplyTime) %>：</span>
		<%var replyTime = Model.ReplyTime.Year < 1900 ? DateTime.Now : Model.ReplyTime;%>
		<span class="editor-field"><%= Html.TextBoxCalendarFor(model => replyTime, new { style = "width:140px" })%>
			<%= Html.DisplayToolTipFor(model => model.ReplyTime) %> <%= Html.ValidationMessageFor(model => model.ReplyTime) %></span></div>
	<div>
		<%--处理信息--%>
		<span class="editor-label"><%= Html.LabelFor(model => model.ReplyContent) %>：</span>
		<span class="editor-field"><%= Html.TextAreaFor(model => model.ReplyContent, new { style = "width:300px;height:80px" })%>
			<%= Html.DisplayToolTipFor(model => model.ReplyContent) %> <%= Html.ValidationMessageFor(model => model.ReplyContent) %></span></div>
	<div>
		<%= Html.HiddenFor(model=>model.ID) %>
		<%= Html.HiddenFor(model=>model.MemID) %>
		<%= Html.HiddenFor(model=>model.ProductID) %>
	</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>
				   <%
			   }
		   }
	 %>
	<p><input type="submit" value="处理订单" /> </p>
	<% } %>
</asp:Content>

