<%@ Control Language="c#" AutoEventWireup="false" Codebehind="Menu.ascx.cs" Inherits="WebUI.MMS.Menu" TargetSchema="http://schemas.microsoft.com/intellisense/ie5" %>
<script language="javascript" type="text/javascript">
<!--
function checkFormAll(chk)
{
	myform = document.forms[0];
	for( var i = 0; i < myform.elements.length; i++ )
	{
		if ( myform.elements[i].type=="checkbox" )
		{
			myform.elements[i].checked = chk;
		}
	}
}
function go(i)
{
	var theform;
	if (window.navigator.appName.toLowerCase().indexOf("netscape") > -1) {
		theform = document.forms["myform2"];
	}
	else {
		theform = document.myform2;
	}
	theform.PageIndex.value = i;
	theform.submit();		
}
//-->
</script>
<FONT face="宋体">
<input type="hidden" name="PageIndex" id="PageIndex" value="<%= this.PageIndex%>">
	<TABLE cellSpacing="0" cellPadding="0" width="98%" align="center">
		<TR>
			<TD class="mframe-t-left"></TD>
			<TD class="mframe-t-mid"><SPAN class="mframe-t-text"><%=this.PageTitle%></SPAN></TD>
			<TD class="mframe-t-right"></TD>
		</TR>
	</TABLE>
<table class="awidth" align="center" cellspacing="0" cellpadding="0">
<tr>
<td class="mframe-m-left" width=1> </td>
<td class="mframe-m-mid">	
	<asp:Panel id="pnlAdd" runat="server">		
  <TABLE id="Table1" cellSpacing="1" cellPadding="3" width="98%" align="center">
    <TR> 
      <TD align="right"><font face="宋体">菜单名称</font>：</TD>
      <TD> <asp:TextBox id="txtName" runat="server"></asp:TextBox></TD>
    </TR>
    <TR> 
      <TD align="right"><font face="宋体">连接页面</font>：</TD>
      <TD> <asp:TextBox id="txtLink" runat="server"></asp:TextBox></TD>
    </TR>
    <TR> 
      <TD align="right"><font face="宋体">上级菜单</font>：</TD>
      <TD>
       <asp:DropDownList id="ddlParent" runat="server"> 
       <asp:ListItem Value="0">作为一级菜单</asp:ListItem>
       </asp:DropDownList>
      </TD>
    </TR>
    <TR> 
      <TD align="right"><font face="宋体">显示状态</font>：</TD>
      <TD>
       <asp:DropDownList id="ddlDisp" runat="server"> 
       <asp:ListItem Value="0">显示</asp:ListItem>
       <asp:ListItem Value="1">隐藏</asp:ListItem>
       </asp:DropDownList>
      </TD>
    </TR>    
    <TR> 
      <TD align="right"><font face="宋体">排序</font>：</TD>
      <TD> <asp:TextBox id="txtOrder" runat="server" Text="0" Width="30px"></asp:TextBox></TD>
    </TR>    
    <TR> 
      <TD align="right"></TD>
      <TD> <asp:Button id="Submit" runat="server" Text="提  交"></asp:Button></TD>
    </TR>
  </TABLE>
	</asp:Panel></FONT>
<asp:Panel id="pnlList" runat="server">
				<asp:Label id="label" style="TEXT-ALIGN: center" runat="server" Visible="False" width="100%"></asp:Label>
				<ASP:DataGrid id="DataGrid1" runat="server" Width="100%" OnItemCreated="DataGrid1_ItemCreated"
					CellPadding="0" CellSpacing="0" ItemStyle-CssClass="tdbg"
					AutoGenerateColumns="false" ShowFooter="false"
					ShowHeader="True" Align="center" AllowPaging="True">
					<PagerStyle Visible="False"/>
					<HeaderStyle HorizontalAlign="center" CssClass="summary-title" Height="25" />
					<ItemStyle Height="22" />
					<EditItemStyle CssClass="tdbg-dark" />
					<Columns>
						<asp:TemplateColumn ItemStyle-Width="10%" ItemStyle-HorizontalAlign="center">
							<ItemTemplate>
								<a href="?mms=<%#Request["mms"].ToString()%>&action=edit&id=<%# DataBinder.Eval(Container.DataItem, "ID")%>">修改</a>
							</ItemTemplate>
						</asp:TemplateColumn>
						<asp:BoundColumn HeaderText="菜单名称" DataField="Name" ReadOnly="true">
							<ItemStyle HorizontalAlign="Center" Width="15%" />
						</asp:BoundColumn>
						<asp:BoundColumn HeaderText="页面连接" DataField="Link" ReadOnly="true">
							<ItemStyle Width="30%" />
						</asp:BoundColumn>
						<asp:BoundColumn HeaderText="上级菜单" DataField="ParentID" ReadOnly="true">
							<ItemStyle HorizontalAlign="Center" Width="10%" />
						</asp:BoundColumn>	
						<asp:BoundColumn HeaderText="排序" DataField="OrderNumber" ReadOnly="true">
							<ItemStyle HorizontalAlign="Center" Width="10%" />
						</asp:BoundColumn>							
						<asp:TemplateColumn ItemStyle-Width="10%" ItemStyle-HorizontalAlign="center" HeaderText="状态" >
							<ItemTemplate>
								<%# DataBinder.Eval(Container.DataItem, "Display").ToString() == "0" ? "显示" : "隐藏"%>
							</ItemTemplate>
						</asp:TemplateColumn>						
						<asp:TemplateColumn ItemStyle-Width="10%" ItemStyle-HorizontalAlign="center" HeaderText="<input type='checkbox' onclick='checkFormAll(this.checked)'>">
							<ItemTemplate>
								<input type="checkbox" name="chk" value='<%# DataBinder.Eval(Container.DataItem, "ID")%>' />
							</ItemTemplate>
						</asp:TemplateColumn>
					</Columns>
				</ASP:DataGrid>
				<table width="100%"><tr><td height="25" align="center"><%= this.PageNavigation%></td></tr></table>				
	<table align="center" width="100%" height="30">
	<tr>
	<td>
	<asp:DropDownList id="ddlParent2" runat="server"> 
       <asp:ListItem Value="0">所有菜单</asp:ListItem>
    </asp:DropDownList> <asp:Button ID="btnSearch" Text="查 询" Runat="server"/>
	</td>
	<td align="right"><input type="button" value="添 加" onclick="location.href='?mms=<%=Request["mms"]%>&action=add'"> &nbsp;&nbsp; <asp:Button ID="btnDelete" Runat="server" OnClick="Delete_OnClick" Text="删 除" /></td></tr></table>
</asp:Panel>
</td>
<td class="mframe-m-right" width=1> </td>
</tr>
</table>
<TABLE cellSpacing="0" cellPadding="0" width="98%" align="center">
	<TR>
		<TD class="mframe-b-left"></TD>
		<TD class="mframe-b-mid">&nbsp;</TD>
		<TD class="mframe-b-right"></TD>
	</TR>
</TABLE>

