chore: 首次簽入 Thinkyu ASP.NET 專案
- 加入 Visual Studio / ASP.NET .gitignore - 排除建置輸出、IDE 設定、NuGet packages、大型 MSI 安裝檔
This commit is contained in:
@@ -0,0 +1,209 @@
|
||||
<%@ Page Title="" Language="C#" MasterPageFile="~/Site2.Master" AutoEventWireup="true"
|
||||
CodeBehind="簽核.aspx.cs" Inherits="Education.Forms.簽核.簽核" EnableViewStateMac="false" %>
|
||||
|
||||
<%@ Register Assembly="WebLib" Namespace="WebLib" TagPrefix="cc1" %>
|
||||
<%@ Register Src="~/Forms/簽核/送簽.ascx" TagPrefix="uc1" TagName="送簽" %>
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
|
||||
<script type="text/javascript">
|
||||
function changeTab(id)
|
||||
{
|
||||
$("a[name='tabButton']").each(function () {
|
||||
$(this).attr("class", "tabButton");
|
||||
})
|
||||
|
||||
$("div[name='page']").each(function () {
|
||||
$(this).css("display", "none");
|
||||
})
|
||||
|
||||
$("#tabButton" + id).attr("class", "tabButtonSelected");
|
||||
$("#page" + id).css("display", "block");
|
||||
}
|
||||
</script>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
|
||||
<asp:LinkButton ID="LinkButton1" runat="server" CssClass="tabButtonSelected">要簽核的表單</asp:LinkButton>
|
||||
<asp:LinkButton ID="LinkButton2" runat="server" CssClass="tabButton">已簽核的表單</asp:LinkButton>
|
||||
<asp:LinkButton ID="LinkButton3" runat="server" CssClass="tabButton">我的表單</asp:LinkButton>
|
||||
<div style="border-top: 1px solid gray;">
|
||||
<asp:MultiView ID="MultiView1" runat="server" ActiveViewIndex="0">
|
||||
<asp:View ID="View1" runat="server">
|
||||
<asp:ObjectDataSource ID="ds要簽核的表單" runat="server"
|
||||
OldValuesParameterFormatString="original_{0}" SelectMethod="Get可簽核的表單"
|
||||
TypeName="Education.DAC_表單簽核主檔" OnObjectCreating="ds要簽核的表單_ObjectCreating">
|
||||
<SelectParameters>
|
||||
<asp:SessionParameter Name="UserId" SessionField="UserId" Type="String" />
|
||||
</SelectParameters>
|
||||
</asp:ObjectDataSource>
|
||||
<asp:GridView ID="GridView1" runat="server" AllowPaging="True"
|
||||
AutoGenerateColumns="False" DataKeyNames="簽核ID" DataSourceID="ds要簽核的表單"
|
||||
EnableModelValidation="True" OnDataBound="GridView_DataBound"
|
||||
OnPageIndexChanged="GridView_PageIndexChanged"
|
||||
OnRowDataBound="GridView_RowDataBound"
|
||||
OnSelectedIndexChanged="GridView1_SelectedIndexChanged"
|
||||
CssClass="fixedwithborder" Width="100%">
|
||||
<Columns>
|
||||
<asp:TemplateField HeaderText="表單單號名稱" SortExpression="表單ID格式">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="Label4" runat="server" Text='<%# Eval("表單ID格式", "{0}").Replace("<br>", " / ") %>'></asp:Label>
|
||||
<asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False"
|
||||
CommandName="Select"></asp:LinkButton>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:BoundField DataField="表單類別ID" HeaderText="表單類別" SortExpression="表單類別ID">
|
||||
<HeaderStyle Width="14em" />
|
||||
<ItemStyle HorizontalAlign="Center" />
|
||||
</asp:BoundField>
|
||||
<asp:TemplateField HeaderText="送簽人員" SortExpression="送簽人員">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="Label1" runat="server" Text='<%# Bind("送簽人員") %>'></asp:Label>
|
||||
<asp:Label ID="Label2" runat="server" Text='<%# Get員工姓名(Eval("送簽人員")) %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
<HeaderStyle Width="7em" />
|
||||
<ItemStyle HorizontalAlign="Center" />
|
||||
</asp:TemplateField>
|
||||
<asp:BoundField DataField="送簽日期" HeaderText="送簽日期" SortExpression="送簽日期"
|
||||
DataFormatString="{0:yyyy-MM-dd}">
|
||||
<HeaderStyle Width="6em" />
|
||||
<ItemStyle HorizontalAlign="Center" />
|
||||
</asp:BoundField>
|
||||
</Columns>
|
||||
<PagerTemplate>
|
||||
<cc1:GridViewPager ID="GridViewPager1" runat="server" />
|
||||
</PagerTemplate>
|
||||
<EmptyDataTemplate>
|
||||
<asp:Label ID="Label7" runat="server" Text="目前沒有要簽核的表單" CssClass="ErrorMessage"></asp:Label>
|
||||
</EmptyDataTemplate>
|
||||
</asp:GridView>
|
||||
<uc1:送簽 runat="server" ID="送簽1" OnApproved="送簽1_Clicked" OnCanceled="送簽1_Clicked"
|
||||
OnRejected="送簽1_Clicked" />
|
||||
</asp:View>
|
||||
<asp:View ID="View2" runat="server">
|
||||
<asp:ObjectDataSource ID="ds已簽核的表單" runat="server"
|
||||
OldValuesParameterFormatString="original_{0}" SelectMethod="Get已簽核的表單"
|
||||
TypeName="Education.DAC_表單簽核主檔" OnObjectCreating="ds已簽核的表單_ObjectCreating">
|
||||
<SelectParameters>
|
||||
<asp:SessionParameter Name="UserId" SessionField="UserId" Type="String" />
|
||||
</SelectParameters>
|
||||
</asp:ObjectDataSource>
|
||||
<asp:GridView ID="GridView2" runat="server" AllowPaging="True"
|
||||
AutoGenerateColumns="False" DataKeyNames="簽核ID" DataSourceID="ds已簽核的表單"
|
||||
EnableModelValidation="True" OnDataBound="GridView_DataBound"
|
||||
OnPageIndexChanged="GridView_PageIndexChanged"
|
||||
OnRowDataBound="GridView_RowDataBound"
|
||||
OnSelectedIndexChanged="GridView2_SelectedIndexChanged"
|
||||
CssClass="fixedwithborder" Width="100%">
|
||||
<Columns>
|
||||
<asp:TemplateField HeaderText="表單單號名稱" SortExpression="表單ID格式">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="Label1" runat="server" Text='<%# Eval("表單ID格式", "{0}").Replace("<br>", " / ") %>'></asp:Label>
|
||||
<asp:LinkButton ID="LinkButton3" runat="server" CausesValidation="False"
|
||||
CommandName="Select"></asp:LinkButton>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:BoundField DataField="表單類別ID" HeaderText="表單類別" SortExpression="表單類別ID">
|
||||
<HeaderStyle Width="14em" />
|
||||
<ItemStyle HorizontalAlign="Center" />
|
||||
</asp:BoundField>
|
||||
<asp:TemplateField HeaderText="送簽人員" SortExpression="送簽人員">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="Label5" runat="server" Text='<%# Bind("送簽人員") %>'></asp:Label>
|
||||
<asp:Label ID="Label6" runat="server" Text='<%# Get員工姓名(Eval("送簽人員")) %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
<HeaderStyle Width="7em" />
|
||||
<ItemStyle HorizontalAlign="Center" />
|
||||
</asp:TemplateField>
|
||||
<asp:BoundField DataField="送簽日期" DataFormatString="{0:yyyy-MM-dd}"
|
||||
HeaderText="送簽日期" SortExpression="送簽日期">
|
||||
<HeaderStyle Width="6em" />
|
||||
<ItemStyle HorizontalAlign="Center" />
|
||||
</asp:BoundField>
|
||||
</Columns>
|
||||
<PagerTemplate>
|
||||
<cc1:GridViewPager ID="GridViewPager2" runat="server" />
|
||||
</PagerTemplate>
|
||||
<EmptyDataTemplate>
|
||||
<asp:Label ID="Label7" runat="server" Text="目前沒有已簽核的表單" CssClass="ErrorMessage"></asp:Label>
|
||||
</EmptyDataTemplate>
|
||||
</asp:GridView>
|
||||
<uc1:送簽 runat="server" ID="送簽2" OnApproved="送簽2_Clicked" OnCanceled="送簽2_Clicked"
|
||||
OnRejected="送簽2_Clicked" />
|
||||
</asp:View>
|
||||
<asp:View ID="View3" runat="server">
|
||||
<asp:ObjectDataSource ID="ds我的表單" runat="server" OldValuesParameterFormatString="original_{0}"
|
||||
SelectMethod="Select我的表單" TypeName="Education.DAC_表單簽核主檔">
|
||||
<SelectParameters>
|
||||
<asp:SessionParameter SessionField="UserId" Name="送簽人員" Type="String"></asp:SessionParameter>
|
||||
<asp:ControlParameter ControlID="txt送簽日期1" PropertyName="Value" Name="送簽日期1" Type="DateTime">
|
||||
</asp:ControlParameter>
|
||||
<asp:ControlParameter ControlID="txt送簽日期2" PropertyName="Value" Name="送簽日期2" Type="DateTime">
|
||||
</asp:ControlParameter>
|
||||
</SelectParameters>
|
||||
</asp:ObjectDataSource>
|
||||
<table>
|
||||
<tr>
|
||||
<td class="caption">送簽日期:</td>
|
||||
<td>
|
||||
<cc1:DateTextBox ID="txt送簽日期1" runat="server" DateOrder="YMD" DateSeparator="" />
|
||||
</td>
|
||||
<td>至</td>
|
||||
<td>
|
||||
<cc1:DateTextBox ID="txt送簽日期2" runat="server" DateOrder="YMD" DateSeparator="" />
|
||||
</td>
|
||||
<td>
|
||||
<asp:LinkButton ID="btn查詢我的表單" runat="server" CssClass="button blue60" OnClick="btn查詢我的表單_Click">查詢</asp:LinkButton>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<asp:GridView ID="gv我的表單" runat="server" AllowPaging="True"
|
||||
AutoGenerateColumns="False" CssClass="fixedwithborder" DataKeyNames="簽核ID"
|
||||
DataSourceID="ds我的表單" EnableModelValidation="True"
|
||||
OnDataBound="GridView_DataBound" OnPageIndexChanged="GridView_PageIndexChanged"
|
||||
OnRowDataBound="GridView_RowDataBound"
|
||||
OnSelectedIndexChanged="GridView3_SelectedIndexChanged" Width="100%">
|
||||
<Columns>
|
||||
<asp:TemplateField HeaderText="表單單號名稱" SortExpression="表單ID格式">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="Label2" runat="server" Text='<%# Eval("表單ID格式", "{0}").Replace("<br>", " / ") %>'></asp:Label>
|
||||
<asp:LinkButton ID="LinkButton5" runat="server" CausesValidation="False"
|
||||
CommandName="Select"></asp:LinkButton>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:BoundField DataField="表單類別ID" HeaderText="表單類別" SortExpression="表單類別ID">
|
||||
<HeaderStyle Width="14em" />
|
||||
<ItemStyle HorizontalAlign="Center" />
|
||||
</asp:BoundField>
|
||||
<asp:TemplateField HeaderText="送簽人員" SortExpression="送簽人員">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="Label10" runat="server" Text='<%# Bind("送簽人員") %>'></asp:Label>
|
||||
<asp:Label ID="Label11" runat="server" Text='<%# Get員工姓名(Eval("送簽人員")) %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
<HeaderStyle Width="7em" />
|
||||
<ItemStyle HorizontalAlign="Center" />
|
||||
</asp:TemplateField>
|
||||
<asp:BoundField DataField="送簽日期" DataFormatString="{0:yyyy-MM-dd}"
|
||||
HeaderText="送簽日期" SortExpression="送簽日期">
|
||||
<HeaderStyle Width="6em" />
|
||||
<ItemStyle HorizontalAlign="Center" />
|
||||
</asp:BoundField>
|
||||
</Columns>
|
||||
<PagerTemplate>
|
||||
<cc1:GridViewPager ID="GridViewPager3" runat="server" />
|
||||
</PagerTemplate>
|
||||
<EmptyDataTemplate>
|
||||
<asp:Label ID="Label12" runat="server" CssClass="ErrorMessage"
|
||||
Text="在日期範圍之內沒有您送簽的表單"></asp:Label>
|
||||
</EmptyDataTemplate>
|
||||
</asp:GridView>
|
||||
<uc1:送簽 runat="server" ID="送簽3" 可送簽="false" />
|
||||
</asp:View>
|
||||
</asp:MultiView>
|
||||
</div>
|
||||
<asp:Panel ID="pnlContent" runat="server">
|
||||
<div style="margin-top: 5px;">
|
||||
<asp:Label ID="Label8" runat="server" Text="表單內容" Font-Size="12pt" Font-Bold="true"></asp:Label>
|
||||
</div>
|
||||
<div style="margin: 5px; padding: 5px; border: 2px solid #96fb92; border-radius: 8px;">
|
||||
<asp:PlaceHolder ID="PlaceHolder1" runat="server"></asp:PlaceHolder>
|
||||
</div>
|
||||
</asp:Panel>
|
||||
</asp:Content>
|
||||
@@ -0,0 +1,213 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
namespace Education.Forms.簽核
|
||||
{
|
||||
public partial class 簽核 : FormBase
|
||||
{
|
||||
private Dictionary<string, string> 檢視畫面對應 = new Dictionary<string, string>();
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
FunctionName = "表單簽核";
|
||||
|
||||
檢視畫面對應.Add("課程企劃", "~/Forms/檢視UC/訓練課程企劃書View.ascx");
|
||||
檢視畫面對應.Add("場地遴選", "~/Forms/檢視UC/場地遴選View.ascx");
|
||||
檢視畫面對應.Add("講師遴選", "~/Forms/檢視UC/講師遴選View.ascx");
|
||||
檢視畫面對應.Add("教材遴選", "~/Forms/檢視UC/教材遴選View.ascx");
|
||||
檢視畫面對應.Add("教學日誌暨異常狀況", "~/Forms/檢視UC/教學日誌暨異常狀況View.ascx");
|
||||
檢視畫面對應.Add("處理結果追蹤", "~/Forms/檢視UC/教學日誌暨異常狀況View.ascx");
|
||||
檢視畫面對應.Add("教育訓練效益追蹤調查表", "~/Forms/檢視UC/教育訓練效益追蹤調查表View.ascx");
|
||||
檢視畫面對應.Add("訓練檢討報告", "~/Forms/檢視UC/訓練檢討報告View.ascx");
|
||||
|
||||
|
||||
AddTabButton(MultiView1, View1, LinkButton1);
|
||||
AddTabButton(MultiView1, View2, LinkButton2);
|
||||
AddTabButton(MultiView1, View3, LinkButton3);
|
||||
|
||||
if (!IsPostBack)
|
||||
{
|
||||
ActivateTab(MultiView1, View1);
|
||||
txt送簽日期1.Value = new DateTime(DateTime.UtcNow.AddHours(8).Date.Year, DateTime.UtcNow.AddHours(8).Date.Month, 1);
|
||||
txt送簽日期2.Value = new DateTime(DateTime.UtcNow.AddHours(8).Date.Year, DateTime.UtcNow.AddHours(8).Date.Month, 1).AddMonths(2).AddDays(-1);
|
||||
}
|
||||
else
|
||||
{
|
||||
GridView1.DataBind();
|
||||
GridView2.DataBind();
|
||||
gv我的表單.DataBind();
|
||||
}
|
||||
}
|
||||
|
||||
protected void ds要簽核的表單_ObjectCreating(object sender, ObjectDataSourceEventArgs e)
|
||||
{
|
||||
e.ObjectInstance = Dao表單簽核主檔;
|
||||
}
|
||||
|
||||
protected void ds已簽核的表單_ObjectCreating(object sender, ObjectDataSourceEventArgs e)
|
||||
{
|
||||
e.ObjectInstance = Dao表單簽核主檔;
|
||||
}
|
||||
|
||||
protected override void AfterChangeTab()
|
||||
{
|
||||
base.AfterChangeTab();
|
||||
if (MultiView1.ActiveViewIndex == 0)
|
||||
{
|
||||
GridView1.DataBind();
|
||||
}
|
||||
else if (MultiView1.ActiveViewIndex == 1)
|
||||
{
|
||||
GridView2.DataBind();
|
||||
}
|
||||
}
|
||||
|
||||
protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
foreach (GridViewRow row in (sender as GridView).Rows)
|
||||
SetGridViewMouseBehavier(sender as GridView, row);
|
||||
|
||||
表單簽核主檔 status = Dao表單簽核主檔.GetLastStatus(DAC_BCLS.GetInt32(GridView1.SelectedValue));
|
||||
|
||||
if (status != null)
|
||||
{
|
||||
送簽1.表單類別 = status.表單類別ID;
|
||||
送簽1.表單ID = status.表單ID;
|
||||
送簽1.編號2 = status.編號2;
|
||||
送簽1.DataBind();
|
||||
送簽1.Refresh();
|
||||
|
||||
UserControlBase ctrl = LoadControl(檢視畫面對應[status.表單類別ID]) as UserControlBase;
|
||||
ctrl.ParentPage = this;
|
||||
ctrl.單號 = status.表單ID;
|
||||
ctrl.DataBind();
|
||||
|
||||
PlaceHolder1.Controls.Clear();
|
||||
PlaceHolder1.Controls.Add(ctrl);
|
||||
}
|
||||
}
|
||||
|
||||
protected void GridView2_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
foreach (GridViewRow row in (sender as GridView).Rows)
|
||||
SetGridViewMouseBehavier(sender as GridView, row);
|
||||
|
||||
表單簽核主檔 status = Dao表單簽核主檔.GetLastStatus(DAC_BCLS.GetInt32(GridView2.SelectedValue));
|
||||
|
||||
if (status != null)
|
||||
{
|
||||
送簽2.表單類別 = status.表單類別ID;
|
||||
送簽2.表單ID = status.表單ID;
|
||||
送簽2.編號2 = status.編號2;
|
||||
送簽2.DataBind();
|
||||
送簽2.Refresh();
|
||||
|
||||
UserControlBase ctrl = LoadControl(檢視畫面對應[status.表單類別ID]) as UserControlBase;
|
||||
ctrl.ParentPage = this;
|
||||
ctrl.單號 = status.表單ID;
|
||||
ctrl.DataBind();
|
||||
|
||||
PlaceHolder1.Controls.Clear();
|
||||
PlaceHolder1.Controls.Add(ctrl);
|
||||
}
|
||||
}
|
||||
|
||||
protected void GridView3_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
foreach (GridViewRow row in (sender as GridView).Rows)
|
||||
SetGridViewMouseBehavier(sender as GridView, row);
|
||||
|
||||
表單簽核主檔 status = Dao表單簽核主檔.GetLastStatus(DAC_BCLS.GetInt32(gv我的表單.SelectedValue));
|
||||
|
||||
if (status != null)
|
||||
{
|
||||
送簽3.表單類別 = status.表單類別ID;
|
||||
送簽3.表單ID = status.表單ID;
|
||||
送簽3.編號2 = status.編號2;
|
||||
送簽3.DataBind();
|
||||
送簽3.Refresh();
|
||||
|
||||
UserControlBase ctrl = LoadControl(檢視畫面對應[status.表單類別ID]) as UserControlBase;
|
||||
ctrl.ParentPage = this;
|
||||
ctrl.單號 = status.表單ID;
|
||||
ctrl.DataBind();
|
||||
|
||||
PlaceHolder1.Controls.Clear();
|
||||
PlaceHolder1.Controls.Add(ctrl);
|
||||
}
|
||||
}
|
||||
|
||||
protected new void GridView_DataBound(object sender, EventArgs e)
|
||||
{
|
||||
GridView GV = sender as GridView;
|
||||
if (GV.SelectedIndex == -1)
|
||||
GV.SelectedIndex = 0;
|
||||
if (GV.SelectedIndex >= GV.Rows.Count)
|
||||
GV.SelectedIndex = GV.Rows.Count - 1;
|
||||
|
||||
if (GV == GridView1)
|
||||
{
|
||||
GridView1_SelectedIndexChanged(sender, e);
|
||||
送簽1.Visible = GV.Rows.Count > 0;
|
||||
if (!送簽1.Visible)
|
||||
{
|
||||
PlaceHolder1.Controls.Clear();
|
||||
}
|
||||
}
|
||||
else if (GV == GridView2)
|
||||
{
|
||||
GridView2_SelectedIndexChanged(sender, e);
|
||||
送簽2.Visible = GV.Rows.Count > 0;
|
||||
if (!送簽2.Visible)
|
||||
{
|
||||
PlaceHolder1.Controls.Clear();
|
||||
}
|
||||
}
|
||||
else if (GV == gv我的表單)
|
||||
{
|
||||
GridView3_SelectedIndexChanged(sender, e);
|
||||
送簽3.Visible = GV.Rows.Count > 0;
|
||||
if (!送簽3.Visible)
|
||||
{
|
||||
PlaceHolder1.Controls.Clear();
|
||||
}
|
||||
}
|
||||
|
||||
pnlContent.Visible = 送簽1.Visible || 送簽2.Visible || 送簽3.Visible;
|
||||
}
|
||||
|
||||
protected new void GridView_PageIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
GridView GV = sender as GridView;
|
||||
GV.SelectedIndex = 0;
|
||||
GV.DataBind();
|
||||
}
|
||||
|
||||
protected new void GridView_RowDataBound(object sender, GridViewRowEventArgs e)
|
||||
{
|
||||
if (e.Row.RowType == DataControlRowType.DataRow)
|
||||
{
|
||||
SetGridViewMouseBehavier(sender as GridView, e.Row);
|
||||
}
|
||||
}
|
||||
|
||||
protected void 送簽1_Clicked(object sender, EventArgs e)
|
||||
{
|
||||
GridView1.DataBind();
|
||||
}
|
||||
|
||||
protected void 送簽2_Clicked(object sender, EventArgs e)
|
||||
{
|
||||
GridView2.DataBind();
|
||||
}
|
||||
|
||||
protected void btn查詢我的表單_Click(object sender, EventArgs e)
|
||||
{
|
||||
gv我的表單.DataBind();
|
||||
}
|
||||
}
|
||||
}
|
||||
Generated
+215
@@ -0,0 +1,215 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <自動產生>
|
||||
// 這段程式碼是由工具產生的。
|
||||
//
|
||||
// 變更這個檔案可能會導致不正確的行為,而且如果已重新產生
|
||||
// 程式碼,則會遺失變更。
|
||||
// </自動產生>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace Education.Forms.簽核
|
||||
{
|
||||
|
||||
|
||||
public partial class 簽核
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// LinkButton1 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.LinkButton LinkButton1;
|
||||
|
||||
/// <summary>
|
||||
/// LinkButton2 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.LinkButton LinkButton2;
|
||||
|
||||
/// <summary>
|
||||
/// LinkButton3 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.LinkButton LinkButton3;
|
||||
|
||||
/// <summary>
|
||||
/// MultiView1 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.MultiView MultiView1;
|
||||
|
||||
/// <summary>
|
||||
/// View1 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.View View1;
|
||||
|
||||
/// <summary>
|
||||
/// ds要簽核的表單 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.ObjectDataSource ds要簽核的表單;
|
||||
|
||||
/// <summary>
|
||||
/// GridView1 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.GridView GridView1;
|
||||
|
||||
/// <summary>
|
||||
/// 送簽1 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::Education.Forms.簽核.送簽 送簽1;
|
||||
|
||||
/// <summary>
|
||||
/// View2 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.View View2;
|
||||
|
||||
/// <summary>
|
||||
/// ds已簽核的表單 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.ObjectDataSource ds已簽核的表單;
|
||||
|
||||
/// <summary>
|
||||
/// GridView2 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.GridView GridView2;
|
||||
|
||||
/// <summary>
|
||||
/// 送簽2 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::Education.Forms.簽核.送簽 送簽2;
|
||||
|
||||
/// <summary>
|
||||
/// View3 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.View View3;
|
||||
|
||||
/// <summary>
|
||||
/// ds我的表單 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.ObjectDataSource ds我的表單;
|
||||
|
||||
/// <summary>
|
||||
/// txt送簽日期1 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::WebLib.DateTextBox txt送簽日期1;
|
||||
|
||||
/// <summary>
|
||||
/// txt送簽日期2 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::WebLib.DateTextBox txt送簽日期2;
|
||||
|
||||
/// <summary>
|
||||
/// btn查詢我的表單 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.LinkButton btn查詢我的表單;
|
||||
|
||||
/// <summary>
|
||||
/// gv我的表單 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.GridView gv我的表單;
|
||||
|
||||
/// <summary>
|
||||
/// 送簽3 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::Education.Forms.簽核.送簽 送簽3;
|
||||
|
||||
/// <summary>
|
||||
/// pnlContent 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Panel pnlContent;
|
||||
|
||||
/// <summary>
|
||||
/// Label8 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label Label8;
|
||||
|
||||
/// <summary>
|
||||
/// PlaceHolder1 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.PlaceHolder PlaceHolder1;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
<%@ Page Title="" Language="C#" MasterPageFile="~/Site2.Master" AutoEventWireup="true"
|
||||
CodeBehind="簽核測試.aspx.cs" Inherits="Education.Forms.簽核.簽核測試" %>
|
||||
|
||||
<%@ Register Assembly="WebLib" Namespace="WebLib" TagPrefix="weblib" %>
|
||||
<%@ Register src="送簽.ascx" tagname="送簽" tagprefix="uc1" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
|
||||
簽核單號:
|
||||
<asp:TextBox ID="txt簽核單號" runat="server"></asp:TextBox><br />
|
||||
表單類別:
|
||||
<asp:TextBox ID="txt表單類別" runat="server">課程企劃書</asp:TextBox><br />
|
||||
單號:
|
||||
<asp:TextBox ID="txt單號" runat="server">001</asp:TextBox><br />
|
||||
核准:
|
||||
<asp:RadioButtonList ID="rbl簽核結果" runat="server"
|
||||
RepeatDirection="Horizontal" RepeatLayout="Flow">
|
||||
<asp:ListItem Value="Y">同意</asp:ListItem>
|
||||
<asp:ListItem Value="N">不同意</asp:ListItem>
|
||||
</asp:RadioButtonList><br />
|
||||
下關人員:
|
||||
<weblib:WDropDownList ID="ddl下關人員" runat="server">
|
||||
<asp:ListItem Value="00001">總管理處</asp:ListItem>
|
||||
<asp:ListItem Value="00002">主管</asp:ListItem>
|
||||
</weblib:WDropDownList><br />
|
||||
簽核意見:
|
||||
<asp:TextBox ID="txt簽核意見" runat="server"></asp:TextBox><br />
|
||||
<asp:Button ID="Button1" runat="server" Text="送簽" OnClick="Button1_Click" />
|
||||
<asp:Button ID="Button2" runat="server" Text="簽核" OnClick="Button2_Click" />
|
||||
<asp:Button ID="Button3" runat="server" Text="取消" OnClick="Button3_Click" />
|
||||
<uc1:送簽 ID="送簽1" runat="server" />
|
||||
<asp:ObjectDataSource ID="dsMaster" runat="server"
|
||||
OldValuesParameterFormatString="original_{0}" SelectMethod="SelectOne"
|
||||
TypeName="Education.DAC_表單簽核主檔">
|
||||
<SelectParameters>
|
||||
<asp:ControlParameter ControlID="txt簽核單號" Name="簽核ID" PropertyName="Text"
|
||||
Type="Int32" />
|
||||
</SelectParameters>
|
||||
</asp:ObjectDataSource>
|
||||
<asp:ObjectDataSource ID="dsDetail" runat="server"
|
||||
OldValuesParameterFormatString="original_{0}" SelectMethod="SelectOneId"
|
||||
TypeName="Education.DAC_表單簽核明細">
|
||||
<SelectParameters>
|
||||
<asp:ControlParameter ControlID="txt簽核單號" Name="簽核ID" PropertyName="Text"
|
||||
Type="Int32" />
|
||||
</SelectParameters>
|
||||
</asp:ObjectDataSource>
|
||||
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
|
||||
DataKeyNames="簽核ID" DataSourceID="dsMaster" EnableModelValidation="True">
|
||||
<Columns>
|
||||
<asp:BoundField DataField="簽核ID" HeaderText="簽核ID" ReadOnly="True"
|
||||
SortExpression="簽核ID" />
|
||||
<asp:BoundField DataField="表單類別ID" HeaderText="表單類別ID"
|
||||
SortExpression="表單類別ID" />
|
||||
<asp:BoundField DataField="表單ID" HeaderText="表單ID" SortExpression="表單ID" />
|
||||
<asp:BoundField DataField="送簽人員" HeaderText="送簽人員" SortExpression="送簽人員" />
|
||||
<asp:BoundField DataField="送簽日期" HeaderText="送簽日期" SortExpression="送簽日期" />
|
||||
<asp:BoundField DataField="應簽關數" HeaderText="應簽關數" SortExpression="應簽關數" />
|
||||
<asp:BoundField DataField="已簽關數" HeaderText="已簽關數" SortExpression="已簽關數" />
|
||||
<asp:BoundField DataField="撤簽" HeaderText="撤簽" SortExpression="撤簽" />
|
||||
<asp:BoundField DataField="最終結果" HeaderText="最終結果" SortExpression="最終結果" />
|
||||
<asp:BoundField DataField="最終簽核人員" HeaderText="最終簽核人員"
|
||||
SortExpression="最終簽核人員" />
|
||||
<asp:BoundField DataField="最終簽核日期" HeaderText="最終簽核日期"
|
||||
SortExpression="最終簽核日期" />
|
||||
<asp:BoundField DataField="最終簽核意見" HeaderText="最終簽核意見"
|
||||
SortExpression="最終簽核意見" />
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
<asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False"
|
||||
DataKeyNames="簽核ID,關ID" DataSourceID="dsDetail" EnableModelValidation="True">
|
||||
<Columns>
|
||||
<asp:BoundField DataField="簽核ID" HeaderText="簽核ID" ReadOnly="True"
|
||||
SortExpression="簽核ID" />
|
||||
<asp:BoundField DataField="關ID" HeaderText="關ID" ReadOnly="True"
|
||||
SortExpression="關ID" />
|
||||
<asp:BoundField DataField="簽核結果" HeaderText="簽核結果" SortExpression="簽核結果" />
|
||||
<asp:BoundField DataField="簽核人員" HeaderText="簽核人員" SortExpression="簽核人員" />
|
||||
<asp:BoundField DataField="簽核日期" HeaderText="簽核日期" SortExpression="簽核日期" />
|
||||
<asp:BoundField DataField="簽核意見" HeaderText="簽核意見" SortExpression="簽核意見" />
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</asp:Content>
|
||||
@@ -0,0 +1,52 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
namespace Education.Forms.簽核
|
||||
{
|
||||
public partial class 簽核測試 : FormBase
|
||||
{
|
||||
DAC_表單簽核明細 Dao表單簽核明細;
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
FunctionName = "簽核測試";
|
||||
Dao表單簽核主檔 = new DAC_表單簽核主檔(conn);
|
||||
Dao表單簽核明細 = new DAC_表單簽核明細(conn);
|
||||
}
|
||||
|
||||
protected void Button1_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (Dao表單簽核主檔.可送簽(txt表單類別.Text, txt單號.Text))
|
||||
{
|
||||
//txt簽核單號.Text = Dao表單簽核主檔.送簽(txt表單類別.Text, txt單號.Text, "X001", ddl下關人員.SelectedValue, txt單號.Text).ToString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
protected void Button2_Click(object sender, EventArgs e)
|
||||
{
|
||||
int 簽核ID = Convert.ToInt32(txt簽核單號.Text);
|
||||
表單簽核明細 lastStatus = Dao表單簽核明細.GetLast(簽核ID);
|
||||
|
||||
switch (rbl簽核結果.SelectedValue)
|
||||
{
|
||||
case "Y":
|
||||
Dao表單簽核主檔.核准(簽核ID, lastStatus.簽核人員, txt簽核意見.Text, ddl下關人員.SelectedValue);
|
||||
break;
|
||||
case "N":
|
||||
Dao表單簽核主檔.不核准(簽核ID, lastStatus.簽核人員, txt簽核意見.Text);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
protected void Button3_Click(object sender, EventArgs e)
|
||||
{
|
||||
int 簽核ID = Convert.ToInt32(txt簽核單號.Text);
|
||||
Dao表單簽核主檔.取消簽核(簽核ID);
|
||||
}
|
||||
}
|
||||
}
|
||||
+143
@@ -0,0 +1,143 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <自動產生>
|
||||
// 這段程式碼是由工具產生的。
|
||||
//
|
||||
// 變更這個檔案可能會導致不正確的行為,而且如果已重新產生
|
||||
// 程式碼,則會遺失變更。
|
||||
// </自動產生>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace Education.Forms.簽核
|
||||
{
|
||||
|
||||
|
||||
public partial class 簽核測試
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// txt簽核單號 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.TextBox txt簽核單號;
|
||||
|
||||
/// <summary>
|
||||
/// txt表單類別 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.TextBox txt表單類別;
|
||||
|
||||
/// <summary>
|
||||
/// txt單號 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.TextBox txt單號;
|
||||
|
||||
/// <summary>
|
||||
/// rbl簽核結果 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.RadioButtonList rbl簽核結果;
|
||||
|
||||
/// <summary>
|
||||
/// ddl下關人員 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::WebLib.WDropDownList ddl下關人員;
|
||||
|
||||
/// <summary>
|
||||
/// txt簽核意見 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.TextBox txt簽核意見;
|
||||
|
||||
/// <summary>
|
||||
/// Button1 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Button Button1;
|
||||
|
||||
/// <summary>
|
||||
/// Button2 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Button Button2;
|
||||
|
||||
/// <summary>
|
||||
/// Button3 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Button Button3;
|
||||
|
||||
/// <summary>
|
||||
/// 送簽1 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::Education.Forms.簽核.送簽 送簽1;
|
||||
|
||||
/// <summary>
|
||||
/// dsMaster 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.ObjectDataSource dsMaster;
|
||||
|
||||
/// <summary>
|
||||
/// dsDetail 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.ObjectDataSource dsDetail;
|
||||
|
||||
/// <summary>
|
||||
/// GridView1 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.GridView GridView1;
|
||||
|
||||
/// <summary>
|
||||
/// GridView2 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.GridView GridView2;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,128 @@
|
||||
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="送簽.ascx.cs" Inherits="Education.Forms.簽核.送簽" %>
|
||||
<%@ Register Assembly="WebLib" Namespace="WebLib" TagPrefix="weblib" %>
|
||||
<style type="text/css">
|
||||
div.line {
|
||||
margin: 0 0 5px 0;
|
||||
}
|
||||
|
||||
div.line div {
|
||||
display: inline-block;
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
vertical-align: middle;
|
||||
margin: 0 5px 0 0;
|
||||
}
|
||||
|
||||
div.line div label {
|
||||
display: inline-block;
|
||||
font-weight: bold;
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
</style>
|
||||
<div style="background-color: #b8fcb5; padding: 8px; margin: 5px; width: auto; border: 1px solid #b8fcb5;
|
||||
border-radius: 8px; clear: both">
|
||||
<div style="display: inline-block; vertical-align:top;">
|
||||
<div id="divTitle" runat="server" style="font-weight: bold; margin: 0 0 5px 0;">
|
||||
<asp:Label ID="lbTitle" runat="server"></asp:Label>
|
||||
</div>
|
||||
<div class="line">
|
||||
<asp:Label ID="lbStatus" runat="server" ForeColor="Blue"></asp:Label>
|
||||
</div>
|
||||
<asp:Panel runat="server" ID="pnlApprove">
|
||||
<div class="line">
|
||||
<div>
|
||||
<span>簽核批示:</span>
|
||||
</div>
|
||||
<div>
|
||||
<asp:RadioButtonList ID="rblApprove" runat="server"
|
||||
RepeatDirection="Horizontal" RepeatLayout="Flow">
|
||||
<asp:ListItem Text="同意" Value="Y" Selected="True" style="color: green; margin-right: 1em"></asp:ListItem>
|
||||
<asp:ListItem Text="不同意" Value="N" style="color: red; margin-right: 3em"></asp:ListItem>
|
||||
</asp:RadioButtonList>
|
||||
</div>
|
||||
</div>
|
||||
<div class="line">
|
||||
<div>
|
||||
<span>簽核意見:</span>
|
||||
</div>
|
||||
<div>
|
||||
<asp:TextBox ID="txtApproveText" runat="server" Columns="60" MaxLength="60"></asp:TextBox>
|
||||
</div>
|
||||
</div>
|
||||
</asp:Panel>
|
||||
<asp:Panel runat="server" ID="pnlNext">
|
||||
<div class="line">
|
||||
<div>
|
||||
<asp:Label ID="Label1" runat="server" Text="第一關簽核人員:"></asp:Label>
|
||||
</div>
|
||||
<div>
|
||||
<weblib:WDropDownList ID="ddlApprover" runat="server"></weblib:WDropDownList>
|
||||
</div>
|
||||
</div>
|
||||
</asp:Panel>
|
||||
<asp:Panel runat="server" ID="pnlWithdraw">
|
||||
<div class="line">
|
||||
<div>
|
||||
<asp:Label ID="Label2" runat="server" Text="抽單簽核人員:"></asp:Label>
|
||||
</div>
|
||||
<div>
|
||||
<weblib:WDropDownList ID="ddlWithdrawApprover" runat="server"></weblib:WDropDownList>
|
||||
</div>
|
||||
</div>
|
||||
</asp:Panel>
|
||||
<asp:Panel ID="pnlButton" runat="server">
|
||||
<div class="line">
|
||||
<asp:Button ID="btnSend" runat="server" Text="送簽" OnClick="btnSend_Click" CssClass="button gray80" Style="margin-right: 5px;" />
|
||||
<asp:Button ID="btnApprove" runat="server" Text="確定簽核" OnClick="btnApprove_Click" CssClass="button gray80" Style="margin-right: 5px;" />
|
||||
<asp:Button ID="btnCancel" runat="server" Text="取消簽核" OnClick="btnCancel_Click" CssClass="button gray80" Style="margin-right: 5px;" />
|
||||
<asp:Button ID="btnWithDraw" runat="server" Text="抽單" OnClick="btnWithDraw_Click" CssClass="button gray80" Style="margin-right: 5px;" />
|
||||
</div>
|
||||
</asp:Panel>
|
||||
</div>
|
||||
<div style="display: inline-block; vertical-align:top; margin-left:10px">
|
||||
<asp:ObjectDataSource ID="ds簽核歷程" runat="server"
|
||||
OldValuesParameterFormatString="original_{0}"
|
||||
OnObjectCreating="ds簽核歷程_ObjectCreating"
|
||||
SelectMethod="SelectOneId" TypeName="Education.DAC_表單簽核明細">
|
||||
<SelectParameters>
|
||||
<asp:Parameter Name="簽核ID" Type="Int32" />
|
||||
</SelectParameters>
|
||||
</asp:ObjectDataSource>
|
||||
<asp:GridView ID="gv簽核歷程" runat="server" AutoGenerateColumns="False"
|
||||
DataKeyNames="簽核ID,關ID" DataSourceID="ds簽核歷程" EnableModelValidation="True"
|
||||
EnableViewState="False">
|
||||
<Columns>
|
||||
<asp:BoundField DataField="關ID" HeaderText="關號" ReadOnly="True"
|
||||
SortExpression="關ID" >
|
||||
<ItemStyle HorizontalAlign="Center" />
|
||||
</asp:BoundField>
|
||||
<asp:TemplateField HeaderText="簽核結果" SortExpression="簽核結果">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="Label3" runat="server"
|
||||
Text='<%# Eval("簽核結果", "{0}") == "" ? "未簽核" : Eval("簽核結果", "{0}") == "Y" ? "同意" : "不同意" %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
<ItemStyle HorizontalAlign="Center" />
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="簽核人員" SortExpression="簽核人員">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="Label1" runat="server" Text='<%# Bind("簽核人員") %>'></asp:Label>
|
||||
<asp:Label ID="Label2" runat="server"
|
||||
Text='<%# Get員工姓名(Eval("簽核人員", "{0}")) %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
<HeaderStyle HorizontalAlign="Center" />
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="簽核日期" SortExpression="簽核日期">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="Label4" runat="server"
|
||||
Text='<%# Convert.ToDateTime(Eval("簽核日期")).Ticks == 0 ? "" : Eval("簽核日期", "{0:yyyy-MM-dd hh:mm}") %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
<ItemStyle HorizontalAlign="Center" />
|
||||
</asp:TemplateField>
|
||||
<asp:BoundField DataField="簽核意見" HeaderText="簽核意見" SortExpression="簽核意見" />
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</div>
|
||||
<asp:Label ID="lbHint" runat="server" ForeColor="Red" style="float:right"></asp:Label><span style="clear:both;"/>
|
||||
</div>
|
||||
@@ -0,0 +1,523 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using WebLib;
|
||||
|
||||
namespace Education.Forms.簽核
|
||||
{
|
||||
[DataBindingHandler("System.Web.UI.Design.TextDataBindingHandler, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
|
||||
[DefaultBindingProperty("表單ID")]
|
||||
public partial class 送簽 : System.Web.UI.UserControl
|
||||
{
|
||||
private FormBase parent;
|
||||
private DAC_表單簽核主檔 Dao表單簽核;
|
||||
private DAC_表單簽核明細 Dao表單簽核明細;
|
||||
private DAC_組織人員 Dao組織人員;
|
||||
private DAC_組織圖 Dao組織圖;
|
||||
private DAC_職務 Dao職務;
|
||||
|
||||
protected void Page_Init(object sender, EventArgs e)
|
||||
{
|
||||
parent = (Page as FormBase);
|
||||
|
||||
Dao表單簽核 = new DAC_表單簽核主檔(parent.conn);
|
||||
Dao表單簽核明細 = new DAC_表單簽核明細(parent.conn);
|
||||
Dao組織人員 = new DAC_組織人員(parent.conn);
|
||||
Dao組織圖 = new DAC_組織圖(parent.conn);
|
||||
Dao職務 = new DAC_職務(parent.conn);
|
||||
}
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!parent.IsPostBack)
|
||||
Refresh();
|
||||
}
|
||||
|
||||
/* ===== 舊 Refresh 保留 =====
|
||||
public void Refresh()
|
||||
{
|
||||
NameValueList 簽核人員List = new NameValueList();
|
||||
NameValueList 抽單簽核人員List = new NameValueList();
|
||||
組織人員List 組織List = null;
|
||||
|
||||
// 取得表單簽核狀態
|
||||
表單簽核主檔 status = Dao表單簽核.GetLastStatus(表單類別, 表單ID);
|
||||
if (status != null)
|
||||
組織List = Dao組織人員.Select人員所屬的組織(status.送簽人員);
|
||||
else
|
||||
組織List = Dao組織人員.Select人員所屬的組織(parent.UserId);
|
||||
|
||||
string 目前關卡 = "0";
|
||||
if (status != null)
|
||||
{
|
||||
表單簽核明細 detail = Dao表單簽核明細.GetLast(status.簽核ID);
|
||||
目前關卡 = detail.關ID;
|
||||
|
||||
// 若抽單且已簽核,視同未送簽
|
||||
if (status.應簽關數 == "D" && status.已簽關數 == "D")
|
||||
目前關卡 = "0";
|
||||
|
||||
// 若不核准,視同未送簽
|
||||
if (status.最終結果 == "N")
|
||||
目前關卡 = "0";
|
||||
}
|
||||
|
||||
if (目前關卡 == "0" && status == null)
|
||||
lbStatus.Text = "尚未送簽";
|
||||
if (目前關卡 == "0" && status != null && status.最終結果 == "N")
|
||||
lbStatus.Text = "先前送簽不核准";
|
||||
if (目前關卡 == "0" && status != null && status.應簽關數 == "D" && status.已簽關數 == "D")
|
||||
lbStatus.Text = "先前已抽單";
|
||||
if (目前關卡 == "1" && status.已簽關數 == "0")
|
||||
lbStatus.Text = "已送簽,等待第一關簽核";
|
||||
if (目前關卡 == "2" && status.已簽關數 == "1")
|
||||
lbStatus.Text = "第一關已簽核,等待第二關簽核";
|
||||
if (目前關卡 == "3" && status.已簽關數 == "2")
|
||||
lbStatus.Text = "第二關已簽核,等待第三關簽核";
|
||||
if (目前關卡 == "1" && status.已簽關數 == "1" && status.應簽關數 == "1")
|
||||
lbStatus.Text = "已簽核完畢";
|
||||
if (目前關卡 == "2" && status.已簽關數 == "2" && status.應簽關數 == "2")
|
||||
lbStatus.Text = "已簽核完畢";
|
||||
if (目前關卡 == "3" && status.已簽關數 == "3" && status.應簽關數 == "3")
|
||||
lbStatus.Text = "已簽核完畢";
|
||||
if (目前關卡 == "D")
|
||||
lbStatus.Text = "已抽單,等待簽核";
|
||||
|
||||
// 改 UI 的可視與否
|
||||
btnApprove.Visible = Dao表單簽核.可簽核(表單類別, 表單ID, parent.UserId);
|
||||
btnCancel.Visible = Dao表單簽核.可取消(表單類別, 表單ID, parent.UserId);
|
||||
btnSend.Visible = 可送簽 && Dao表單簽核.可送簽(表單類別, 表單ID);
|
||||
btnWithDraw.Visible = 可送簽 && Dao表單簽核.可撤簽(表單類別, 表單ID, parent.UserId);
|
||||
|
||||
pnlApprove.Visible = btnApprove.Visible;
|
||||
// pnlNext.Visible = (btnSend.Visible || btnApprove.Visible) && (目前關卡 == "0" || 目前關卡 == "1" || 目前關卡 == "2");
|
||||
pnlNext.Visible = (btnSend.Visible || btnApprove.Visible) && (目前關卡 == "0" || 目前關卡 == "1");
|
||||
|
||||
pnlWithdraw.Visible = btnWithDraw.Visible;
|
||||
|
||||
if (pnlApprove.Visible || pnlNext.Visible || pnlWithdraw.Visible)
|
||||
this.Attributes.CssStyle["display"] = "block";
|
||||
else
|
||||
this.Attributes.CssStyle["display"] = "none";
|
||||
|
||||
if (pnlNext.Visible)
|
||||
{
|
||||
switch (目前關卡)
|
||||
{
|
||||
case "0": // 第一關是主管 2022-03-15 修改
|
||||
// Get部門簽核人員(PublicVariable.人資部ID, 簽核人員List);
|
||||
if (status != null)
|
||||
{
|
||||
Get直接主管(status.送簽人員, 簽核人員List, 組織List);
|
||||
}
|
||||
else
|
||||
{
|
||||
Get直接主管(parent.UserId, 簽核人員List, 組織List);
|
||||
}
|
||||
break;
|
||||
case "1": // 下一關是總管理處 2022-03-15 修改
|
||||
// 取出這個人員的直接主管,以及所屬組織的主管
|
||||
// Get直接主管(status.送簽人員, 簽核人員List, 組織List);
|
||||
Get部門簽核人員(PublicVariable.總管理處ID, 簽核人員List);
|
||||
break;
|
||||
case "2": // 下一關沒有了 2022-03-15 修改
|
||||
// Get部門簽核人員(PublicVariable.總管理處ID, 簽核人員List);
|
||||
//DataTable 人員dt = Dao組織人員.Select組織人員(PublicVariable.總管理處ID);
|
||||
break;
|
||||
case "3": // 總管理處
|
||||
break;
|
||||
case "D": // 抽單
|
||||
break;
|
||||
}
|
||||
|
||||
ddlApprover.DataSource = 簽核人員List;
|
||||
ddlApprover.DataTextField = "Name";
|
||||
ddlApprover.DataValueField = "Value";
|
||||
ddlApprover.DataBind();
|
||||
}
|
||||
|
||||
if (status != null)
|
||||
{
|
||||
if (pnlWithdraw.Visible)
|
||||
{
|
||||
Get直接主管(status.送簽人員, 抽單簽核人員List, 組織List);
|
||||
ddlWithdrawApprover.DataSource = 抽單簽核人員List;
|
||||
ddlWithdrawApprover.DataTextField = "Name";
|
||||
ddlWithdrawApprover.DataValueField = "Value";
|
||||
ddlWithdrawApprover.DataBind();
|
||||
}
|
||||
|
||||
ds簽核歷程.SelectParameters["簽核ID"].DefaultValue = status.簽核ID.ToString();
|
||||
gv簽核歷程.DataBind();
|
||||
gv簽核歷程.Visible = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
gv簽核歷程.Visible = false;
|
||||
}
|
||||
}
|
||||
===== 舊 Refresh 結束 ===== */
|
||||
|
||||
/// <summary>
|
||||
/// 新 Refresh:固定簽核人員清單,不從資料庫動態查詢
|
||||
/// </summary>
|
||||
public void Refresh()
|
||||
{
|
||||
表單簽核主檔 status = Dao表單簽核.GetLastStatus(表單類別, 表單ID);
|
||||
|
||||
string 目前關卡 = "0";
|
||||
if (status != null)
|
||||
{
|
||||
表單簽核明細 detail = Dao表單簽核明細.GetLast(status.簽核ID);
|
||||
目前關卡 = detail.關ID;
|
||||
|
||||
if (status.應簽關數 == "D" && status.已簽關數 == "D")
|
||||
目前關卡 = "0";
|
||||
|
||||
if (status.最終結果 == "N")
|
||||
目前關卡 = "0";
|
||||
}
|
||||
|
||||
if (目前關卡 == "0" && status == null)
|
||||
lbStatus.Text = "尚未送簽";
|
||||
if (目前關卡 == "0" && status != null && status.最終結果 == "N")
|
||||
lbStatus.Text = "先前送簽不核准";
|
||||
if (目前關卡 == "0" && status != null && status.應簽關數 == "D" && status.已簽關數 == "D")
|
||||
lbStatus.Text = "先前已抽單";
|
||||
if (目前關卡 == "1" && status.已簽關數 == "0")
|
||||
lbStatus.Text = "已送簽,等待第一關簽核";
|
||||
if (目前關卡 == "2" && status.已簽關數 == "1")
|
||||
lbStatus.Text = "第一關已簽核,等待第二關簽核";
|
||||
if (目前關卡 == "3" && status.已簽關數 == "2")
|
||||
lbStatus.Text = "第二關已簽核,等待第三關簽核";
|
||||
if (目前關卡 == "1" && status.已簽關數 == "1" && status.應簽關數 == "1")
|
||||
lbStatus.Text = "已簽核完畢";
|
||||
if (目前關卡 == "2" && status.已簽關數 == "2" && status.應簽關數 == "2")
|
||||
lbStatus.Text = "已簽核完畢";
|
||||
if (目前關卡 == "3" && status.已簽關數 == "3" && status.應簽關數 == "3")
|
||||
lbStatus.Text = "已簽核完畢";
|
||||
if (目前關卡 == "D")
|
||||
lbStatus.Text = "已抽單,等待簽核";
|
||||
|
||||
btnApprove.Visible = Dao表單簽核.可簽核(表單類別, 表單ID, parent.UserId);
|
||||
btnCancel.Visible = Dao表單簽核.可取消(表單類別, 表單ID, parent.UserId);
|
||||
btnSend.Visible = 可送簽 && Dao表單簽核.可送簽(表單類別, 表單ID);
|
||||
btnWithDraw.Visible = 可送簽 && Dao表單簽核.可撤簽(表單類別, 表單ID, parent.UserId);
|
||||
|
||||
pnlApprove.Visible = btnApprove.Visible;
|
||||
pnlNext.Visible = (btnSend.Visible || btnApprove.Visible) && (目前關卡 == "0" || 目前關卡 == "1");
|
||||
pnlWithdraw.Visible = btnWithDraw.Visible;
|
||||
|
||||
if (pnlApprove.Visible || pnlNext.Visible || pnlWithdraw.Visible)
|
||||
this.Attributes.CssStyle["display"] = "block";
|
||||
else
|
||||
this.Attributes.CssStyle["display"] = "none";
|
||||
|
||||
if (pnlNext.Visible)
|
||||
{
|
||||
NameValueList 簽核人員List = new NameValueList();
|
||||
switch (目前關卡)
|
||||
{
|
||||
case "0":
|
||||
Label1.Text = "第一關簽核人員:";
|
||||
簽核人員List.Add(new NameValueItem("陳琬婷", "02070"));
|
||||
break;
|
||||
case "1":
|
||||
Label1.Text = "第二關簽核人員:";
|
||||
簽核人員List.Add(new NameValueItem("黃佳萍", "00002"));
|
||||
簽核人員List.Add(new NameValueItem("吳惠如", "00003"));
|
||||
break;
|
||||
}
|
||||
|
||||
ddlApprover.DataSource = 簽核人員List;
|
||||
ddlApprover.DataTextField = "Name";
|
||||
ddlApprover.DataValueField = "Value";
|
||||
ddlApprover.DataBind();
|
||||
}
|
||||
|
||||
if (status != null)
|
||||
{
|
||||
if (pnlWithdraw.Visible)
|
||||
{
|
||||
NameValueList 抽單簽核人員List = new NameValueList();
|
||||
抽單簽核人員List.Add(new NameValueItem("陳琬婷", "02070"));
|
||||
|
||||
ddlWithdrawApprover.DataSource = 抽單簽核人員List;
|
||||
ddlWithdrawApprover.DataTextField = "Name";
|
||||
ddlWithdrawApprover.DataValueField = "Value";
|
||||
ddlWithdrawApprover.DataBind();
|
||||
}
|
||||
|
||||
ds簽核歷程.SelectParameters["簽核ID"].DefaultValue = status.簽核ID.ToString();
|
||||
gv簽核歷程.DataBind();
|
||||
gv簽核歷程.Visible = true;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
gv簽核歷程.Visible = false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 從部門取得人員,不包括本人
|
||||
/// </summary>
|
||||
/// <param name="部門ID"></param>
|
||||
/// <param name="簽核人員List"></param>
|
||||
private void Get部門簽核人員(int 部門ID, NameValueList 簽核人員List)
|
||||
{
|
||||
簽核人員List.Clear();
|
||||
DataTable 人員dt = Dao組織人員.Select組織人員(部門ID);
|
||||
foreach (DataRow r in 人員dt.Rows)
|
||||
{
|
||||
string 人員ID = DAC.GetString(r["人員ID"]);
|
||||
string 人員姓名 = DAC.GetString(r["人員姓名"]);
|
||||
|
||||
//if (人員ID.Length > 0 && 人員ID.CompareTo(parent.UserId) != 0 &&
|
||||
// !簽核人員List.ValueExists(人員ID))
|
||||
if (人員ID.Length > 0 && !簽核人員List.ValueExists(人員ID))
|
||||
{
|
||||
簽核人員List.Add(人員姓名, 人員ID);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 取得本人的直屬主管、部門主管以及以上各部門主管
|
||||
/// </summary>
|
||||
/// <param name="部門ID"></param>
|
||||
/// <param name="簽核人員List"></param>
|
||||
private void Get直接主管(string 員工編號, NameValueList 簽核人員List, 組織人員List 組織List)
|
||||
{
|
||||
foreach (組織人員 item in 組織List)
|
||||
{
|
||||
// 直接主管
|
||||
if (item.直接主管ID.Length > 0 &&
|
||||
item.直接主管ID.CompareTo(員工編號) != 0 &&
|
||||
!簽核人員List.ValueExists(item.直接主管ID))
|
||||
{
|
||||
簽核人員List.Add(String.Format("{0} {1}", item.直接主管ID, parent.Get員工姓名(item.直接主管ID)), item.直接主管ID);
|
||||
}
|
||||
|
||||
// 所屬組織主管
|
||||
組織圖List 組織data = Dao組織圖.SelectOne(item.組織ID);
|
||||
if (組織data.Count > 0)
|
||||
{
|
||||
string 主管ID = 組織data[0].部門主管;
|
||||
|
||||
if (主管ID.Length > 0 &&
|
||||
主管ID.CompareTo(員工編號) != 0 &&
|
||||
!簽核人員List.ValueExists(主管ID))
|
||||
{
|
||||
簽核人員List.Add(String.Format("{0} {1}", 主管ID, parent.Get員工姓名(主管ID)), 主管ID);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public string 表單類別
|
||||
{
|
||||
get { return DAC.GetString(ViewState["表單類別"]); }
|
||||
set { ViewState["表單類別"] = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 顯示在送簽區塊左上角的標題,說明此送簽區塊的性質
|
||||
/// </summary>
|
||||
public string Title
|
||||
{
|
||||
get { return lbTitle.Text; }
|
||||
set
|
||||
{
|
||||
lbTitle.Text = value;
|
||||
divTitle.Visible = !String.IsNullOrEmpty(value);
|
||||
}
|
||||
}
|
||||
|
||||
[Bindable(true)]
|
||||
public string 表單ID
|
||||
{
|
||||
get { return DAC.GetString(ViewState["表單ID"]); }
|
||||
set { ViewState["表單ID"] = value; }
|
||||
}
|
||||
|
||||
[Bindable(true)]
|
||||
public string 表單ID格式
|
||||
{
|
||||
get { return DAC.GetString(ViewState["表單ID格式"]); }
|
||||
set { ViewState["表單ID格式"] = value; }
|
||||
}
|
||||
|
||||
[Bindable(true)]
|
||||
public bool 可送簽
|
||||
{
|
||||
get { return DAC.GetBoolean(ViewState["可送簽"]); }
|
||||
set { ViewState["可送簽"] = value; }
|
||||
}
|
||||
|
||||
[Bindable(true)]
|
||||
public int 訓練課程企劃編號
|
||||
{
|
||||
get { return DAC.GetInt32(ViewState["訓練課程企劃編號"]); }
|
||||
set { ViewState["訓練課程企劃編號"] = value; }
|
||||
}
|
||||
|
||||
[Bindable(true)]
|
||||
public int 編號2
|
||||
{
|
||||
get { return DAC.GetInt32(ViewState["編號2"]); }
|
||||
set { ViewState["編號2"] = value; }
|
||||
}
|
||||
|
||||
public string 提示文字
|
||||
{
|
||||
get { return lbHint.Text; }
|
||||
set { lbHint.Text = value; }
|
||||
}
|
||||
|
||||
public event EventHandler Approved;
|
||||
public event EventHandler Rejected;
|
||||
public event EventHandler Canceled;
|
||||
public event EventHandler Withdrawn;
|
||||
|
||||
protected void btnApprove_Click(object sender, EventArgs e)
|
||||
{
|
||||
表單簽核主檔 status = Dao表單簽核.GetLastStatus(表單類別, 表單ID);
|
||||
if (status == null)
|
||||
return;
|
||||
|
||||
// 一般的簽核
|
||||
if (status.應簽關數.CompareTo("D") != 0)
|
||||
{
|
||||
// 核准
|
||||
if (rblApprove.SelectedValue == "Y")
|
||||
{
|
||||
bool 有下關 = Dao表單簽核.核准(status.簽核ID, parent.UserId, txtApproveText.Text, ddlApprover.SelectedValue);
|
||||
|
||||
if (有下關)
|
||||
{
|
||||
// 發送送簽郵件
|
||||
string 電子郵件 = parent.Dao員工.Get電子郵件(ddlApprover.SelectedValue);
|
||||
string 員工姓名 = parent.Dao員工.Get員工姓名(ddlApprover.SelectedValue);
|
||||
發送郵件 發送郵件 = new 發送郵件();
|
||||
發送郵件.Context = Context;
|
||||
發送郵件.發送簽核郵件(status.簽核ID, 員工姓名, 電子郵件);
|
||||
}
|
||||
|
||||
if (Approved != null)
|
||||
Approved(sender, e);
|
||||
}
|
||||
// 不核准
|
||||
if (rblApprove.SelectedValue == "N")
|
||||
{
|
||||
Dao表單簽核.不核准(status.簽核ID, parent.UserId, txtApproveText.Text);
|
||||
if (Rejected != null)
|
||||
Rejected(sender, e);
|
||||
}
|
||||
}
|
||||
// 撤簽的簽核
|
||||
else
|
||||
{
|
||||
// 核准
|
||||
if (rblApprove.SelectedValue == "Y")
|
||||
{
|
||||
Dao表單簽核.撤簽核准(status.簽核ID, parent.UserId, txtApproveText.Text);
|
||||
if (Approved != null)
|
||||
Approved(sender, e);
|
||||
}
|
||||
// 不核准
|
||||
if (rblApprove.SelectedValue == "N")
|
||||
{
|
||||
Dao表單簽核.撤簽不核准(status.簽核ID, parent.UserId, txtApproveText.Text);
|
||||
if (Rejected != null)
|
||||
Rejected(sender, e);
|
||||
}
|
||||
}
|
||||
|
||||
Refresh();
|
||||
}
|
||||
|
||||
protected void btnCancel_Click(object sender, EventArgs e)
|
||||
{
|
||||
表單簽核主檔 status = Dao表單簽核.GetLastStatus(表單類別, 表單ID);
|
||||
if (status == null)
|
||||
return;
|
||||
|
||||
Dao表單簽核.取消簽核(status.簽核ID);
|
||||
if (Canceled != null)
|
||||
Canceled(sender, e);
|
||||
|
||||
Refresh();
|
||||
}
|
||||
|
||||
public event SendEventHandler Send;
|
||||
public event SendingEventHandler Sending;
|
||||
|
||||
protected void btnSend_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (Sending != null)
|
||||
{
|
||||
SendingEventArgs e1 = new SendingEventArgs() { 允許送簽 = true };
|
||||
Sending(sender, e1);
|
||||
if (!e1.允許送簽)
|
||||
return;
|
||||
}
|
||||
|
||||
// 送簽
|
||||
int 簽核ID = Dao表單簽核.送簽(表單類別, 表單ID, parent.UserId, ddlApprover.SelectedValue, 表單ID格式,
|
||||
訓練課程企劃編號, 編號2);
|
||||
|
||||
// 發送送簽郵件
|
||||
string 電子郵件 = parent.Dao員工.Get電子郵件(ddlApprover.SelectedValue);
|
||||
string 員工姓名 = parent.Dao員工.Get員工姓名(ddlApprover.SelectedValue);
|
||||
發送郵件 發送郵件 = new 發送郵件();
|
||||
發送郵件.Context = Context;
|
||||
發送郵件.發送簽核郵件(簽核ID, 員工姓名, 電子郵件);
|
||||
|
||||
if (Send != null)
|
||||
Send(sender, new SendEventArgs() { 簽核ID = 簽核ID });
|
||||
|
||||
Refresh();
|
||||
}
|
||||
|
||||
protected void btnWithDraw_Click(object sender, EventArgs e)
|
||||
{
|
||||
// 抽單
|
||||
表單簽核主檔 status = Dao表單簽核.GetLastStatus(表單類別, 表單ID);
|
||||
if (status == null)
|
||||
return;
|
||||
|
||||
// 發送撤簽郵件
|
||||
string 電子郵件 = parent.Dao員工.Get電子郵件(ddlWithdrawApprover.SelectedValue);
|
||||
string 員工姓名 = parent.Dao員工.Get員工姓名(ddlWithdrawApprover.SelectedValue);
|
||||
|
||||
發送郵件 發送郵件 = new 發送郵件();
|
||||
發送郵件.Context = Context;
|
||||
發送郵件.發送撤簽郵件(status.簽核ID, 員工姓名, 電子郵件);
|
||||
|
||||
Dao表單簽核.撤簽(status.簽核ID, ddlWithdrawApprover.SelectedValue);
|
||||
|
||||
if (Withdrawn != null)
|
||||
Withdrawn(sender, e);
|
||||
|
||||
Refresh();
|
||||
}
|
||||
|
||||
protected string Get員工姓名(string 員工編號)
|
||||
{
|
||||
return parent.Get員工姓名(員工編號);
|
||||
}
|
||||
|
||||
protected void ds簽核歷程_ObjectCreating(object sender, ObjectDataSourceEventArgs e)
|
||||
{
|
||||
e.ObjectInstance = Dao表單簽核明細;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Generated
+197
@@ -0,0 +1,197 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <自動產生>
|
||||
// 這段程式碼是由工具產生的。
|
||||
//
|
||||
// 變更這個檔案可能會導致不正確的行為,而且如果已重新產生
|
||||
// 程式碼,則會遺失變更。
|
||||
// </自動產生>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace Education.Forms.簽核
|
||||
{
|
||||
|
||||
|
||||
public partial class 送簽
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// divTitle 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.HtmlControls.HtmlGenericControl divTitle;
|
||||
|
||||
/// <summary>
|
||||
/// lbTitle 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lbTitle;
|
||||
|
||||
/// <summary>
|
||||
/// lbStatus 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lbStatus;
|
||||
|
||||
/// <summary>
|
||||
/// pnlApprove 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Panel pnlApprove;
|
||||
|
||||
/// <summary>
|
||||
/// rblApprove 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.RadioButtonList rblApprove;
|
||||
|
||||
/// <summary>
|
||||
/// txtApproveText 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.TextBox txtApproveText;
|
||||
|
||||
/// <summary>
|
||||
/// pnlNext 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Panel pnlNext;
|
||||
|
||||
/// <summary>
|
||||
/// Label1 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label Label1;
|
||||
|
||||
/// <summary>
|
||||
/// ddlApprover 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::WebLib.WDropDownList ddlApprover;
|
||||
|
||||
/// <summary>
|
||||
/// pnlWithdraw 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Panel pnlWithdraw;
|
||||
|
||||
/// <summary>
|
||||
/// Label2 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label Label2;
|
||||
|
||||
/// <summary>
|
||||
/// ddlWithdrawApprover 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::WebLib.WDropDownList ddlWithdrawApprover;
|
||||
|
||||
/// <summary>
|
||||
/// pnlButton 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Panel pnlButton;
|
||||
|
||||
/// <summary>
|
||||
/// btnSend 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Button btnSend;
|
||||
|
||||
/// <summary>
|
||||
/// btnApprove 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Button btnApprove;
|
||||
|
||||
/// <summary>
|
||||
/// btnCancel 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Button btnCancel;
|
||||
|
||||
/// <summary>
|
||||
/// btnWithDraw 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Button btnWithDraw;
|
||||
|
||||
/// <summary>
|
||||
/// ds簽核歷程 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.ObjectDataSource ds簽核歷程;
|
||||
|
||||
/// <summary>
|
||||
/// gv簽核歷程 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.GridView gv簽核歷程;
|
||||
|
||||
/// <summary>
|
||||
/// lbHint 控制項。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自動產生的欄位。
|
||||
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lbHint;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
|
||||
namespace Education
|
||||
{
|
||||
public class SendEventArgs : EventArgs
|
||||
{
|
||||
public int 簽核ID;
|
||||
}
|
||||
|
||||
public delegate void SendEventHandler(object sender, SendEventArgs e);
|
||||
|
||||
public class SendingEventArgs : EventArgs
|
||||
{
|
||||
public bool 允許送簽;
|
||||
}
|
||||
|
||||
public delegate void SendingEventHandler(object sender, SendingEventArgs e);
|
||||
}
|
||||
Reference in New Issue
Block a user