menu.aspx
上传用户:xrffrp
上传日期:2022-03-25
资源大小:22155k
文件大小:5k
源码类别:

OA系统

开发平台:

ASP/ASPX

  1. <%@ Page Language="C#" AutoEventWireup="true" CodeFile="menu.aspx.cs" Inherits="web_system_menu" %>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml" >
  4. <head runat="server">
  5.     <title>目錄管理作業</title>
  6.     <link href="../../css/style.css" rel="stylesheet" type="text/css" />
  7.     <script type="text/javascript"language = "javascript">
  8.     function selectMenu()
  9.     {
  10.         var url = "menu_select_tree.aspx";
  11.         var features = "width=400,height=500,top=200,left=250,location=no,toolbar=no,status=no,resizable=yes,scrollbars=yes";
  12.         var selectMenu = open(url, 'selectMenu', features);
  13.         selectMenu.focus();
  14.     }
  15.     function setMenu(id, name)
  16.     {
  17.         document.all.ParentId.value=id;
  18.         document.all.TxtParent.value=name;
  19.     }
  20.     </script>
  21. </head>
  22. <body>
  23.     <form id="form1" runat="server">
  24.     <div>
  25.         <center>
  26.             <asp:Label ID="LblTitle" runat="server" Text="OA系統選單管理" Font-Bold="True" Font-Size="Medium"></asp:Label>
  27.         </center>
  28.         <center>
  29.             &nbsp;</center>
  30.         <asp:GridView ID="MenuList" runat="server" AutoGenerateColumns="False" BackColor="White"
  31.             BorderColor="#999999" BorderStyle="None" BorderWidth="1px" CellPadding="3" DataSourceID="SqlDataSource1"
  32.             GridLines="Vertical" Style="left: 136px; position: relative; top: 1px;" AllowPaging="True" AllowSorting="True" OnRowDataBound="MenuList_RowDataBound" Width="500px">
  33.             <FooterStyle BackColor="#CCCCCC" ForeColor="Black" />
  34.             <RowStyle BackColor="#EEEEEE" ForeColor="Black" />
  35.             <Columns>
  36.                 <asp:BoundField DataField="name" HeaderText="選單名稱" SortExpression="name" />
  37.                 <asp:BoundField DataField="parent" HeaderText="上級選單" SortExpression="parent" />
  38.             </Columns>
  39.             <PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" />
  40.             <SelectedRowStyle BackColor="#008A8C" Font-Bold="True" ForeColor="White" />
  41.             <HeaderStyle BackColor="#000084" Font-Bold="True" ForeColor="White" />
  42.             <AlternatingRowStyle BackColor="Gainsboro" />
  43.         </asp:GridView>
  44.         <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:oaConnection %>"
  45.             SelectCommand="SELECT m.id, m.name, p.name parent FROM dbo.OA_SYS_CHILD_MENU AS m INNER JOIN dbo.OA_SYS_CHILD_MENU AS p ON m.parent_id = p.id ORDER BY m.name">
  46.         </asp:SqlDataSource>
  47.         <br />
  48.         <br />
  49.         <center>
  50.         <asp:Panel ID="PnlMenu" runat="server" Visible="False">
  51.             <table style="position: relative; width: 500px;" border="1">
  52.                 <tr>
  53.                     <td style="width: 91px" align="center">
  54.                         <asp:Label ID="LblName" runat="server" Text="選單名稱" ></asp:Label>
  55.                     </td>
  56.                     <td style="width: 142px" align="left">
  57.                         <asp:TextBox ID="TxtName" runat="server" Width="200px"></asp:TextBox>
  58.                         <asp:Label ID="LblErrName" runat="server" ForeColor="Red" Style="position: relative"></asp:Label></td>
  59.                 </tr>
  60.                 <tr>
  61.                     <td style="width: 91px" align="center">
  62.                         <asp:Label ID="LblParent" runat="server" Text="上級選單"></asp:Label>
  63.                     </td>
  64.                     <td style="width: 142px" align="left">
  65.                         <input id="TxtParent" type="text" runat="server" disabled="disabled" style="width: 200px">
  66.                         <input id="ParentId" runat="server" type="hidden" />
  67.                         <input id="BtnSelect" onclick="selectMenu()" type="button" value="選擇上級選單"/>
  68.                         <asp:Label ID="LblErrParent" runat="server" ForeColor="Red" Style="position: relative"></asp:Label></td>
  69.                 </tr>
  70.                 <tr>
  71.                     <td style="width: 91px" align="center">
  72.                         <asp:Label ID="LblOpen" runat="server" Text="是否顯示"></asp:Label>
  73.                     </td>
  74.                     <td style="width: 142px" align="left">
  75.                         <asp:DropDownList ID="DdlOpen" runat="server" Width="49px">
  76.                             <asp:ListItem Value="Y">是</asp:ListItem>
  77.                             <asp:ListItem Value="N">否</asp:ListItem>
  78.                         </asp:DropDownList>
  79.                     </td>
  80.                 </tr>
  81.                 <tr>
  82.                     <td colspan="3">
  83.                         <asp:Button ID="BtnOk" runat="server" Text="儲存" OnClick="BtnOk_Click" /></td>
  84.                 </tr>
  85.             </table>
  86.         </asp:Panel>
  87.         </center>
  88.     </div>
  89.     </form>
  90. </body>
  91. </html>