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

<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>
	<script type="text/javascript">
		function setMenu(e) {
			if (e.value != "") {
				$("#SortName").val(e[e.selectedIndex].innerText.replace(/┗/g, "").replace(/┣/g, "").replace(/┃/g, "").replace(/　/g, ""));
				$("#Url").val("/" + e.id + "/" + e.value);
			}
			else {
				e.value = $(e).children("option[value!='']")[0].value;
			}
		}
	</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("返回列表","MenusSortList") %></div>
    <hr />
    <% using (Html.BeginForm()) {%>
    <div>
        <%--菜单文字--%>
        <span class="editor-label"><%= Html.LabelFor(model => model.SortName) %>：</span>
        <span class="editor-field"><%= Html.TextBoxFor(model => model.SortName) %> <%= Html.DisplayToolTipFor(model => model.SortName) %> <%= Html.ValidationMessageFor(model => model.SortName) %></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.Url) %>：</span>
        <span class="editor-field"><%= Html.TextBoxFor(model => model.Url) %> <%= Html.DisplayToolTipFor(model => model.Url) %> <%= Html.ValidationMessageFor(model => model.Url) %> <%= Html.DisplayToolTipFor(model => model.SortPath) %>
		<input type="button" value="链接生成助手" onclick="$('#linkNav').toggle();" /></span>
    </div>
	<div style="display:none" id="linkNav">
		<span class="editor-label">&nbsp;</span>
		<span class="editor-field">
			<%= Html.DropDownList("menu", new SelectList(new AboutService().GetAllvisible(), "ID", "AboutName"), "选择企业信息", new { id = "About", onchange = "setMenu(this);", style = "display:none" })%>

			<%= Html.DropDownList("menu", new SelectList(new CategoryService<DataSet1.ArticleSortRow, DataSet1.ValidationArticleSort>(new ArticleSortService()).CategoryList(0), "ID", "SortName"), "选择新闻分类", new { id = "ArticleList", onchange = "setMenu(this);" })%>

			<%= Html.DropDownList("menu", new SelectList(new CategoryService<DataSet1.ProductSortRow, DataSet1.ValidationProductSort>(new ProductSortService()).CategoryList(0), "ID", "SortName"), "选择产品分类", new { id = "ProductList", onchange = "setMenu(this);", style = "display:none" })%>

			<%= Html.DropDownList("menu", new SelectList(new CategoryService<DataSet1.DownloadSortRow, DataSet1.ValidationDownloadSort>(new DownloadSortService()).CategoryList(0), "ID", "SortName"), "选择下载分类", new { id = "DownloadList", onchange = "setMenu(this);", style = "display:none" })%>
		</span>
	</div>
    <div style="display:none">
        <%--父编号--%>
        <span class="editor-label"><%= Html.LabelFor(model => model.ParentID) %>：</span>
        <span class="editor-field"><%= Html.TextBoxFor(model => model.ParentID, new { value = 0}) %> <%= Html.DisplayToolTipFor(model => model.ParentID) %> <%= Html.ValidationMessageFor(model => model.ParentID) %></span>
    </div>
    <div style="display:none">
        <%--类别路径--%>
        <span class="editor-label"><%= Html.LabelFor(model => model.SortPath) %>：</span>
        <span class="editor-field"><%= Html.TextBoxFor(model => model.SortPath)%> <%= Html.DisplayToolTipFor(model => model.SortPath) %> <%= Html.ValidationMessageFor(model => model.SortPath) %></span>
    </div>
    <div>
        <%--显示顺序--%>
        <span class="editor-label"><%= Html.LabelFor(model => model.Sequence) %>：</span>
        <span class="editor-field"><%= Html.TextBoxFor(model => model.Sequence, new { value = 0}) %> <%= Html.DisplayToolTipFor(model => model.Sequence) %> <%= Html.ValidationMessageFor(model => model.Sequence) %></span>
    </div>
    <div>
        <%--新窗口打开--%>
        <span class="editor-label"><%= Html.LabelFor(model => model.IsBlank) %>：</span>
        <span class="editor-field"><%= Html.CheckBoxFor(model => model.IsBlank) %> <%= Html.DisplayToolTipFor(model => model.IsBlank) %> <%= Html.ValidationMessageFor(model => model.IsBlank) %></span>
    </div>
    <div>
        <%----%>
        <%= Html.HiddenFor(model=>model.ID) %>
    </div>
    <p><input type="submit" value="保 存" /> </p>
    <% } %>
</asp:Content>