dir.aspx
资源名称:web.rar [点击查看]
上传用户:xrffrp
上传日期:2022-03-25
资源大小:22155k
文件大小:11k
源码类别:
OA系统
开发平台:
ASP/ASPX
- <%@ Page Language="C#" AutoEventWireup="true" CodeFile="dir.aspx.cs" Inherits="web_regulation_dir" %>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml" >
- <head runat="server">
- <title>无标题页</title>
- <link href="../../css/style.css" rel="stylesheet" type="text/css" />
- <script type="text/javascript" language="javascript">
- function selectDir()
- {
- var url = "../regulation/regulation_select_tree.aspx";
- var features = "width=400,height=500,top=200,left=250,location=no,toolbar=no,status=no,resizable=yes,scrollbars=yes";
- var selectDir = open(url, 'selectDir', features);
- selectDir.focus();
- }
- function setDir(id, name)
- {
- document.all.LastDirId.value=id;
- document.all.TxtLastDir.value=name;
- }
- </script>
- </head>
- <body>
- <form id="form1" runat="server">
- <div>
- <center>
- <asp:Label ID="LblTitle" runat="server" Font-Bold="True" Font-Size="Medium"></asp:Label>
- <table style="width: 680px">
- <tr>
- <td><br />
- <table>
- <tr>
- <td>
- <asp:Button ID="BtnShowFile" runat="server" Text="顯示檔案列表" OnClick="BtnShowFile_Click" />
- </td>
- <td>
- <asp:Button ID="BtnShowDir" runat="server" Text="顯示目錄列表" OnClick="BtnShowDir_Click" />
- </td>
- <td>
- <asp:Button ID="BtnAddFile" runat="server" Text="添加檔案" OnClick="BtnAddFile_Click" />
- </td>
- <td>
- <asp:Button ID="BtnAddDir" runat="server" Text="添加目錄" OnClick="BtnAddDir_Click" />
- </td>
- </tr>
- </table>
- <input id="DirId" style="position: relative" value="16" runat="server" type="hidden" /><br />
- </td>
- </tr>
- <tr>
- <td>
- <asp:Panel ID="PnlDir" runat="server" Width="550px" Visible="False">
- <asp:Label ID="LblDirTitle" runat="server" Font-Bold="True" Text="添加新目錄" Font-Size="Medium"></asp:Label>
- <input id="ParentId" style="position: relative" runat="server" type="hidden" />
- <table width="500" border="1">
- <tr>
- <td style="width: 120px; height: 20px;">
- <asp:Label ID="LblLast" runat="server" Text="上一級目錄"></asp:Label>
- </td>
- <td style="width: 249px; height: 20px;" align="left">
- <asp:Label ID="LblLastDir" runat="server" Style="position: relative"></asp:Label> </td>
- </tr>
- <tr>
- <td style="width: 120px">
- <asp:Label ID="LblName" runat="server" Text="名稱"></asp:Label></td>
- <td style="width: 249px" align="left">
- <asp:TextBox ID="TxtName" runat="server" Width="217px"></asp:TextBox>
- <asp:Label ID="LblErrDirName" runat="server" ForeColor="Red" Style="position: relative"></asp:Label></td>
- </tr>
- <tr>
- <td style="width: 120px">
- <asp:Label ID="LblDescription" runat="server" Text="描述"></asp:Label></td>
- <td style="width: 249px" align="left">
- <asp:TextBox ID="TxtDescription" runat="server" TextMode="MultiLine" Width="220px"></asp:TextBox>
- </td>
- </tr>
- <tr>
- <td colspan="2">
- <asp:Button ID="BtnOk" runat="server" Text="儲存" OnClick="BtnOk_Click" />
- </td>
- </tr>
- </table>
- <br />
- </asp:Panel>
- <asp:Panel ID="PnlDirList" runat="server" Width="550px" style="position: relative" Visible="false">
- <asp:GridView ID="DirList" runat="server" AllowPaging="True" AutoGenerateColumns="False"
- BackColor="White" BorderColor="#999999" BorderStyle="None" BorderWidth="1px"
- CellPadding="3" DataKeyNames="id" DataSourceID="SqlDataSource1" GridLines="Vertical"
- Style="position: relative" Width="550px" OnRowUpdated="DirList_RowUpdated">
- <FooterStyle BackColor="#CCCCCC" ForeColor="Black" />
- <RowStyle BackColor="#EEEEEE" ForeColor="Black" />
- <Columns>
- <asp:BoundField DataField="name" HeaderText="目錄名稱" SortExpression="name" />
- <asp:BoundField DataField="description" HeaderText="目錄描述" SortExpression="description" />
- <asp:CommandField ShowEditButton="True" />
- </Columns>
- <PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" />
- <SelectedRowStyle BackColor="#008A8C" Font-Bold="True" ForeColor="White" />
- <HeaderStyle BackColor="#000084" Font-Bold="True" ForeColor="White" />
- <AlternatingRowStyle BackColor="Gainsboro" />
- </asp:GridView>
- <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:oaConnection %>"
- DeleteCommand="DELETE FROM [OA_SYS_CHILD_MENU] WHERE [id] = @id" InsertCommand="INSERT INTO [OA_SYS_CHILD_MENU] ([name], [description], [id]) VALUES (@name, @description, @id)"
- SelectCommand="SELECT [name], [description], [id] FROM [OA_SYS_CHILD_MENU] WHERE ([parent_id] = @parent_id) ORDER BY [sequence]"
- UpdateCommand="UPDATE [OA_SYS_CHILD_MENU] SET [name] = @name, [description] = @description WHERE [id] = @id">
- <SelectParameters>
- <asp:QueryStringParameter DefaultValue="16" Name="parent_id" QueryStringField="dir_id"
- Type="Int32" />
- </SelectParameters>
- <DeleteParameters>
- <asp:Parameter Name="id" Type="Int32" />
- </DeleteParameters>
- <UpdateParameters>
- <asp:Parameter Name="name" Type="String" />
- <asp:Parameter Name="description" Type="String" />
- <asp:Parameter Name="id" Type="Int32" />
- </UpdateParameters>
- <InsertParameters>
- <asp:Parameter Name="name" Type="String" />
- <asp:Parameter Name="description" Type="String" />
- <asp:Parameter Name="id" Type="Int32" />
- </InsertParameters>
- </asp:SqlDataSource>
- </asp:Panel>
- <asp:Panel ID="pnlAddFile" runat="server" Style="position: relative" Width="550px" Visible="false">
- <asp:Label ID="Label2" runat="server" Font-Bold="True" Font-Size="Medium" Style="position: relative"
- Text="添加新檔案"></asp:Label><br />
- <table style="position: relative" width="500" border="1">
- <tr>
- <td style="width: 120px; height: 20px">
- <asp:Label ID="Label1" runat="server" Style="position: relative" Text="檔案目錄"></asp:Label>
- </td>
- <td style="height: 20px" align="left">
- <asp:Label ID="LblFileDir" runat="server" Style="position: relative" Text=""></asp:Label>
- </td>
- </tr>
- <tr>
- <td style="width: 120px">
- <asp:Label ID="LblFile" runat="server" Style="position: relative" Text="檔案"></asp:Label>
- </td>
- <td align="left">
- <asp:FileUpload ID="FileUpload1" runat="server" Width="320px" />
- <br />
- <asp:Label ID="LblFileError" runat="server" ForeColor="Red" Style="position: relative"></asp:Label>
- <input id="ContentLength" runat="server" type="hidden" style="position: relative" /></td>
- </tr>
- <tr>
- <td colspan="2">
- <asp:Button ID="BtnFileOk" runat="server" Text="儲存" OnClick="BtnFileOk_Click" />
- </td>
- </tr>
- </table>
- </asp:Panel>
- <asp:Panel ID="PnlFileList" runat="server">
- <asp:GridView ID="FileList" runat="server" AllowPaging="True" AllowSorting="True"
- AutoGenerateColumns="False" BackColor="White" BorderColor="#999999" BorderStyle="None"
- BorderWidth="1px" CellPadding="3" DataKeyNames="id" DataSourceID="SqlDataSource2"
- GridLines="Vertical" Style="position: relative" Width="550px" OnRowCreated="FileList_RowCreated" OnRowDataBound="FileList_RowDataBound" OnRowCommand="FileList_RowCommand">
- <FooterStyle BackColor="#CCCCCC" ForeColor="Black" />
- <RowStyle BackColor="#EEEEEE" ForeColor="Black" />
- <Columns>
- <asp:TemplateField HeaderText="檔案名">
- <ItemTemplate>
- <asp:LinkButton ID="BtnFile" runat="server" CommandName="DownLoad" Style="position: relative" Text='<%# Eval("real_name") %>'></asp:LinkButton>
- </ItemTemplate>
- </asp:TemplateField>
- <asp:BoundField DataField="cre_user" HeaderText="創建人" SortExpression="cre_user" />
- <asp:BoundField DataField="cre_date" HeaderText="創建時間" SortExpression="cre_date" />
- <asp:TemplateField>
- <ItemTemplate>
- <asp:LinkButton ID="BtnDelete" runat="server" OnClientClick='return confirm("確定要刪除檔案嗎?")'
- Style="position: relative" CommandName="DeleteData">刪除</asp:LinkButton>
- </ItemTemplate>
- </asp:TemplateField>
- </Columns>
- <PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" />
- <SelectedRowStyle BackColor="#008A8C" Font-Bold="True" ForeColor="White" />
- <HeaderStyle BackColor="#000084" Font-Bold="True" ForeColor="White" />
- <AlternatingRowStyle BackColor="Gainsboro" />
- </asp:GridView>
- <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:oaConnection %>"
- SelectCommand="SELECT [id], [real_name], [cre_date], [cre_user] FROM [OA_REGULATION_FILE] WHERE ([dir_id] = @dir_id)">
- <SelectParameters>
- <asp:QueryStringParameter DefaultValue="16" Name="dir_id" QueryStringField="dir_id"
- Type="Int32" />
- </SelectParameters>
- </asp:SqlDataSource>
- </asp:Panel>
- </td>
- </tr>
- </table></center>
- </div>
- </form>
- </body>
- </html>