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

OA系统

开发平台:

ASP/ASPX

  1. <%@ Page Language="C#" AutoEventWireup="true" CodeFile="dir.aspx.cs" Inherits="web_regulation_dir" %>
  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 selectDir()
  9.     {
  10.         var url = "../regulation/regulation_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 selectDir = open(url, 'selectDir', features);
  13.         selectDir.focus();
  14.     }
  15.     function setDir(id, name)
  16.     {
  17.         document.all.LastDirId.value=id;
  18.         document.all.TxtLastDir.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" Font-Bold="True" Font-Size="Medium"></asp:Label>
  27.     <table style="width: 680px">
  28.         <tr>
  29.         <td><br />
  30.             <table>
  31.                 <tr>
  32.                     <td>
  33.                         <asp:Button ID="BtnShowFile" runat="server" Text="顯示檔案列表" OnClick="BtnShowFile_Click" />
  34.                     </td>
  35.                     <td>
  36.                         <asp:Button ID="BtnShowDir" runat="server" Text="顯示目錄列表" OnClick="BtnShowDir_Click" />
  37.                     </td>
  38.                     <td>
  39.                         <asp:Button ID="BtnAddFile" runat="server" Text="添加檔案" OnClick="BtnAddFile_Click" />
  40.                     </td>
  41.                     <td>
  42.                         <asp:Button ID="BtnAddDir" runat="server" Text="添加目錄" OnClick="BtnAddDir_Click" />
  43.                     </td>
  44.                 </tr>
  45.             </table>
  46.             <input id="DirId" style="position: relative" value="16" runat="server" type="hidden" /><br />
  47.         </td>
  48.         </tr>
  49.         <tr>
  50.         <td>
  51.         <asp:Panel ID="PnlDir" runat="server" Width="550px" Visible="False">
  52.             <asp:Label ID="LblDirTitle" runat="server" Font-Bold="True" Text="添加新目錄" Font-Size="Medium"></asp:Label>
  53.             <input id="ParentId" style="position: relative" runat="server" type="hidden" />
  54.             <table width="500" border="1">
  55.                 <tr>
  56.                     <td style="width: 120px; height: 20px;">
  57.                         <asp:Label ID="LblLast" runat="server" Text="上一級目錄"></asp:Label>
  58.                     </td>
  59.                     <td style="width: 249px; height: 20px;" align="left">
  60.                         <asp:Label ID="LblLastDir" runat="server" Style="position: relative"></asp:Label>&nbsp;</td>
  61.                 </tr>
  62.                 <tr>
  63.                     <td style="width: 120px">
  64.                         <asp:Label ID="LblName" runat="server" Text="名稱"></asp:Label></td>
  65.                     <td style="width: 249px" align="left">
  66.                         <asp:TextBox ID="TxtName" runat="server" Width="217px"></asp:TextBox>
  67.                         <asp:Label ID="LblErrDirName" runat="server" ForeColor="Red" Style="position: relative"></asp:Label></td>
  68.                 </tr>
  69.                 <tr>
  70.                     <td style="width: 120px">
  71.                         <asp:Label ID="LblDescription" runat="server" Text="描述"></asp:Label></td>
  72.                     <td style="width: 249px" align="left">
  73.                         <asp:TextBox ID="TxtDescription" runat="server" TextMode="MultiLine" Width="220px"></asp:TextBox>
  74.                     </td>
  75.                 </tr>
  76.                 <tr>
  77.                     <td colspan="2">
  78.                         <asp:Button ID="BtnOk" runat="server" Text="儲存" OnClick="BtnOk_Click" />
  79.                     </td>
  80.                 </tr>
  81.             </table>
  82.             <br />
  83.         </asp:Panel>
  84.         <asp:Panel ID="PnlDirList" runat="server" Width="550px" style="position: relative" Visible="false">
  85.             <asp:GridView ID="DirList" runat="server" AllowPaging="True" AutoGenerateColumns="False"
  86.                 BackColor="White" BorderColor="#999999" BorderStyle="None" BorderWidth="1px"
  87.                 CellPadding="3" DataKeyNames="id" DataSourceID="SqlDataSource1" GridLines="Vertical"
  88.                 Style="position: relative" Width="550px" OnRowUpdated="DirList_RowUpdated">
  89.                 <FooterStyle BackColor="#CCCCCC" ForeColor="Black" />
  90.                 <RowStyle BackColor="#EEEEEE" ForeColor="Black" />
  91.                 <Columns>
  92.                     <asp:BoundField DataField="name" HeaderText="目錄名稱" SortExpression="name" />
  93.                     <asp:BoundField DataField="description" HeaderText="目錄描述" SortExpression="description" />
  94.                     <asp:CommandField ShowEditButton="True" />
  95.                 </Columns>
  96.                 <PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" />
  97.                 <SelectedRowStyle BackColor="#008A8C" Font-Bold="True" ForeColor="White" />
  98.                 <HeaderStyle BackColor="#000084" Font-Bold="True" ForeColor="White" />
  99.                 <AlternatingRowStyle BackColor="Gainsboro" />
  100.             </asp:GridView>
  101.             <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:oaConnection %>"
  102.                 DeleteCommand="DELETE FROM [OA_SYS_CHILD_MENU] WHERE [id] = @id" InsertCommand="INSERT INTO [OA_SYS_CHILD_MENU] ([name], [description], [id]) VALUES (@name, @description, @id)"
  103.                 SelectCommand="SELECT [name], [description], [id] FROM [OA_SYS_CHILD_MENU] WHERE ([parent_id] = @parent_id) ORDER BY [sequence]"
  104.                 UpdateCommand="UPDATE [OA_SYS_CHILD_MENU] SET [name] = @name, [description] = @description WHERE [id] = @id">
  105.                 <SelectParameters>
  106.                     <asp:QueryStringParameter DefaultValue="16" Name="parent_id" QueryStringField="dir_id"
  107.                         Type="Int32" />
  108.                 </SelectParameters>
  109.                 <DeleteParameters>
  110.                     <asp:Parameter Name="id" Type="Int32" />
  111.                 </DeleteParameters>
  112.                 <UpdateParameters>
  113.                     <asp:Parameter Name="name" Type="String" />
  114.                     <asp:Parameter Name="description" Type="String" />
  115.                     <asp:Parameter Name="id" Type="Int32" />
  116.                 </UpdateParameters>
  117.                 <InsertParameters>
  118.                     <asp:Parameter Name="name" Type="String" />
  119.                     <asp:Parameter Name="description" Type="String" />
  120.                     <asp:Parameter Name="id" Type="Int32" />
  121.                 </InsertParameters>
  122.             </asp:SqlDataSource>
  123.         </asp:Panel>
  124.             <asp:Panel ID="pnlAddFile" runat="server" Style="position: relative" Width="550px" Visible="false">
  125.                 <asp:Label ID="Label2" runat="server" Font-Bold="True" Font-Size="Medium" Style="position: relative"
  126.                     Text="添加新檔案"></asp:Label><br />
  127.                 <table style="position: relative" width="500" border="1">
  128.                     <tr>
  129.                         <td style="width: 120px; height: 20px">
  130.                             <asp:Label ID="Label1" runat="server" Style="position: relative" Text="檔案目錄"></asp:Label>
  131.                         </td>
  132.                         <td style="height: 20px" align="left">
  133.                             <asp:Label ID="LblFileDir" runat="server" Style="position: relative" Text=""></asp:Label>
  134.                         </td>
  135.                     </tr>
  136.                     <tr>
  137.                         <td style="width: 120px">
  138.                             <asp:Label ID="LblFile" runat="server" Style="position: relative" Text="檔案"></asp:Label>&nbsp;
  139.                         </td>
  140.                         <td align="left">
  141.                             <asp:FileUpload ID="FileUpload1" runat="server" Width="320px" />
  142.                             <br />
  143.                             <asp:Label ID="LblFileError" runat="server" ForeColor="Red" Style="position: relative"></asp:Label>
  144.                             <input id="ContentLength" runat="server" type="hidden" style="position: relative" /></td>
  145.                     </tr>
  146.                     <tr>
  147.                         <td colspan="2">
  148.                             <asp:Button ID="BtnFileOk" runat="server" Text="儲存" OnClick="BtnFileOk_Click" />
  149.                         </td>
  150.                     </tr>
  151.                 </table>
  152.             </asp:Panel>
  153.             <asp:Panel ID="PnlFileList" runat="server">            
  154.                 <asp:GridView ID="FileList" runat="server" AllowPaging="True" AllowSorting="True"
  155.                     AutoGenerateColumns="False" BackColor="White" BorderColor="#999999" BorderStyle="None"
  156.                     BorderWidth="1px" CellPadding="3" DataKeyNames="id" DataSourceID="SqlDataSource2"
  157.                     GridLines="Vertical" Style="position: relative" Width="550px" OnRowCreated="FileList_RowCreated" OnRowDataBound="FileList_RowDataBound" OnRowCommand="FileList_RowCommand">
  158.                     <FooterStyle BackColor="#CCCCCC" ForeColor="Black" />
  159.                     <RowStyle BackColor="#EEEEEE" ForeColor="Black" />
  160.                     <Columns>
  161.                         <asp:TemplateField HeaderText="檔案名">
  162.                             <ItemTemplate>
  163.                                 <asp:LinkButton ID="BtnFile" runat="server" CommandName="DownLoad" Style="position: relative" Text='<%# Eval("real_name") %>'></asp:LinkButton>
  164.                             </ItemTemplate>
  165.                         </asp:TemplateField>
  166.                         <asp:BoundField DataField="cre_user" HeaderText="創建人" SortExpression="cre_user" />
  167.                         <asp:BoundField DataField="cre_date" HeaderText="創建時間" SortExpression="cre_date" />
  168.                         <asp:TemplateField>
  169.                             <ItemTemplate>
  170.                                 <asp:LinkButton ID="BtnDelete" runat="server" OnClientClick='return confirm("確定要刪除檔案嗎?")'
  171.                                     Style="position: relative" CommandName="DeleteData">刪除</asp:LinkButton>
  172.                             </ItemTemplate>
  173.                         </asp:TemplateField>
  174.                     </Columns>
  175.                     <PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" />
  176.                     <SelectedRowStyle BackColor="#008A8C" Font-Bold="True" ForeColor="White" />
  177.                     <HeaderStyle BackColor="#000084" Font-Bold="True" ForeColor="White" />
  178.                     <AlternatingRowStyle BackColor="Gainsboro" />
  179.                 </asp:GridView>
  180.                 <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:oaConnection %>"
  181.                     SelectCommand="SELECT [id], [real_name], [cre_date], [cre_user] FROM [OA_REGULATION_FILE] WHERE ([dir_id] = @dir_id)">
  182.                     <SelectParameters>
  183.                         <asp:QueryStringParameter DefaultValue="16" Name="dir_id" QueryStringField="dir_id"
  184.                             Type="Int32" />
  185.                     </SelectParameters>
  186.                 </asp:SqlDataSource>
  187.             </asp:Panel>
  188.         </td>
  189.         </tr>
  190.     </table></center>
  191.     </div>
  192.     </form>
  193. </body>
  194. </html>