chore: 首次簽入 Thinkyu ASP.NET 專案
- 加入 Visual Studio / ASP.NET .gitignore - 排除建置輸出、IDE 設定、NuGet packages、大型 MSI 安裝檔
This commit is contained in:
@@ -0,0 +1,152 @@
|
||||
<%@ Page Title="" Language="C#" MasterPageFile="~/Site2.Master" AutoEventWireup="true" CodeBehind="簽核關卡設定.aspx.cs" Inherits="Education.Forms.組織.簽核關卡設定" %>
|
||||
<%@ Register Assembly="WebLib" Namespace="WebLib" TagPrefix="weblib" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
|
||||
<table>
|
||||
<tr>
|
||||
<td class="caption">
|
||||
<asp:Label ID="Label9" runat="server" Text="表單名稱"></asp:Label>
|
||||
</td>
|
||||
<td>
|
||||
<weblib:WDropDownList ID="ddl表單名稱" runat="server" AutoPostBack="True">
|
||||
<asp:ListItem>課程企劃</asp:ListItem>
|
||||
<asp:ListItem>場地遴選</asp:ListItem>
|
||||
<asp:ListItem>講師遴選</asp:ListItem>
|
||||
<asp:ListItem>教材遴選</asp:ListItem>
|
||||
<asp:ListItem>效益追蹤</asp:ListItem>
|
||||
</weblib:WDropDownList>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="caption">
|
||||
<asp:Label ID="Label10" runat="server" Text="第一關"></asp:Label>
|
||||
</td>
|
||||
<td>
|
||||
<weblib:WDropDownList ID="ddl主管1" runat="server" AutoPostBack="True">
|
||||
<asp:ListItem Value="Y">直接主管</asp:ListItem>
|
||||
<asp:ListItem Value="N">特定組織職務</asp:ListItem>
|
||||
</weblib:WDropDownList>
|
||||
</td>
|
||||
<td>
|
||||
<table style="width:100%;">
|
||||
<tr>
|
||||
<td class="caption">
|
||||
<asp:Label ID="Label16" runat="server" Text="組織類別"></asp:Label>
|
||||
</td>
|
||||
<td>
|
||||
<weblib:WDropDownList ID="ddl組織類別1" runat="server" AutoPostBack="True">
|
||||
</weblib:WDropDownList>
|
||||
<asp:ObjectDataSource ID="ds組織類別1" runat="server"></asp:ObjectDataSource>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="caption">
|
||||
<asp:Label ID="Label17" runat="server" Text="組織名稱"></asp:Label>
|
||||
</td>
|
||||
<td>
|
||||
<weblib:WDropDownList ID="ddl組織ID1" runat="server" AutoPostBack="True">
|
||||
</weblib:WDropDownList>
|
||||
<asp:ObjectDataSource ID="ds組織ID1" runat="server"></asp:ObjectDataSource>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="caption">
|
||||
<asp:Label ID="Label18" runat="server" Text="職務名稱"></asp:Label>
|
||||
</td>
|
||||
<td>
|
||||
<weblib:WDropDownList ID="ddl職務ID1" runat="server">
|
||||
</weblib:WDropDownList>
|
||||
<asp:ObjectDataSource ID="ds職務ID1" runat="server"></asp:ObjectDataSource>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="caption">
|
||||
<asp:Label ID="Label11" runat="server" Text="第二關"></asp:Label>
|
||||
</td>
|
||||
<td>
|
||||
<weblib:WDropDownList ID="ddl主管2" runat="server" AutoPostBack="True">
|
||||
<asp:ListItem Value="Y">直接主管</asp:ListItem>
|
||||
<asp:ListItem Value="N">特定組織職務</asp:ListItem>
|
||||
</weblib:WDropDownList>
|
||||
</td>
|
||||
<td>
|
||||
<table style="width:100%;">
|
||||
<tr>
|
||||
<td class="caption">
|
||||
<asp:Label ID="Label13" runat="server" Text="組織類別"></asp:Label>
|
||||
</td>
|
||||
<td>
|
||||
<weblib:WDropDownList ID="ddl組織類別2" runat="server" AutoPostBack="True">
|
||||
</weblib:WDropDownList>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="caption">
|
||||
<asp:Label ID="Label14" runat="server" Text="組織名稱"></asp:Label>
|
||||
</td>
|
||||
<td>
|
||||
<weblib:WDropDownList ID="ddl組織ID2" runat="server" AutoPostBack="True">
|
||||
</weblib:WDropDownList>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="caption">
|
||||
<asp:Label ID="Label15" runat="server" Text="職務名稱"></asp:Label>
|
||||
</td>
|
||||
<td>
|
||||
<weblib:WDropDownList ID="ddl職務ID2" runat="server">
|
||||
</weblib:WDropDownList>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="caption">
|
||||
<asp:Label ID="Label12" runat="server" Text="第三關"></asp:Label>
|
||||
</td>
|
||||
<td>
|
||||
<weblib:WDropDownList ID="ddl主管3" runat="server" AutoPostBack="True">
|
||||
<asp:ListItem Value="Y">直接主管</asp:ListItem>
|
||||
<asp:ListItem Value="N">特定組織職務</asp:ListItem>
|
||||
</weblib:WDropDownList>
|
||||
</td>
|
||||
<td>
|
||||
<table style="width:100%;">
|
||||
<tr>
|
||||
<td class="caption">
|
||||
<asp:Label ID="Label19" runat="server" Text="組織類別"></asp:Label>
|
||||
</td>
|
||||
<td>
|
||||
<weblib:WDropDownList ID="ddl組織類別3" runat="server" AutoPostBack="True">
|
||||
</weblib:WDropDownList>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="caption">
|
||||
<asp:Label ID="Label20" runat="server" Text="組織名稱"></asp:Label>
|
||||
</td>
|
||||
<td>
|
||||
<weblib:WDropDownList ID="ddl組織ID3" runat="server" AutoPostBack="True">
|
||||
</weblib:WDropDownList>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="caption">
|
||||
<asp:Label ID="Label21" runat="server" Text="職務名稱"></asp:Label>
|
||||
</td>
|
||||
<td>
|
||||
<weblib:WDropDownList ID="ddl職務ID3" runat="server">
|
||||
</weblib:WDropDownList>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</asp:Content>
|
||||
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using WebLib;
|
||||
|
||||
namespace Education.Forms.組織
|
||||
{
|
||||
public partial class 簽核關卡設定 : FormBase
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
+278
@@ -0,0 +1,278 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <自動產生>
|
||||
// 這段程式碼是由工具產生的。
|
||||
//
|
||||
// 變更這個檔案可能會導致不正確的行為,而且如果已重新產生
|
||||
// 程式碼,則會遺失變更。
|
||||
// </自動產生>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace Education.Forms.組織
|
||||
{
|
||||
|
||||
|
||||
public partial class 簽核關卡設定
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Label9 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label Label9;
|
||||
|
||||
/// <summary>
|
||||
/// ddl表單名稱 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::WebLib.WDropDownList ddl表單名稱;
|
||||
|
||||
/// <summary>
|
||||
/// Label10 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label Label10;
|
||||
|
||||
/// <summary>
|
||||
/// ddl主管1 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::WebLib.WDropDownList ddl主管1;
|
||||
|
||||
/// <summary>
|
||||
/// Label16 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label Label16;
|
||||
|
||||
/// <summary>
|
||||
/// ddl組織類別1 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::WebLib.WDropDownList ddl組織類別1;
|
||||
|
||||
/// <summary>
|
||||
/// ds組織類別1 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.ObjectDataSource ds組織類別1;
|
||||
|
||||
/// <summary>
|
||||
/// Label17 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label Label17;
|
||||
|
||||
/// <summary>
|
||||
/// ddl組織ID1 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::WebLib.WDropDownList ddl組織ID1;
|
||||
|
||||
/// <summary>
|
||||
/// ds組織ID1 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.ObjectDataSource ds組織ID1;
|
||||
|
||||
/// <summary>
|
||||
/// Label18 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label Label18;
|
||||
|
||||
/// <summary>
|
||||
/// ddl職務ID1 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::WebLib.WDropDownList ddl職務ID1;
|
||||
|
||||
/// <summary>
|
||||
/// ds職務ID1 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.ObjectDataSource ds職務ID1;
|
||||
|
||||
/// <summary>
|
||||
/// Label11 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label Label11;
|
||||
|
||||
/// <summary>
|
||||
/// ddl主管2 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::WebLib.WDropDownList ddl主管2;
|
||||
|
||||
/// <summary>
|
||||
/// Label13 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label Label13;
|
||||
|
||||
/// <summary>
|
||||
/// ddl組織類別2 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::WebLib.WDropDownList ddl組織類別2;
|
||||
|
||||
/// <summary>
|
||||
/// Label14 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label Label14;
|
||||
|
||||
/// <summary>
|
||||
/// ddl組織ID2 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::WebLib.WDropDownList ddl組織ID2;
|
||||
|
||||
/// <summary>
|
||||
/// Label15 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label Label15;
|
||||
|
||||
/// <summary>
|
||||
/// ddl職務ID2 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::WebLib.WDropDownList ddl職務ID2;
|
||||
|
||||
/// <summary>
|
||||
/// Label12 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label Label12;
|
||||
|
||||
/// <summary>
|
||||
/// ddl主管3 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::WebLib.WDropDownList ddl主管3;
|
||||
|
||||
/// <summary>
|
||||
/// Label19 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label Label19;
|
||||
|
||||
/// <summary>
|
||||
/// ddl組織類別3 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::WebLib.WDropDownList ddl組織類別3;
|
||||
|
||||
/// <summary>
|
||||
/// Label20 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label Label20;
|
||||
|
||||
/// <summary>
|
||||
/// ddl組織ID3 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::WebLib.WDropDownList ddl組織ID3;
|
||||
|
||||
/// <summary>
|
||||
/// Label21 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label Label21;
|
||||
|
||||
/// <summary>
|
||||
/// ddl職務ID3 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::WebLib.WDropDownList ddl職務ID3;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,176 @@
|
||||
<%@ Page Title="" Language="C#" MasterPageFile="~/Site2.Master" AutoEventWireup="true"
|
||||
CodeBehind="組織人員處理.aspx.cs" Inherits="Education.Forms.組織.組織人員處理" %>
|
||||
|
||||
<%@ Register Assembly="WebLib" Namespace="WebLib" TagPrefix="weblib" %>
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
|
||||
<asp:ObjectDataSource ID="dsGrid" runat="server" DataObjectTypeName="Education.組織人員"
|
||||
DeleteMethod="DeleteOne" OldValuesParameterFormatString="original_{0}" SelectMethod="Select組織"
|
||||
TypeName="Education.DAC_組織人員" UpdateMethod="UpdateOne" OnObjectCreating="dsGrid_ObjectCreating">
|
||||
<SelectParameters>
|
||||
<asp:ControlParameter ControlID="TV" Name="組織ID" PropertyName="SelectedValue" Type="Int32" />
|
||||
</SelectParameters>
|
||||
</asp:ObjectDataSource>
|
||||
<asp:ObjectDataSource ID="ds職務" runat="server" OldValuesParameterFormatString="original_{0}"
|
||||
OnObjectCreating="ds職務_ObjectCreating" SelectMethod="Select組織類別" TypeName="Education.DAC_職務">
|
||||
<SelectParameters>
|
||||
<asp:ControlParameter ControlID="ddl組織類別" Name="組織類別ID" PropertyName="SelectedValue"
|
||||
Type="Int32" />
|
||||
</SelectParameters>
|
||||
</asp:ObjectDataSource>
|
||||
<asp:ObjectDataSource ID="ds主管" runat="server" OldValuesParameterFormatString="original_{0}"
|
||||
SelectMethod="Select組織人員" TypeName="Education.DAC_組織人員">
|
||||
<SelectParameters>
|
||||
<asp:ControlParameter ControlID="TV" Name="組織ID" PropertyName="SelectedValue" Type="Int32" />
|
||||
</SelectParameters>
|
||||
</asp:ObjectDataSource>
|
||||
<table>
|
||||
<tr>
|
||||
<td class="caption">
|
||||
<asp:Label ID="Label9" runat="server" Text="組織類別"></asp:Label>
|
||||
</td>
|
||||
<td>
|
||||
<weblib:SQLDropDownList ID="ddl組織類別" runat="server" AddEmptyItem="False" LookupConfigName="組織類別"
|
||||
DataTextField="組織類別名稱" DataValueField="組織類別ID">
|
||||
</weblib:SQLDropDownList>
|
||||
</td>
|
||||
<td>
|
||||
<asp:LinkButton ID="btnSelect組織類別" runat="server" CssClass="button blue80" OnClick="btnSelect組織類別_Click">確定</asp:LinkButton>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<asp:Panel ID="pnl組織圖" runat="server" Visible="false">
|
||||
<table style="width: 100%">
|
||||
<tr>
|
||||
<td class="captionCenter" style="width: 400px;">
|
||||
<asp:Label ID="Label10" runat="server" Text="組織圖"></asp:Label>
|
||||
</td>
|
||||
<td class="captionCenter">
|
||||
<asp:Label ID="Label12" runat="server" Text="組織內的人員"></asp:Label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="vertical-align: top; width: 400px;">
|
||||
<div style="height: 500px; overflow-y: auto; border: 1px solid black;">
|
||||
<asp:TreeView ID="TV" runat="server" ImageSet="Arrows" SkipLinkText=""
|
||||
OnSelectedNodeChanged="TV_SelectedNodeChanged">
|
||||
<HoverNodeStyle Font-Underline="True" ForeColor="#5555DD" />
|
||||
<NodeStyle HorizontalPadding="5px" NodeSpacing="0px" VerticalPadding="0px" />
|
||||
<ParentNodeStyle Font-Bold="False" />
|
||||
<SelectedNodeStyle Font-Underline="True" ForeColor="#5555DD"
|
||||
HorizontalPadding="0px" VerticalPadding="0px" />
|
||||
</asp:TreeView>
|
||||
</div>
|
||||
</td>
|
||||
<td style="vertical-align: top;">
|
||||
<table style="width: 100%">
|
||||
<tr>
|
||||
<td class="caption" style="width: 70px;">
|
||||
<asp:Label ID="Label11" runat="server" Text="組織名稱"></asp:Label>
|
||||
</td>
|
||||
<td style="width: 300px" class="datadisplay">
|
||||
<asp:Label ID="lb組織名稱" runat="server"></asp:Label>
|
||||
</td>
|
||||
<td> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="caption" style="width: 70px;">
|
||||
<asp:Label ID="Label13" runat="server" Text="人員"></asp:Label>
|
||||
</td>
|
||||
<td colspan="2">
|
||||
<weblib:LookupTextBox ID="txt人員" runat="server" LookupConfigName="BPSN2" OutputControl="txt人員姓名"
|
||||
Text="" ValidationGroup="insert" />
|
||||
<asp:TextBox ID="txt人員姓名" runat="server" Text=""></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="rfv人員" runat="server" ControlToValidate="txt人員" Display="None"
|
||||
ErrorMessage="請輸入人員" ValidationGroup="insert" EnableClientScript="false"></asp:RequiredFieldValidator>
|
||||
<asp:CustomValidator ID="cv人員存在" runat="server" ControlToValidate="txt人員" Display="None"
|
||||
ErrorMessage="輸入的人員不存在" OnServerValidate="cv人員_ServerValidate" ValidationGroup="insert"
|
||||
EnableClientScript="false"></asp:CustomValidator>
|
||||
<asp:CustomValidator ID="cv人員重複" runat="server" ControlToValidate="txt人員" Display="None"
|
||||
ErrorMessage="輸入的人員已是此組織成員" OnServerValidate="cv人員重複_ServerValidate" ValidationGroup="insert"
|
||||
EnableClientScript="false"></asp:CustomValidator>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="caption" style="width: 70px;">
|
||||
<asp:Label ID="Label14" runat="server" Text="職務"></asp:Label>
|
||||
</td>
|
||||
<td colspan="2">
|
||||
<weblib:WDropDownList ID="ddl職務" runat="server" DataSourceID="ds職務" DataTextField="職務名稱"
|
||||
DataValueField="職務ID" ValidationGroup="insert" />
|
||||
<asp:RequiredFieldValidator ID="rfv職務" runat="server" ControlToValidate="ddl職務" Display="None"
|
||||
ErrorMessage="請選擇職務" ValidationGroup="insert" EnableClientScript="false"></asp:RequiredFieldValidator>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="caption" style="width: 70px;">
|
||||
<asp:Label ID="Label15" runat="server" Text="直接主管"></asp:Label>
|
||||
</td>
|
||||
<td colspan="2">
|
||||
<weblib:WDropDownList ID="ddl主管" runat="server" DataSourceID="ds主管" DataTextField="人員姓名"
|
||||
DataValueField="人員ID">
|
||||
</weblib:WDropDownList>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="3">
|
||||
<asp:LinkButton ID="btnInsert" runat="server" CssClass="button blue60"
|
||||
OnClick="btnInsert_Click" ValidationGroup="insert">新增</asp:LinkButton>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div style="margin-top: 5px; margin-bottom: 8px;">
|
||||
<asp:ValidationSummary ID="ValidationSummary1" runat="server"
|
||||
ValidationGroup="insert" CssClass="ErrorMessage" DisplayMode="List" />
|
||||
</div>
|
||||
<asp:GridView ID="GridView1" runat="server"
|
||||
AutoGenerateColumns="False" EnableModelValidation="True" DataKeyNames="組織ID,人員ID,DB_APPNO"
|
||||
DataSourceID="dsGrid" OnRowDeleted="GridView1_RowDeleted">
|
||||
<Columns>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="btnEdit" runat="server" CommandName="Edit" CssClass="button blue60">修改</asp:LinkButton>
|
||||
<asp:LinkButton ID="btnDelete" runat="server" CommandName="Delete" CssClass="button red60"
|
||||
OnClientClick="return confirm('是否刪除此筆資料?');">刪除</asp:LinkButton>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:LinkButton ID="btnUpdate" runat="server" CommandName="Update" CssClass="button green60">存檔</asp:LinkButton>
|
||||
<asp:LinkButton ID="btnCancel" runat="server" CommandName="Cancel" CssClass="button red60"
|
||||
CausesValidation="false" OnClientClick="return confirm('是否放棄修改?');">取消</asp:LinkButton>
|
||||
</EditItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="人員" SortExpression="人員ID">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="Label6" runat="server" Text='<%# Bind("人員ID") %>'></asp:Label>
|
||||
<asp:Label ID="Label1" runat="server" Text='<%# Get員工姓名(Eval("人員ID")) %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="職務" SortExpression="職務ID">
|
||||
<EditItemTemplate>
|
||||
<weblib:WDropDownList ID="ddl職務" runat="server" DataSourceID="ds職務" DataTextField="職務名稱"
|
||||
DataValueField="職務ID" SelectedValue='<%# Bind("職務ID") %>' />
|
||||
</EditItemTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="Label2" runat="server" Text='<%# Get職務名稱(Eval("職務ID")) %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="直接主管" SortExpression="直接主管ID">
|
||||
<EditItemTemplate>
|
||||
<weblib:WDropDownList ID="ddl主管" runat="server" DataSourceID="ds主管" DataTextField="人員姓名"
|
||||
DataValueField="人員ID"
|
||||
SelectedValue='<%# Bind("直接主管ID") %>'>
|
||||
</weblib:WDropDownList>
|
||||
</EditItemTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="Label5" runat="server" Text='<%# Bind("直接主管ID") %>'></asp:Label>
|
||||
<asp:Label ID="Label3" runat="server" Text='<%# Get員工姓名(Eval("直接主管ID")) %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</asp:Panel>
|
||||
</asp:Content>
|
||||
@@ -0,0 +1,115 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using WebLib;
|
||||
|
||||
namespace Education.Forms.組織
|
||||
{
|
||||
public partial class 組織人員處理 : FormBase
|
||||
{
|
||||
private int 組織類別Id;
|
||||
private DAC_組織人員 Dao組織人員;
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
FunctionName = "組織人員處理";
|
||||
Dao組織人員 = new DAC_組織人員(conn);
|
||||
|
||||
if (!IsPostBack)
|
||||
ddl組織類別.DataBind();
|
||||
else if (pnl組織圖.Visible)
|
||||
{
|
||||
GridView1.DataBind();
|
||||
}
|
||||
}
|
||||
|
||||
protected void btnSelect組織類別_Click(object sender, EventArgs e)
|
||||
{
|
||||
組織類別Id = DAC.GetInt32(ddl組織類別.SelectedValue);
|
||||
Dao組織圖.DrawTree(TV, 組織類別Id);
|
||||
pnl組織圖.Visible = true;
|
||||
TV.ExpandAll();
|
||||
|
||||
if (TV.Nodes.Count > 0)
|
||||
{
|
||||
TV.Nodes[0].Select();
|
||||
TV_SelectedNodeChanged(sender, e);
|
||||
}
|
||||
else
|
||||
{
|
||||
txt人員.Text = "";
|
||||
txt人員姓名.Text = "";
|
||||
lb組織名稱.Text = "";
|
||||
}
|
||||
}
|
||||
|
||||
protected void TV_SelectedNodeChanged(object sender, EventArgs e)
|
||||
{
|
||||
GridView1.DataBind();
|
||||
lb組織名稱.Text = TV.SelectedNode.Text;
|
||||
//txt人員.Focus();
|
||||
}
|
||||
|
||||
protected void btnInsert_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsValid)
|
||||
return;
|
||||
|
||||
組織人員 newValue = new 組織人員();
|
||||
newValue.組織ID = DAC.GetInt32(TV.SelectedValue);
|
||||
newValue.人員ID = txt人員.Text;
|
||||
newValue.職務ID = DAC.GetInt32(ddl職務.SelectedValue);
|
||||
newValue.直接主管ID = ddl主管.SelectedValue;
|
||||
newValue.DB_CRUSR = UserId;
|
||||
|
||||
Dao組織人員.InsertOne(newValue);
|
||||
GridView1.DataBind();
|
||||
ddl主管.DataBind();
|
||||
//txt人員.Focus();
|
||||
}
|
||||
|
||||
protected void dsGrid_ObjectCreating(object sender, ObjectDataSourceEventArgs e)
|
||||
{
|
||||
e.ObjectInstance = Dao組織人員;
|
||||
}
|
||||
|
||||
protected void ds職務_ObjectCreating(object sender, ObjectDataSourceEventArgs e)
|
||||
{
|
||||
e.ObjectInstance = Dao職務;
|
||||
}
|
||||
|
||||
protected void cv人員_ServerValidate(object source, ServerValidateEventArgs args)
|
||||
{
|
||||
// 檢查人員是否存在
|
||||
args.IsValid = Get員工姓名(args.Value).Trim().Length > 0;
|
||||
}
|
||||
|
||||
protected void cv主管_ServerValidate(object source, ServerValidateEventArgs args)
|
||||
{
|
||||
// 檢查人員是否存在
|
||||
args.IsValid = Get員工姓名(args.Value).Trim().Length > 0;
|
||||
}
|
||||
|
||||
protected void cv人員重複_ServerValidate(object source, ServerValidateEventArgs args)
|
||||
{
|
||||
// 檢查人員是否重複
|
||||
args.IsValid = !Dao組織人員.IsDuplicate(DAC.GetInt32(TV.SelectedValue), args.Value);
|
||||
}
|
||||
|
||||
protected void GridView1_RowDeleted(object sender, GridViewDeletedEventArgs e)
|
||||
{
|
||||
ddl主管.DataBind();
|
||||
|
||||
// 20181023 檢查部門主管是否在部門人員中,若無則清除部門的主管欄位
|
||||
組織圖 dept = Dao組織圖.SelectOne(DAC.GetInt32(TV.SelectedNode.Value)).FirstOrDefault();
|
||||
if (dept != null && ddl主管.Items.FindByValue(dept.部門主管) == null)
|
||||
{
|
||||
dept.部門主管 = "";
|
||||
Dao組織圖.UpdateOne(dept);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+251
@@ -0,0 +1,251 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <自動產生>
|
||||
// 這段程式碼是由工具產生的。
|
||||
//
|
||||
// 變更這個檔案可能會導致不正確的行為,而且如果已重新產生
|
||||
// 程式碼,則會遺失變更。
|
||||
// </自動產生>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace Education.Forms.組織
|
||||
{
|
||||
|
||||
|
||||
public partial class 組織人員處理
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// dsGrid 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.ObjectDataSource dsGrid;
|
||||
|
||||
/// <summary>
|
||||
/// ds職務 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.ObjectDataSource ds職務;
|
||||
|
||||
/// <summary>
|
||||
/// ds主管 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.ObjectDataSource ds主管;
|
||||
|
||||
/// <summary>
|
||||
/// Label9 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label Label9;
|
||||
|
||||
/// <summary>
|
||||
/// ddl組織類別 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::WebLib.SQLDropDownList ddl組織類別;
|
||||
|
||||
/// <summary>
|
||||
/// btnSelect組織類別 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.LinkButton btnSelect組織類別;
|
||||
|
||||
/// <summary>
|
||||
/// pnl組織圖 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Panel pnl組織圖;
|
||||
|
||||
/// <summary>
|
||||
/// Label10 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label Label10;
|
||||
|
||||
/// <summary>
|
||||
/// Label12 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label Label12;
|
||||
|
||||
/// <summary>
|
||||
/// TV 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.TreeView TV;
|
||||
|
||||
/// <summary>
|
||||
/// Label11 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label Label11;
|
||||
|
||||
/// <summary>
|
||||
/// lb組織名稱 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lb組織名稱;
|
||||
|
||||
/// <summary>
|
||||
/// Label13 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label Label13;
|
||||
|
||||
/// <summary>
|
||||
/// txt人員 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::WebLib.LookupTextBox txt人員;
|
||||
|
||||
/// <summary>
|
||||
/// txt人員姓名 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.TextBox txt人員姓名;
|
||||
|
||||
/// <summary>
|
||||
/// rfv人員 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.RequiredFieldValidator rfv人員;
|
||||
|
||||
/// <summary>
|
||||
/// cv人員存在 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.CustomValidator cv人員存在;
|
||||
|
||||
/// <summary>
|
||||
/// cv人員重複 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.CustomValidator cv人員重複;
|
||||
|
||||
/// <summary>
|
||||
/// Label14 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label Label14;
|
||||
|
||||
/// <summary>
|
||||
/// ddl職務 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::WebLib.WDropDownList ddl職務;
|
||||
|
||||
/// <summary>
|
||||
/// rfv職務 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.RequiredFieldValidator rfv職務;
|
||||
|
||||
/// <summary>
|
||||
/// Label15 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label Label15;
|
||||
|
||||
/// <summary>
|
||||
/// ddl主管 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::WebLib.WDropDownList ddl主管;
|
||||
|
||||
/// <summary>
|
||||
/// btnInsert 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.LinkButton btnInsert;
|
||||
|
||||
/// <summary>
|
||||
/// ValidationSummary1 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.ValidationSummary ValidationSummary1;
|
||||
|
||||
/// <summary>
|
||||
/// GridView1 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.GridView GridView1;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
<%@ Page Title="" Language="C#" MasterPageFile="~/Site2.Master" AutoEventWireup="true" CodeBehind="組織圖處理.aspx.cs" Inherits="Education.Forms.組織.組織圖處理" %>
|
||||
|
||||
<%@ Register Assembly="WebLib" Namespace="WebLib" TagPrefix="weblib" %>
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
|
||||
<table>
|
||||
<tr>
|
||||
<td class="caption">
|
||||
<asp:Label ID="Label9" runat="server" Text="組織類別"></asp:Label>
|
||||
</td>
|
||||
<td>
|
||||
<weblib:SQLDropDownList ID="ddl組織類別" runat="server" AddEmptyItem="False" LookupConfigName="組織類別" DataTextField="組織類別名稱" DataValueField="組織類別ID">
|
||||
</weblib:SQLDropDownList>
|
||||
</td>
|
||||
<td>
|
||||
<asp:LinkButton ID="btnSelect組織類別" runat="server" CssClass="button blue80" OnClick="btnSelect組織類別_Click">確定</asp:LinkButton>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<asp:Panel runat="server" ID="pnl組織圖" Visible="false">
|
||||
<table>
|
||||
<tr>
|
||||
<td class="captionCenter" colspan="2">
|
||||
<asp:Label ID="Label10" runat="server" Text="組織圖"></asp:Label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="vertical-align: top; width: 400px;">
|
||||
<div style="height: 500px; overflow-y: auto; border: 1px solid black;">
|
||||
<asp:TreeView ID="TV" runat="server" ImageSet="Arrows" SkipLinkText="" OnSelectedNodeChanged="TV_SelectedNodeChanged">
|
||||
<HoverNodeStyle Font-Underline="True" ForeColor="#5555DD" />
|
||||
<NodeStyle HorizontalPadding="5px" NodeSpacing="0px" VerticalPadding="0px" />
|
||||
<ParentNodeStyle Font-Bold="False" />
|
||||
<SelectedNodeStyle Font-Underline="True" ForeColor="#5555DD" HorizontalPadding="0px" VerticalPadding="0px" />
|
||||
</asp:TreeView>
|
||||
</div>
|
||||
</td>
|
||||
<td style="vertical-align: top;">
|
||||
<asp:LinkButton ID="btnAddRoot" runat="server" CssClass="button blue80" OnClick="btnAddRoot_Click">加入根</asp:LinkButton>
|
||||
<asp:LinkButton ID="btnAdd" runat="server" CssClass="button blue80" OnClick="btnAdd_Click">加入同層</asp:LinkButton>
|
||||
<asp:LinkButton ID="btnAddDown" runat="server" CssClass="button blue80" OnClick="btnAddDown_Click">加入下層</asp:LinkButton>
|
||||
<asp:LinkButton ID="btnUpdate" runat="server" CssClass="button green80" OnClick="btnUpdate_Click">修改</asp:LinkButton>
|
||||
<asp:LinkButton ID="btnDelete" runat="server" CssClass="button red80" OnClick="btnDelete_Click">刪除</asp:LinkButton>
|
||||
<table>
|
||||
<tr>
|
||||
<td class="caption" style="width: 70px;">
|
||||
<asp:Label ID="Label11" runat="server" Text="組織名稱"></asp:Label>
|
||||
</td>
|
||||
<td style="width: 300px">
|
||||
<asp:TextBox ID="txtNodeText" runat="server" CssClass="inputFull"></asp:TextBox>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="caption" style="width: 70px;">
|
||||
<asp:Label ID="Label15" runat="server" Text="部門主管"></asp:Label>
|
||||
</td>
|
||||
<td style="width: 300px">
|
||||
<weblib:WDropDownList ID="ddl主管" runat="server" DataSourceID="ds主管" DataTextField="人員姓名" DataValueField="人員ID">
|
||||
</weblib:WDropDownList>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<asp:Label ID="lbError" runat="server" Text="" CssClass="ErrorMessage"></asp:Label>
|
||||
<asp:ObjectDataSource ID="ds主管" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="Select組織人員" TypeName="Education.DAC_組織人員">
|
||||
<SelectParameters>
|
||||
<asp:ControlParameter ControlID="TV" Name="組織ID" PropertyName="SelectedValue" Type="Int32" />
|
||||
</SelectParameters>
|
||||
</asp:ObjectDataSource>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="vertical-align: top; width: 400px;" colspan="2">
|
||||
<asp:LinkButton ID="btnUp" runat="server" CssClass="button gray60" OnClick="btnUp_Click">往上</asp:LinkButton>
|
||||
<asp:LinkButton ID="btnDown" runat="server" CssClass="button gray60" OnClick="btnDown_Click">往下</asp:LinkButton>
|
||||
<asp:LinkButton ID="btnUpLevel" runat="server" CssClass="button gray60" OnClick="btnUpLevel_Click">往上層</asp:LinkButton>
|
||||
<asp:LinkButton ID="btnDownLevel" runat="server" CssClass="button gray60" OnClick="btnDownLevel_Click">往下層</asp:LinkButton>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</asp:Panel>
|
||||
</asp:Content>
|
||||
@@ -0,0 +1,318 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using WebLib;
|
||||
|
||||
namespace Education.Forms.組織
|
||||
{
|
||||
public partial class 組織圖處理 : FormBase
|
||||
{
|
||||
private int 組織類別Id;
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
FunctionName = "組織圖處理";
|
||||
|
||||
if (!IsPostBack)
|
||||
ddl組織類別.DataBind();
|
||||
}
|
||||
|
||||
protected bool CheckInput()
|
||||
{
|
||||
if (txtNodeText.Text.Trim().Length == 0)
|
||||
{
|
||||
lbError.Text = "請輸入組織名稱";
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
lbError.Text = "";
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
protected 組織圖 New組織圖Item(int 上層ID)
|
||||
{
|
||||
組織圖 result = new 組織圖();
|
||||
result.上層ID = 上層ID;
|
||||
result.組織類別ID = DAC.GetInt32(ddl組織類別.SelectedValue);
|
||||
result.組織名稱 = txtNodeText.Text;
|
||||
result.DB_CRUSR = UserId;
|
||||
result.部門主管 = ddl主管.SelectedValue;
|
||||
result.組織ID = Dao組織圖.InsertOne(result);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
protected void btnAddRoot_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (!CheckInput())
|
||||
return;
|
||||
|
||||
組織圖 newItem = New組織圖Item(0);
|
||||
TreeNode newNode = new TreeNode(txtNodeText.Text);
|
||||
newNode.Value = newItem.組織ID.ToString();
|
||||
|
||||
TV.Nodes.Add(newNode);
|
||||
newNode.Selected = true;
|
||||
}
|
||||
|
||||
protected void btnAdd_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (!CheckInput())
|
||||
return;
|
||||
|
||||
if (TV.SelectedNode == null || TV.SelectedNode.Parent == null)
|
||||
btnAddRoot_Click(sender, e);
|
||||
else
|
||||
{
|
||||
組織圖 newItem = New組織圖Item(DAC.GetInt32(TV.SelectedNode.Parent.Value));
|
||||
TreeNode newNode = new TreeNode(txtNodeText.Text);
|
||||
newNode.Value = newItem.組織ID.ToString();
|
||||
|
||||
TV.SelectedNode.Parent.ChildNodes.Add(newNode);
|
||||
newNode.Selected = true;
|
||||
}
|
||||
}
|
||||
|
||||
protected void btnAddDown_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (!CheckInput())
|
||||
return;
|
||||
|
||||
if (TV.SelectedNode == null)
|
||||
btnAddRoot_Click(sender, e);
|
||||
else
|
||||
{
|
||||
組織圖 newItem = New組織圖Item(DAC.GetInt32(TV.SelectedNode.Value));
|
||||
TreeNode newNode = new TreeNode(txtNodeText.Text);
|
||||
newNode.Value = newItem.組織ID.ToString();
|
||||
|
||||
TV.SelectedNode.ChildNodes.Add(newNode);
|
||||
TV.SelectedNode.Expand();
|
||||
newNode.Selected = true;
|
||||
}
|
||||
}
|
||||
|
||||
protected void btnUpdate_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (TV.SelectedNode == null)
|
||||
return;
|
||||
|
||||
TV.SelectedNode.Text = txtNodeText.Text;
|
||||
|
||||
組織圖List values = Dao組織圖.SelectOne(DAC.GetInt32(TV.SelectedNode.Value));
|
||||
if (values.Count == 0)
|
||||
return;
|
||||
values[0].組織名稱 = txtNodeText.Text;
|
||||
values[0].部門主管 = ddl主管.SelectedValue;
|
||||
values[0].DB_TRUSR = UserId;
|
||||
Dao組織圖.UpdateOne(values[0]);
|
||||
}
|
||||
|
||||
protected void btnDelete_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (TV.SelectedNode == null)
|
||||
return;
|
||||
|
||||
if (TV.SelectedNode.ChildNodes.Count > 0)
|
||||
return;
|
||||
|
||||
int delId = DAC.GetInt32(TV.SelectedNode.Value);
|
||||
組織圖List values = Dao組織圖.SelectOne(DAC.GetInt32(TV.SelectedNode.Value));
|
||||
if (values.Count == 0)
|
||||
return;
|
||||
Dao組織圖.DeleteOne(values[0]);
|
||||
|
||||
if (TV.SelectedNode.Parent == null)
|
||||
{
|
||||
TV.Nodes.Remove(TV.SelectedNode);
|
||||
}
|
||||
else
|
||||
{
|
||||
TV.SelectedNode.Parent.ChildNodes.Remove(TV.SelectedNode);
|
||||
}
|
||||
}
|
||||
|
||||
protected void Update排序(TreeNodeCollection nodes)
|
||||
{
|
||||
for (int i = 0; i < nodes.Count; i++)
|
||||
{
|
||||
Dao組織圖.Update排序(DAC.GetInt32(nodes[i].Value), i + 1, UserId);
|
||||
}
|
||||
}
|
||||
|
||||
protected void btnUp_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (TV.SelectedNode == null)
|
||||
return;
|
||||
|
||||
if (TV.SelectedNode.Parent == null)
|
||||
{
|
||||
TreeNode node = TV.SelectedNode;
|
||||
int thisIndex = TV.Nodes.IndexOf(node);
|
||||
|
||||
if (thisIndex == 0)
|
||||
return;
|
||||
|
||||
TV.Nodes.Remove(node);
|
||||
TV.Nodes.AddAt(thisIndex - 1, node);
|
||||
node.Selected = true;
|
||||
|
||||
Update排序(TV.Nodes);
|
||||
}
|
||||
else
|
||||
{
|
||||
TreeNode node = TV.SelectedNode;
|
||||
TreeNode parent = node.Parent;
|
||||
int thisIndex = parent.ChildNodes.IndexOf(node);
|
||||
|
||||
if (thisIndex == 0)
|
||||
return;
|
||||
|
||||
parent.ChildNodes.Remove(node);
|
||||
parent.ChildNodes.AddAt(thisIndex - 1, node);
|
||||
node.Selected = true;
|
||||
|
||||
Update排序(parent.ChildNodes);
|
||||
}
|
||||
}
|
||||
|
||||
protected void btnDown_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (TV.SelectedNode == null)
|
||||
return;
|
||||
|
||||
if (TV.SelectedNode.Parent == null)
|
||||
{
|
||||
TreeNode node = TV.SelectedNode;
|
||||
int thisIndex = TV.Nodes.IndexOf(node);
|
||||
|
||||
if (thisIndex == TV.Nodes.Count - 1)
|
||||
return;
|
||||
|
||||
TV.Nodes.Remove(node);
|
||||
TV.Nodes.AddAt(thisIndex + 1, node);
|
||||
node.Selected = true;
|
||||
|
||||
Update排序(TV.Nodes);
|
||||
}
|
||||
else
|
||||
{
|
||||
TreeNode node = TV.SelectedNode;
|
||||
TreeNode parent = node.Parent;
|
||||
int thisIndex = parent.ChildNodes.IndexOf(node);
|
||||
|
||||
if (thisIndex == parent.ChildNodes.Count - 1)
|
||||
return;
|
||||
|
||||
parent.ChildNodes.Remove(node);
|
||||
parent.ChildNodes.AddAt(thisIndex + 1, node);
|
||||
node.Selected = true;
|
||||
|
||||
Update排序(parent.ChildNodes);
|
||||
}
|
||||
}
|
||||
|
||||
protected void btnUpLevel_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (TV.SelectedNode == null)
|
||||
return;
|
||||
|
||||
if (TV.SelectedNode.Parent == null)
|
||||
return;
|
||||
|
||||
TreeNode node = TV.SelectedNode;
|
||||
TreeNode parent = node.Parent;
|
||||
TreeNode parentParent = node.Parent.Parent;
|
||||
|
||||
if (parentParent == null)
|
||||
{
|
||||
parent.ChildNodes.Remove(node);
|
||||
TV.Nodes.AddAt(TV.Nodes.IndexOf(parent) + 1, node);
|
||||
node.Selected = true;
|
||||
|
||||
Dao組織圖.Update上層ID(DAC.GetInt32(node.Value), 0, UserId);
|
||||
Update排序(TV.Nodes);
|
||||
}
|
||||
else
|
||||
{
|
||||
parent.ChildNodes.Remove(node);
|
||||
parentParent.ChildNodes.AddAt(parentParent.ChildNodes.IndexOf(parent) + 1, node);
|
||||
node.Selected = true;
|
||||
|
||||
Dao組織圖.Update上層ID(DAC.GetInt32(node.Value), DAC.GetInt32(parentParent.Value), UserId);
|
||||
Update排序(parentParent.ChildNodes);
|
||||
}
|
||||
}
|
||||
|
||||
protected void btnDownLevel_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (TV.SelectedNode == null)
|
||||
return;
|
||||
|
||||
TreeNode node = TV.SelectedNode;
|
||||
TreeNode parent = node.Parent;
|
||||
|
||||
if (parent == null)
|
||||
{
|
||||
int thisIndex = TV.Nodes.IndexOf(node);
|
||||
if (thisIndex == 0)
|
||||
return;
|
||||
TV.Nodes.Remove(node);
|
||||
TV.Nodes[thisIndex - 1].ChildNodes.Add(node);
|
||||
TV.Nodes[thisIndex - 1].Expand();
|
||||
node.Selected = true;
|
||||
|
||||
Dao組織圖.Update上層ID(DAC.GetInt32(node.Value), DAC.GetInt32(TV.Nodes[thisIndex - 1].Value), UserId);
|
||||
Update排序(TV.Nodes[thisIndex - 1].ChildNodes);
|
||||
}
|
||||
else
|
||||
{
|
||||
int thisIndex = parent.ChildNodes.IndexOf(node);
|
||||
if (thisIndex == 0)
|
||||
return;
|
||||
parent.ChildNodes.Remove(node);
|
||||
parent.ChildNodes[thisIndex - 1].ChildNodes.Add(node);
|
||||
parent.ChildNodes[thisIndex - 1].Expand();
|
||||
node.Selected = true;
|
||||
|
||||
Dao組織圖.Update上層ID(DAC.GetInt32(node.Value), DAC.GetInt32(parent.ChildNodes[thisIndex - 1].Value), UserId);
|
||||
Update排序(parent.ChildNodes[thisIndex - 1].ChildNodes);
|
||||
}
|
||||
}
|
||||
|
||||
protected void btnSelect組織類別_Click(object sender, EventArgs e)
|
||||
{
|
||||
組織類別Id = DAC.GetInt32(ddl組織類別.SelectedValue);
|
||||
Dao組織圖.DrawTree(TV, 組織類別Id);
|
||||
pnl組織圖.Visible = true;
|
||||
TV.ExpandAll();
|
||||
|
||||
if (TV.Nodes.Count > 0)
|
||||
{
|
||||
TV.Nodes[0].Select();
|
||||
TV_SelectedNodeChanged(sender, e);
|
||||
}
|
||||
}
|
||||
|
||||
protected void TV_SelectedNodeChanged(object sender, EventArgs e)
|
||||
{
|
||||
ddl主管.DataBind();
|
||||
if (TV.SelectedNode == null)
|
||||
{
|
||||
txtNodeText.Text = "";
|
||||
return;
|
||||
}
|
||||
|
||||
txtNodeText.Text = TV.SelectedNode.Text;
|
||||
// 20181023 檢查部門主管是否在部門人員中,若有才設定 dropdown 的值
|
||||
組織圖 dept = Dao組織圖.SelectOne(DAC.GetInt32(TV.SelectedNode.Value)).FirstOrDefault();
|
||||
if (dept != null && ddl主管.Items.FindByValue(dept.部門主管) != null)
|
||||
ddl主管.SelectedValue = dept.部門主管;
|
||||
}
|
||||
}
|
||||
}
|
||||
+206
@@ -0,0 +1,206 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <自動產生>
|
||||
// 這段程式碼是由工具產生的。
|
||||
//
|
||||
// 變更這個檔案可能會導致不正確的行為,而且如果已重新產生
|
||||
// 程式碼,則會遺失變更。
|
||||
// </自動產生>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace Education.Forms.組織
|
||||
{
|
||||
|
||||
|
||||
public partial class 組織圖處理
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Label9 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label Label9;
|
||||
|
||||
/// <summary>
|
||||
/// ddl組織類別 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::WebLib.SQLDropDownList ddl組織類別;
|
||||
|
||||
/// <summary>
|
||||
/// btnSelect組織類別 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.LinkButton btnSelect組織類別;
|
||||
|
||||
/// <summary>
|
||||
/// pnl組織圖 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Panel pnl組織圖;
|
||||
|
||||
/// <summary>
|
||||
/// Label10 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label Label10;
|
||||
|
||||
/// <summary>
|
||||
/// TV 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.TreeView TV;
|
||||
|
||||
/// <summary>
|
||||
/// btnAddRoot 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.LinkButton btnAddRoot;
|
||||
|
||||
/// <summary>
|
||||
/// btnAdd 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.LinkButton btnAdd;
|
||||
|
||||
/// <summary>
|
||||
/// btnAddDown 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.LinkButton btnAddDown;
|
||||
|
||||
/// <summary>
|
||||
/// btnUpdate 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.LinkButton btnUpdate;
|
||||
|
||||
/// <summary>
|
||||
/// btnDelete 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.LinkButton btnDelete;
|
||||
|
||||
/// <summary>
|
||||
/// Label11 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label Label11;
|
||||
|
||||
/// <summary>
|
||||
/// txtNodeText 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.TextBox txtNodeText;
|
||||
|
||||
/// <summary>
|
||||
/// Label15 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label Label15;
|
||||
|
||||
/// <summary>
|
||||
/// ddl主管 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::WebLib.WDropDownList ddl主管;
|
||||
|
||||
/// <summary>
|
||||
/// lbError 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lbError;
|
||||
|
||||
/// <summary>
|
||||
/// ds主管 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.ObjectDataSource ds主管;
|
||||
|
||||
/// <summary>
|
||||
/// btnUp 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.LinkButton btnUp;
|
||||
|
||||
/// <summary>
|
||||
/// btnDown 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.LinkButton btnDown;
|
||||
|
||||
/// <summary>
|
||||
/// btnUpLevel 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.LinkButton btnUpLevel;
|
||||
|
||||
/// <summary>
|
||||
/// btnDownLevel 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.LinkButton btnDownLevel;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
<%@ Page Title="" Language="C#" MasterPageFile="~/Site2.Master" AutoEventWireup="true"
|
||||
CodeBehind="組織類別處理.aspx.cs" Inherits="Education.Forms.組織.組織類別處理" %>
|
||||
|
||||
<%@ Register Assembly="WebLib" Namespace="WebLib" TagPrefix="weblib" %>
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
|
||||
<asp:ObjectDataSource ID="dsGrid" runat="server" DataObjectTypeName="Education.組織類別"
|
||||
DeleteMethod="DeleteOne" OldValuesParameterFormatString="original_{0}" OnObjectCreating="dsGrid_ObjectCreating"
|
||||
SelectMethod="SelectAll" TypeName="Education.DAC_組織類別" UpdateMethod="UpdateOne">
|
||||
</asp:ObjectDataSource>
|
||||
<table border="1" class="fixedwithborder" style="border-bottom: none;">
|
||||
<tr>
|
||||
<th class="" style="width: 140px;"> </th>
|
||||
<th style="width: 90px;">組織類別ID</th>
|
||||
<th style="width: 450px;">組織類別名稱</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="datainput" style="text-align: left; border-bottom: none">
|
||||
<asp:LinkButton runat="server" ID="btnInsert" Text="新增" CssClass="button blue60"
|
||||
ValidationGroup="insert" OnClick="btnInsert_Click"></asp:LinkButton>
|
||||
</td>
|
||||
<td class="datainput" style="text-align: center; border-bottom: none">(自動編號)</td>
|
||||
<td class="datainput" style="text-align: left; border-bottom: none">
|
||||
<asp:TextBox ID="txt組織類別名稱" runat="server" Text="" MaxLength="50" CssClass="inputFull"
|
||||
ValidationGroup="insert"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator runat="server" ID="rfv組織類別名稱" ControlToValidate="txt組織類別名稱"
|
||||
ErrorMessage="請輸入" CssClass="ErrorMessage" Display="Dynamic" ValidationGroup="insert" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<asp:GridView ID="GridView1" runat="server" DataKeyNames="組織類別ID,DB_APPNO"
|
||||
AutoGenerateColumns="False" EnableModelValidation="True" AllowPaging="True"
|
||||
ShowHeader="False" DataSourceID="dsGrid">
|
||||
<Columns>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton runat="server" ID="btnEdit" Text="更正" CommandName="Edit" CssClass="button green60"></asp:LinkButton>
|
||||
<asp:LinkButton runat="server" ID="btnDelete" Text="刪除" CommandName="Delete" CssClass="button red60"
|
||||
OnClientClick="javascript:return confirm('是否確定刪除此筆資料?');" CausesValidation="false"></asp:LinkButton>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:LinkButton runat="server" ID="btnSave" Text="存檔" CommandName="Update" CssClass="button blue60"></asp:LinkButton>
|
||||
<asp:LinkButton runat="server" ID="btnCancel" Text="取消" CommandName="Cancel" CssClass="button red60"
|
||||
OnClientClick="javascript:return confirm('是否確定取消更正?');" CausesValidation="false"></asp:LinkButton>
|
||||
</EditItemTemplate>
|
||||
<HeaderStyle Width="140px" />
|
||||
<ItemStyle Width="140px" />
|
||||
</asp:TemplateField>
|
||||
<asp:BoundField DataField="組織類別ID" HeaderText="組織類別ID" SortExpression="組織類別ID" ReadOnly="true">
|
||||
<ItemStyle HorizontalAlign="Center" />
|
||||
<HeaderStyle Width="90px" />
|
||||
<ItemStyle Width="90px" />
|
||||
</asp:BoundField>
|
||||
<asp:TemplateField HeaderText="組織類別名稱" SortExpression="組織類別名稱">
|
||||
<EditItemTemplate>
|
||||
<asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("組織類別名稱") %>' CssClass="inputFull"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator runat="server" ID="rfv組織類別名稱" ControlToValidate="TextBox1"
|
||||
ErrorMessage="請輸入" CssClass="ErrorMessage" Display="Dynamic" />
|
||||
</EditItemTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="Label1" runat="server" Text='<%# Bind("組織類別名稱") %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
<HeaderStyle Width="450px" />
|
||||
<ItemStyle Width="450px" />
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
<PagerTemplate>
|
||||
<weblib:GridViewPager ID="GridViewPager1" runat="server" />
|
||||
</PagerTemplate>
|
||||
</asp:GridView>
|
||||
</asp:Content>
|
||||
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using WebLib;
|
||||
|
||||
namespace Education.Forms.組織
|
||||
{
|
||||
public partial class 組織類別處理 : FormBase
|
||||
{
|
||||
private DAC_組織類別 Dao組織類別;
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
FunctionName = "組織類別設定";
|
||||
Dao組織類別 = new DAC_組織類別(conn);
|
||||
|
||||
if (IsPostBack)
|
||||
GridView1.DataBind();
|
||||
}
|
||||
|
||||
protected void dsGrid_ObjectCreating(object sender, ObjectDataSourceEventArgs e)
|
||||
{
|
||||
e.ObjectInstance = Dao組織類別;
|
||||
}
|
||||
|
||||
protected void btnInsert_Click(object sender, EventArgs e)
|
||||
{
|
||||
組織類別 newItem = new 組織類別();
|
||||
newItem.組織類別名稱 = txt組織類別名稱.Text;
|
||||
newItem.DB_CRUSR = UserId;
|
||||
Dao組織類別.InsertOne(newItem);
|
||||
GridView1.DataBind();
|
||||
}
|
||||
}
|
||||
}
|
||||
+62
@@ -0,0 +1,62 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <自動產生>
|
||||
// 這段程式碼是由工具產生的。
|
||||
//
|
||||
// 變更這個檔案可能會導致不正確的行為,而且如果已重新產生
|
||||
// 程式碼,則會遺失變更。
|
||||
// </自動產生>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace Education.Forms.組織
|
||||
{
|
||||
|
||||
|
||||
public partial class 組織類別處理
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// dsGrid 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.ObjectDataSource dsGrid;
|
||||
|
||||
/// <summary>
|
||||
/// btnInsert 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.LinkButton btnInsert;
|
||||
|
||||
/// <summary>
|
||||
/// txt組織類別名稱 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.TextBox txt組織類別名稱;
|
||||
|
||||
/// <summary>
|
||||
/// rfv組織類別名稱 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.RequiredFieldValidator rfv組織類別名稱;
|
||||
|
||||
/// <summary>
|
||||
/// GridView1 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.GridView GridView1;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
<%@ Page Title="" Language="C#" MasterPageFile="~/Site2.Master" AutoEventWireup="true"
|
||||
CodeBehind="職務類別處理.aspx.cs" Inherits="Education.Forms.組織.職務類別處理" %>
|
||||
|
||||
<%@ Register Assembly="WebLib" Namespace="WebLib" TagPrefix="weblib" %>
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
|
||||
<asp:ObjectDataSource ID="dsGrid" runat="server" DataObjectTypeName="Education.職務"
|
||||
DeleteMethod="DeleteOne" OldValuesParameterFormatString="original_{0}" SelectMethod="SelectAll"
|
||||
TypeName="Education.DAC_職務" UpdateMethod="UpdateOne" OnObjectCreating="dsGrid_ObjectCreating">
|
||||
</asp:ObjectDataSource>
|
||||
<table border="1" class="fixedwithborder" style="border-bottom: none;">
|
||||
<tr>
|
||||
<th style="width: 140px;"> </th>
|
||||
<th style="width: 90px;">職務ID</th>
|
||||
<th style="width: 300px;">職務名稱</th>
|
||||
<th style="width: 300px;">組織類別</th>
|
||||
<th style="width: 80px;">主管</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="datainput" style="text-align: left; border-bottom: none">
|
||||
<asp:LinkButton runat="server" ID="btnInsert" Text="新增" CssClass="button blue60"
|
||||
ValidationGroup="insert" OnClick="btnInsert_Click"></asp:LinkButton>
|
||||
</td>
|
||||
<td class="datainput" style="text-align: left; border-bottom: none">(自動編號)</td>
|
||||
<td class="datainput" style="text-align: left; border-bottom: none">
|
||||
<asp:TextBox ID="txt職務名稱" runat="server" Text="" MaxLength="50" CssClass="inputFull"
|
||||
ValidationGroup="insert"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator runat="server" ID="rfv職務名稱" ControlToValidate="txt職務名稱"
|
||||
ErrorMessage="請輸入" CssClass="ErrorMessage" Display="Dynamic" ValidationGroup="insert" />
|
||||
</td>
|
||||
<td class="datainput" style="text-align: left; border-bottom: none">
|
||||
<weblib:SQLDropDownList ID="ddl組織類別" runat="server" LookupConfigName="組織類別"
|
||||
AddEmptyItem="False" AdditionalWhere="" EmptyItemText="(請選擇)" OrderBy="" ValidationGroup="insert"
|
||||
CssClass="inputFull" DataTextField="組織類別名稱" DataValueField="組織類別ID">
|
||||
</weblib:SQLDropDownList>
|
||||
</td>
|
||||
<td class="datainput" style="text-align: left; border-bottom: none">
|
||||
<weblib:ValueCheckBox ID="cb主管" runat="server" CheckedValue="Y" UncheckedValue="N"
|
||||
ValidationGroup="insert" Text="主管" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<asp:GridView ID="GridView1" runat="server" ShowHeader="False"
|
||||
AutoGenerateColumns="False" EnableModelValidation="True"
|
||||
DataKeyNames="職務ID,DB_APPNO" DataSourceID="dsGrid">
|
||||
<Columns>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton runat="server" ID="btnEdit" Text="更正" CommandName="Edit" CssClass="button green60"></asp:LinkButton>
|
||||
<asp:LinkButton runat="server" ID="btnDelete" Text="刪除" CommandName="Delete" CssClass="button red60"
|
||||
OnClientClick="javascript:return confirm('是否確定刪除此筆資料?');" CausesValidation="false"></asp:LinkButton>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:LinkButton runat="server" ID="btnSave" Text="存檔" CommandName="Update" CssClass="button blue60"></asp:LinkButton>
|
||||
<asp:LinkButton runat="server" ID="btnCancel" Text="取消" CommandName="Cancel" CssClass="button red60"
|
||||
OnClientClick="javascript:return confirm('是否確定取消更正?');" CausesValidation="false"></asp:LinkButton>
|
||||
</EditItemTemplate>
|
||||
<HeaderStyle Width="140px" />
|
||||
<ItemStyle Width="140px" />
|
||||
</asp:TemplateField>
|
||||
<asp:BoundField DataField="職務ID" HeaderText="職務ID" SortExpression="職務ID" ReadOnly="True">
|
||||
<HeaderStyle Width="90px" />
|
||||
<ItemStyle Width="90px" HorizontalAlign="Center" />
|
||||
</asp:BoundField>
|
||||
<asp:TemplateField HeaderText="職務名稱" SortExpression="職務名稱">
|
||||
<EditItemTemplate>
|
||||
<asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("職務名稱") %>' CssClass="inputFull"></asp:TextBox>
|
||||
</EditItemTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="Label1" runat="server" Text='<%# Bind("職務名稱") %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
<HeaderStyle Width="300px" />
|
||||
<ItemStyle Width="300px" />
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="組織類別ID" SortExpression="組織類別ID">
|
||||
<EditItemTemplate>
|
||||
<weblib:SQLDropDownList ID="ddl組織類別" runat="server" LookupConfigName="組織類別"
|
||||
AddEmptyItem="False" AdditionalWhere="" EmptyItemText="(請選擇)" OrderBy=""
|
||||
SelectedValue='<%# Bind("組織類別ID") %>' DataTextField="組織類別名稱" DataValueField="組織類別ID"
|
||||
CssClass="inputFull">
|
||||
</weblib:SQLDropDownList>
|
||||
</EditItemTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="Label2" runat="server" Text='<%# Get組織類別名稱(Eval("組織類別ID")) %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
<HeaderStyle Width="300px" />
|
||||
<ItemStyle Width="300px" />
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="主管" SortExpression="主管">
|
||||
<EditItemTemplate>
|
||||
<weblib:ValueCheckBox ID="cb主管" runat="server" Value='<%# Bind("主管") %>' CheckedValue="Y"
|
||||
UncheckedValue="N" Text="主管" />
|
||||
</EditItemTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="Label4" runat="server" Text='<%# Eval("主管", "{0}") == "Y" ? "是" : "否" %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
<HeaderStyle Width="80px" />
|
||||
<ItemStyle Width="80px" />
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
<PagerTemplate>
|
||||
<weblib:GridViewPager ID="GridViewPager1" runat="server" />
|
||||
</PagerTemplate>
|
||||
</asp:GridView>
|
||||
</asp:Content>
|
||||
@@ -0,0 +1,51 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using WebLib;
|
||||
|
||||
namespace Education.Forms.組織
|
||||
{
|
||||
public partial class 職務類別處理 : FormBase
|
||||
{
|
||||
private DAC_組織類別 Dao組織類別;
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
FunctionName = "職務類別處理";
|
||||
Dao組織類別 = new DAC_組織類別(conn);
|
||||
|
||||
if (IsPostBack)
|
||||
GridView1.DataBind();
|
||||
else
|
||||
ddl組織類別.DataBind();
|
||||
}
|
||||
|
||||
protected void dsGrid_ObjectCreating(object sender, ObjectDataSourceEventArgs e)
|
||||
{
|
||||
e.ObjectInstance = Dao職務;
|
||||
}
|
||||
|
||||
protected void btnInsert_Click(object sender, EventArgs e)
|
||||
{
|
||||
職務 newItem = new 職務();
|
||||
newItem.職務名稱 = txt職務名稱.Text;
|
||||
newItem.組織類別ID = ddl組織類別.SelectedItem.Value;
|
||||
newItem.主管 = cb主管.Value;
|
||||
newItem.DB_CRUSR = UserId;
|
||||
Dao職務.InsertOne(newItem);
|
||||
GridView1.DataBind();
|
||||
}
|
||||
|
||||
protected string Get組織類別名稱(object 組織類別ID)
|
||||
{
|
||||
組織類別List d = Dao組織類別.SelectOne(DAC.GetInt32(組織類別ID));
|
||||
if (d.Count > 0)
|
||||
return d[0].組織類別名稱;
|
||||
else
|
||||
return "";
|
||||
}
|
||||
}
|
||||
}
|
||||
+80
@@ -0,0 +1,80 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <自動產生>
|
||||
// 這段程式碼是由工具產生的。
|
||||
//
|
||||
// 變更這個檔案可能會導致不正確的行為,而且如果已重新產生
|
||||
// 程式碼,則會遺失變更。
|
||||
// </自動產生>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace Education.Forms.組織
|
||||
{
|
||||
|
||||
|
||||
public partial class 職務類別處理
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// dsGrid 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.ObjectDataSource dsGrid;
|
||||
|
||||
/// <summary>
|
||||
/// btnInsert 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.LinkButton btnInsert;
|
||||
|
||||
/// <summary>
|
||||
/// txt職務名稱 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.TextBox txt職務名稱;
|
||||
|
||||
/// <summary>
|
||||
/// rfv職務名稱 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.RequiredFieldValidator rfv職務名稱;
|
||||
|
||||
/// <summary>
|
||||
/// ddl組織類別 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::WebLib.SQLDropDownList ddl組織類別;
|
||||
|
||||
/// <summary>
|
||||
/// cb主管 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::WebLib.ValueCheckBox cb主管;
|
||||
|
||||
/// <summary>
|
||||
/// GridView1 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.GridView GridView1;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user