department.aspx
资源名称:web.rar [点击查看]
上传用户:xrffrp
上传日期:2022-03-25
资源大小:22155k
文件大小:21k
源码类别:
OA系统
开发平台:
ASP/ASPX
- <%@ Page Language="C#" AutoEventWireup="true" CodeFile="department.aspx.cs" Inherits="web_department_department" %>
- <!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 selectDepartment()
- {
- var url = "department_select_tree.aspx";
- var features = "width=400,height=500,top=200,left=250,location=no,toolbar=no,status=no,resizable=yes,scrollbars=yes";
- var selectDepartment = open(url, 'selectDepartment', features);
- selectDepartment.focus();
- }
- function setDepartment(deptId, deptName)
- {
- document.all.lastDepartment_id.value=deptId;
- document.all.txtLastDepartment2.value=deptName;
- }
- </script>
- </head>
- <body>
- <center>
- <form id="form1" runat="server">
- <asp:MultiView ID="MultiView1" runat="server" ActiveViewIndex="0">
- <asp:View ID="View1" runat="server">
- <asp:Label BorderStyle="None" ID="lblTitle" runat="server" Font-Bold="True" Font-Size="Medium"></asp:Label>
- <asp:GridView ID="Department_list" runat="server" AutoGenerateColumns="False" BackColor="White"
- BorderColor="#999999" BorderStyle="None" BorderWidth="1px" CellPadding="3" DataKeyNames="id"
- DataSourceID="SqlDataSource1"
- Width="800px" AllowPaging="True" OnRowDataBound="Department_list_RowDataBound" OnRowUpdating="Department_list_RowUpdating" OnRowCommand="Department_list_RowCommand" PageSize="5">
- <FooterStyle BackColor="#CCCCCC" ForeColor="Black" />
- <RowStyle BackColor="#EEEEEE" ForeColor="Black" />
- <Columns>
- <asp:BoundField DataField="id" HeaderText="id" ReadOnly="True" SortExpression="id" Visible="False" />
- <asp:BoundField DataField="name" HeaderText="部門名稱" SortExpression="name" />
- <asp:BoundField DataField="last_id" HeaderText="last_id" SortExpression="last_id" Visible="False" />
- <asp:BoundField DataField="code" HeaderText="部門代號" SortExpression="code" />
- <asp:BoundField DataField="tel" HeaderText="電話" SortExpression="tel" />
- <asp:BoundField DataField="fax" HeaderText="傳真" SortExpression="fax" />
- <asp:BoundField DataField="function" HeaderText="部門職能" SortExpression="function" />
- <asp:CommandField ShowEditButton="True" />
- <asp:TemplateField ShowHeader="False">
- <ItemTemplate>
- <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" CommandArgument='<%# Eval("id") %>'
- CommandName="Delete" OnClientClick='javascript:return confirm("資料刪除后將無法恢復, 確定要刪除嗎?");'
- Text="删除"></asp:LinkButton>
- </ItemTemplate>
- </asp:TemplateField>
- </Columns>
- <PagerStyle BackColor="Gray" ForeColor="Black" HorizontalAlign="Center" />
- <SelectedRowStyle BackColor="#008A8C" Font-Bold="True" ForeColor="White" />
- <HeaderStyle BackColor="#000084" Font-Bold="True" ForeColor="White" />
- <AlternatingRowStyle BackColor="Gainsboro" />
- <EmptyDataTemplate>
- <asp:Label BorderStyle="None" ID="Label1" runat="server" Style="position: relative" Text="沒有該部門的下級部門資料"></asp:Label>
- </EmptyDataTemplate>
- </asp:GridView>
- <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConflictDetection="CompareAllValues"
- ConnectionString="<%$ ConnectionStrings:oaConnection %>" DeleteCommand="DELETE FROM [OA_DEPARTMENT] WHERE [id] = @original_id AND [name] = @original_name AND [last_id] = @original_last_id AND [code] = @original_code AND [upd_user] = @original_upd_user AND [cre_date] = @original_cre_date AND [cre_user] = @original_cre_user AND [function] = @original_function AND [fax] = @original_fax AND [tel] = @original_tel AND [upd_date] = @original_upd_date"
- InsertCommand="INSERT INTO [OA_DEPARTMENT] ([id], [name], [last_id], [code], [upd_user], [cre_date], [cre_user], [function], [fax], [tel], [upd_date]) VALUES (@id, @name, @last_id, @code, @upd_user, @cre_date, @cre_user, @function, @fax, @tel, @upd_date)"
- OldValuesParameterFormatString="original_{0}" SelectCommand="SELECT [id], [name], [last_id], [code], [upd_user], [cre_date], [cre_user], [function], [fax], [tel], [upd_date] FROM [OA_DEPARTMENT] WHERE ([last_id] = @last_id) ORDER BY [sequence], [name]"
- UpdateCommand="UPDATE [OA_DEPARTMENT] SET [name] = @name, [last_id] = @last_id, [code] = @code, [upd_user] = @upd_user, [cre_date] = @cre_date, [cre_user] = @cre_user, [function] = @function, [fax] = @fax, [tel] = @tel, [upd_date] = @upd_date WHERE [id] = @original_id AND [name] = @original_name AND [last_id] = @original_last_id AND [code] = @original_code AND [upd_user] = @original_upd_user AND [cre_date] = @original_cre_date AND [cre_user] = @original_cre_user AND [function] = @original_function AND [fax] = @original_fax AND [tel] = @original_tel AND [upd_date] = @original_upd_date">
- <SelectParameters>
- <asp:QueryStringParameter DefaultValue="1" Name="last_id" QueryStringField="last_id"
- Type="Int32" />
- </SelectParameters>
- <DeleteParameters>
- <asp:Parameter Name="original_id" Type="Int32" />
- <asp:Parameter Name="original_name" Type="String" />
- <asp:Parameter Name="original_last_id" Type="Int32" />
- <asp:Parameter Name="original_code" Type="String" />
- <asp:Parameter Name="original_upd_user" Type="String" />
- <asp:Parameter Name="original_cre_date" Type="String" />
- <asp:Parameter Name="original_cre_user" Type="String" />
- <asp:Parameter Name="original_function" Type="String" />
- <asp:Parameter Name="original_fax" Type="String" />
- <asp:Parameter Name="original_tel" Type="String" />
- <asp:Parameter Name="original_upd_date" Type="String" />
- </DeleteParameters>
- <UpdateParameters>
- <asp:Parameter Name="name" Type="String" />
- <asp:Parameter Name="last_id" Type="Int32" />
- <asp:Parameter Name="code" Type="String" />
- <asp:Parameter Name="upd_user" Type="String" />
- <asp:Parameter Name="cre_date" Type="String" />
- <asp:Parameter Name="cre_user" Type="String" />
- <asp:Parameter Name="function" Type="String" />
- <asp:Parameter Name="fax" Type="String" />
- <asp:Parameter Name="tel" Type="String" />
- <asp:Parameter Name="upd_date" Type="String" />
- <asp:Parameter Name="original_id" Type="Int32" />
- <asp:Parameter Name="original_name" Type="String" />
- <asp:Parameter Name="original_last_id" Type="Int32" />
- <asp:Parameter Name="original_code" Type="String" />
- <asp:Parameter Name="original_upd_user" Type="String" />
- <asp:Parameter Name="original_cre_date" Type="String" />
- <asp:Parameter Name="original_cre_user" Type="String" />
- <asp:Parameter Name="original_function" Type="String" />
- <asp:Parameter Name="original_fax" Type="String" />
- <asp:Parameter Name="original_tel" Type="String" />
- <asp:Parameter Name="original_upd_date" Type="String" />
- </UpdateParameters>
- <InsertParameters>
- <asp:Parameter Name="id" Type="Int32" />
- <asp:Parameter Name="name" Type="String" />
- <asp:Parameter Name="last_id" Type="Int32" />
- <asp:Parameter Name="code" Type="String" />
- <asp:Parameter Name="upd_user" Type="String" />
- <asp:Parameter Name="cre_date" Type="String" />
- <asp:Parameter Name="cre_user" Type="String" />
- <asp:Parameter Name="function" Type="String" />
- <asp:Parameter Name="fax" Type="String" />
- <asp:Parameter Name="tel" Type="String" />
- <asp:Parameter Name="upd_date" Type="String" />
- </InsertParameters>
- </asp:SqlDataSource>
- </asp:View>
- </asp:MultiView>
- <asp:MultiView ID="MultiView2" runat="server" ActiveViewIndex="0">
- <asp:View ID="View2" runat="server">
- <hr />
- <asp:Button ID="btnAddNew" runat="server" Text="添加下級部門" OnClick="btnAddNew_Click" />
- <asp:Button ID="btnEditDepartment" runat="server" Text="編輯本部門信息" OnClick="btnEditDepartment_Click" />
- <asp:Button ID="btnShow" runat="server" Text="查看本部門信息" OnClick="btnShow_Click" />
- <asp:Button ID="btnShowEmployee" runat="server" Text="本部門員工" OnClick="btnShowEmployee_Click" Visible="False" />
- <asp:Panel ID="Panel1" runat="server" Width="562px">
- <br />
- <asp:Label BorderStyle="None" ID="lblAdd" runat="server" Text="添加下級部門" Font-Bold="True" Font-Size="Medium"></asp:Label>
- <table border="1">
- <tr>
- <td align="center" style="width: 122px">上級部門:</td>
- <td style="width: 322px" align="left">
- <asp:Label BorderStyle="None" ID="lblLast_department" runat="server" Text=""></asp:Label>
- </td>
- </tr>
- <tr>
- <td align="center" style="width: 122px">部門名稱:</td>
- <td style="width: 322px" align="left">
- <asp:TextBox ID="txtName" runat="server" Width="200px"></asp:TextBox>
- <asp:Label BorderStyle="None" ID="Label3" runat="server" ForeColor="Red" Style="position: relative"
- Text="*"></asp:Label>
- <asp:Label BorderStyle="None" ID="lblName" runat="server" ForeColor="Red" Style="position: relative"></asp:Label></td>
- </tr>
- <tr>
- <td align="center" style="width: 122px">部門代號:</td>
- <td style="width: 322px" align="left">
- <asp:TextBox ID="txtCode" runat="server" Width="200px"></asp:TextBox>
- </td>
- </tr>
- <tr>
- <td align="center" style="width: 122px">電話:</td>
- <td style="width: 322px" align="left">
- <asp:TextBox ID="txtTel" runat="server" Width="200px"></asp:TextBox>
- </td>
- </tr>
- <tr>
- <td align="center" style="width: 122px">傳真:</td>
- <td style="width: 322px" align="left">
- <asp:TextBox ID="txtFax" runat="server" Width="200px"></asp:TextBox>
- </td>
- </tr>
- <tr>
- <td align="center" style="width: 122px">層數:</td>
- <td style="width: 322px" align="left">
- <asp:TextBox ID="textCeng" runat="server" Width="200px"></asp:TextBox>
- </td>
- </tr>
- <tr>
- <td align="center" style="width: 122px; height: 28px;">部門職能:</td>
- <td style="width: 322px; height: 28px;" align="left">
- <asp:TextBox ID="txtFunction" runat="server" Width="200px"></asp:TextBox>
- </td>
- </tr>
- <tr>
- <td align="center" style="width: 122px">所属公司</td>
- <td style="width: 322px" align="left">
- <asp:DropDownList ID="DropDownList1" runat="server" Width="200px">
- <asp:ListItem Value="0">85度C</asp:ListItem>
- <asp:ListItem Value="1">津味</asp:ListItem>
- <asp:ListItem Value="2">和夏</asp:ListItem>
- </asp:DropDownList>
- </td>
- </tr>
- <tr>
- <td colspan="3" align="center" style="height: 28px">
- <asp:Button ID="btnOk" runat="server" Text="儲存" OnClick="btnOk_Click" />
- </td>
- </tr>
- </table>
- </asp:Panel>
- <asp:Panel ID="Panel2" runat="server" Height="229px"
- Width="564px">
- <br />
- <asp:Label BorderStyle="None" ID="lblEdit" runat="server" Font-Bold="True" Font-Size="Medium"
- Text="編輯本部門信息"></asp:Label>
- s<table border="1">
- <tr>
- <td align="center" style="width: 122px">
- 上級部門:</td>
- <td style="width: 322px" align="left">
- <asp:TextBox ID="txtLastDepartment2" runat="server" Width="200px" Enabled="false"></asp:TextBox>
- <asp:Button ID="btnSelect" runat="server" Style="position: relative" Text="選擇部門" />
- <input id="lastDepartment_id" type="hidden" runat="server" /></td>
- </tr>
- <tr>
- <td align="center" style="width: 122px">
- 部門名稱:</td>
- <td style="width: 322px" align="left">
- <asp:TextBox ID="txtName2" runat="server" Width="200px"></asp:TextBox>
- <asp:Label BorderStyle="None" ID="Label11" runat="server" ForeColor="Red" Style="position: relative"
- Text="*"></asp:Label>
- <asp:Label BorderStyle="None" ID="lblName2" runat="server" ForeColor="Red" Style="position: relative"></asp:Label></td>
- </tr>
- <tr>
- <td align="center" style="width: 122px">
- 部門代號:</td>
- <td style="width: 322px" align="left">
- <asp:TextBox ID="txtCode2" runat="server" Width="200px"></asp:TextBox>
- </td>
- </tr>
- <tr>
- <td align="center" style="width: 122px; height: 28px;">
- 電話:</td>
- <td style="width: 322px; height: 28px;" align="left">
- <asp:TextBox ID="txtTel2" runat="server" Width="200px"></asp:TextBox>
- </td>
- </tr>
- <tr>
- <td align="center" style="width: 122px">
- 傳真:</td>
- <td style="width: 322px" align="left">
- <asp:TextBox ID="txtFax2" runat="server" Width="200px"></asp:TextBox>
- </td>
- </tr>
- <tr>
- <td align="center" style="width: 122px; height: 28px;">層數:</td>
- <td style="width: 322px; height: 28px;" align="left">
- <asp:TextBox ID="textCeng2" runat="server" Width="200px"></asp:TextBox>
- </td>
- </tr>
- <tr>
- <td align="center" style="width: 122px; height: 28px;">
- 部門職能:</td>
- <td style="width: 322px; height: 28px;" align="left">
- <asp:TextBox ID="txtFunction2" runat="server" Width="200px"></asp:TextBox>
- </td>
- </tr>
- <tr>
- <td align="center" style="width: 122px">所属公司</td>
- <td style="width: 322px" align="left">
- <asp:DropDownList ID="DropDownList2" runat="server" Width="200px">
- <asp:ListItem Value="0">85度C</asp:ListItem>
- <asp:ListItem Value="1">津味</asp:ListItem>
- <asp:ListItem Value="2">和夏</asp:ListItem>
- </asp:DropDownList>
- </td>
- </tr>
- <tr>
- <td colspan="3" align="center">
- <asp:Button ID="btnEdit" runat="server" Text="儲存" OnClick="btnEdit_Click" />
- </td>
- </tr>
- </table>
- </asp:Panel>
- <asp:Panel ID="Panel3" runat="server" Height="204px" Width="564px"><br />
- <asp:Label BorderStyle="None" ID="Label4" runat="server" Font-Bold="True" Font-Size="Medium"
- Text="本部門詳細信息"></asp:Label>
- <table style="width: 456px;" border="1">
- <tr>
- <td align="center" style="width: 205px">
- 上級部門:</td>
- <td style="width: 321px" align="left">
- <asp:Label BorderStyle="None" ID="lblLastDepartment" runat="server" Text=""></asp:Label>
- </td>
- </tr>
- <tr>
- <td align="center" style="width: 205px; height: 23px;">
- 部門名稱:</td>
- <td style="width: 321px; height: 23px;" align="left">
- <asp:Label BorderStyle="None" ID="lblDepartmentName" runat="server" Text=""></asp:Label>
- </td>
- </tr>
- <tr>
- <td align="center" style="width: 205px">
- 部門代號:</td>
- <td style="width: 321px" align="left">
- <asp:Label BorderStyle="None" ID="lblDepartmentCode" runat="server" Text=""></asp:Label>
- </td>
- </tr>
- <tr>
- <td align="center" style="width: 205px">
- 電話:</td>
- <td style="width: 321px" align="left">
- <asp:Label BorderStyle="None" ID="lblTel" runat="server" Text=""></asp:Label>
- </td>
- </tr>
- <tr>
- <td align="center" style="width: 205px">
- 傳真:</td>
- <td style="width: 321px" align="left">
- <asp:Label BorderStyle="None" ID="lblFax" runat="server" Text=""></asp:Label>
- </td>
- </tr>
- <tr>
- <td align="center" style="width: 122px">層數:</td>
- <td style="width: 321px" align="left">
- <asp:Label BorderStyle="None" ID="lblCeng" runat="server" Text=""></asp:Label>
- </td>
- </tr>
- <tr>
- <td align="center" style="width: 205px; height: 23px;">
- 部門職能:</td>
- <td style="width: 321px; height: 23px;" align="left">
- <asp:Label BorderStyle="None" ID="lblFunction" runat="server" Text=""></asp:Label>
- </td>
- </tr>
- <tr>
- <td align="center" style="width: 122px">所属公司</td>
- <td style="width: 322px" align="left">
- <asp:Label ID="lblcompany" runat="server" BorderStyle="None" Text=""></asp:Label></td>
- </tr>
- </table>
- </asp:Panel>
- </asp:View>
- </asp:MultiView>
- </form>
- </center>
- </body>
- </html>