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

<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("返回列表","JobsList") %></div>
    <hr />
    <% using (Html.BeginForm())
       {%>
    <div>
        <%--职位名称--%>
        <span class="editor-label"><%= Html.LabelFor(model => model.JobName) %>：</span>
        <span class="editor-field"><%= Html.TextBoxFor(model => model.JobName) %> <%= Html.DisplayToolTipFor(model => model.JobName) %> <%= Html.ValidationMessageFor(model => model.JobName) %></span>
        <%--是否显示--%>
        <span><%= 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.JobAddress) %>：</span>
        <span class="editor-field"><%= Html.TextBoxFor(model => model.JobAddress) %> <%= Html.DisplayToolTipFor(model => model.JobAddress) %> <%= Html.ValidationMessageFor(model => model.JobAddress) %></span></div>
    <div>
        <%--招聘人数--%>
        <span class="editor-label"><%= Html.LabelFor(model => model.JobNumber) %>：</span>
        <span class="editor-field"><%= Html.TextBoxFor(model => model.JobNumber) %> <%= Html.DisplayToolTipFor(model => model.JobNumber) %> <%= Html.ValidationMessageFor(model => model.JobNumber) %></span></div>
    <div>
        <%--工资待遇--%>
        <span class="editor-label"><%= Html.LabelFor(model => model.Emolument) %>：</span>
        <span class="editor-field"><%= Html.TextBoxFor(model => model.Emolument) %> <%= Html.DisplayToolTipFor(model => model.Emolument) %> <%= Html.ValidationMessageFor(model => model.Emolument) %></span></div>
    <div>
        <%--添加时间--%>
        <span class="editor-label"><%= Html.LabelFor(model => model.AddTime) %>：</span>
        <span class="editor-field"><%= Html.TextBoxCalendarFor(model => model.AddTime, new { style = "width:140px" }) %> <%= Html.DisplayToolTipFor(model => model.AddTime) %> <%= Html.ValidationMessageFor(model => model.AddTime) %></span></div>
    <div>
        <%--结束时间--%>
        <span class="editor-label"><%= Html.LabelFor(model => model.EndDate) %>：</span>
        <span class="editor-field"><%= Html.TextBoxCalendarFor(model => model.EndDate, new { style = "width:140px" }) %> <%= Html.DisplayToolTipFor(model => model.EndDate) %> <%= Html.ValidationMessageFor(model => model.EndDate) %></span></div>
    <div>
        <%--点击次数--%>
        <span class="editor-label"><%= Html.LabelFor(model => model.ClickNumber) %>：</span>
        <span class="editor-field"><%= Html.TextBoxFor(model => model.ClickNumber, new { value = 0}) %> <%= Html.DisplayToolTipFor(model => model.ClickNumber) %> <%= Html.ValidationMessageFor(model => model.ClickNumber) %></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>
        <%--页面标题--%>
        <span class="editor-label"><%= Html.LabelFor(model => model.PageTitle) %>：</span>
        <span class="editor-field"><%= Html.TextBoxFor(model => model.PageTitle) %> <%= Html.DisplayToolTipFor(model => model.PageTitle) %> <%= Html.ValidationMessageFor(model => model.PageTitle) %></span></div>
    <div>
        <%--页面关键字--%>
        <span class="editor-label"><%= Html.LabelFor(model => model.PageKeywords) %>：</span>
        <span class="editor-field"><%= Html.TextBoxFor(model => model.PageKeywords) %> <%= Html.DisplayToolTipFor(model => model.PageKeywords) %> <%= Html.ValidationMessageFor(model => model.PageKeywords) %></span></div>
    <div>
        <%--页面描述--%>
        <span class="editor-label"><%= Html.LabelFor(model => model.PageDescription) %>：</span>
        <span class="editor-field"><%= Html.TextBoxFor(model => model.PageDescription) %> <%= Html.DisplayToolTipFor(model => model.PageDescription) %> <%= Html.ValidationMessageFor(model => model.PageDescription) %></span></div>
    <div>
        <%--详细内容--%>
        <%= Html.FckEditorFor(model => model.Content)%> <%= Html.ValidationMessageFor(model => model.Content) %></div>
    <div style="display:none">
        <%--应聘人数--%>
        <span class="editor-label"><%= Html.LabelFor(model => model.TalentsNumber) %>：</span>
        <span class="editor-field"><%= Html.TextBoxFor(model => model.TalentsNumber, new { value = 0}) %> <%= Html.DisplayToolTipFor(model => model.TalentsNumber) %> <%= Html.ValidationMessageFor(model => model.TalentsNumber) %></span></div>
    <div>
        <%----%> <%= Html.HiddenFor(model=>model.ID) %></div>
    <p><input type="submit" value="保 存" /> <input type="submit" value="另存为" onclick="$('#ID').val('');" /></p>
    <% } %>
</asp:Content>

