chore: 首次簽入 Thinkyu ASP.NET 專案

- 加入 Visual Studio / ASP.NET .gitignore
- 排除建置輸出、IDE 設定、NuGet packages、大型 MSI 安裝檔
This commit is contained in:
2026-09-10 09:42:37 +08:00
commit 577060bc78
2496 changed files with 501389 additions and 0 deletions
@@ -0,0 +1,252 @@
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using WebLib;
using System.IO;
namespace Education.Forms.
{
public partial class : FormBase
{
protected bool ;
protected void Page_Load(object sender, EventArgs e)
{
FunctionName = "訓練課程企劃書";
HelpUrl = "~/Help/課程企劃/訓練課程企劃書.html";
Form_View = FormView1;
Grid_View = GridView1;
FormView_DataSource = dsForm;
GridView_DataSource = dsGrid;
AddTabButton(MultiView1, View查詢, btnSearchTab);
AddTabButton(MultiView1, View處理, btnProcessTab);
if (!IsPostBack)
{
ActivateTab(MultiView1, 1);
}
else
{
AfterChangeTab();
}
if (Form_View.CurrentMode != FormViewMode.ReadOnly)
{
Grid_View.Visible = false;
}
1.DataBind();
}
protected void btnSearch_Click(object sender, EventArgs e)
{
Grid_View.PageIndex = 0;
Grid_View.DataBind();
1.DataBind();
}
protected void btnClear_Click(object sender, EventArgs e)
{
dd計畫別_Search.SelectedValue = "";
txt訓練年度_Search.Text = "";
txt訓練名稱_Search.Text = "";
txt承辦_Search.Text = "";
}
protected override void AfterChangeTab()
{
switch (MultiView1.ActiveViewIndex)
{
case 1:
Grid_View.DataBind();
Form_View.DataBind();
break;
case 4:
break;
}
}
protected override void GridView_DataSource_Selected(object sender, ObjectDataSourceStatusEventArgs e)
{
base.GridView_DataSource_Selected(sender, e);
if (MultiView1.ActiveViewIndex == 0)
{
if (e.ReturnValue is List list && list.Count > 0)
ActivateTab(MultiView1, 1);
else
lbMessage.Text = "找不到合乎條件的資料";
}
}
protected override void GridView_SelectedIndexChanged(object sender, EventArgs e)
{
base.GridView_SelectedIndexChanged(sender, e);
1.DataBind();
1.Refresh();
}
protected override void GridView_PageIndexChanged(object sender, EventArgs e)
{
base.GridView_PageIndexChanged(sender, e);
1.DataBind();
1.Refresh();
}
protected void dsGrid_ObjectCreating(object sender, ObjectDataSourceEventArgs e)
{
e.ObjectInstance = Dao訓練課程企劃;
}
protected void dsForm_ObjectCreating(object sender, ObjectDataSourceEventArgs e)
{
e.ObjectInstance = Dao訓練課程企劃;
}
protected override void FormView_ReadOnlyDataBound(object sender, EventArgs e)
{
if (Form_View.SelectedValue != null)
{
base.FormView_ReadOnlyDataBound(sender, e);
= Dao表單簽核主檔.("課程企劃", DAC.GetString(Form_View.SelectedValue));
SetWebControlEnabled((Form_View.FindControl("btnUpdate") as WebControl), );
SetWebControlEnabled((Form_View.FindControl("btnDelete") as WebControl), );
}
}
protected override void FormView_DataBinding(object sender, EventArgs e)
{
base.FormView_DataBinding(sender, e);
}
protected override void FormView_InsertDataBound(object sender, EventArgs e)
{
base.FormView_InsertDataBound(sender, e);
FormViewSetControlValue("hf公司別", CompanyId);
FormViewSetControlValue("txt人數", "30");
FormViewSetControlValue("txt開放報名日期", DateTime.UtcNow.AddHours(8).Date.ToString("yyyyMMdd"));
FormViewSetControlValue("txt報名截止期限", "5");
FormViewSetControlValue("txt取消報名截止期限", "5");
FormViewSetControlValue("txt承辦", UserId);
FormViewSetControlValue("txt承辦X", UserName);
}
protected override void FormView_ModeChanged(object sender, EventArgs e)
{
base.FormView_ModeChanged(sender, e);
1.Visible = Form_View.CurrentMode == FormViewMode.ReadOnly;
if (1.Visible)
{
1.DataBind();
1.Refresh();
}
}
protected void FormView1_ItemCommand(object sender, FormViewCommandEventArgs e)
{
if (e.CommandName == "Close")
{
int ID = DAC.GetInt32(e.CommandArgument);
List d = Dao訓練課程企劃.SelectOne(ID);
if (d.Count > 0)
{
if (d[0]. == "Y")
d[0]. = "N";
else
d[0]. = "Y";
Dao訓練課程企劃.UpdateOne(d[0]);
this.DataBind();
}
}
}
protected void 1_DataBinding(object sender, EventArgs e)
{
if (Grid_View.SelectedValue != null)
{
int id = DAC.GetInt32(Grid_View.SelectedValue);
1.ID = id.ToString();
1.2 = 0;
1. = id;
1.Visible = true;
List d = Dao訓練課程企劃.SelectOne(id);
if (d.Count == 0)
1. = false;
else
{
1.ID格式 = String.Format("[{0}] {1}", d[0]., d[0].);
/*
DAC_場地遴選 Dao場地遴選 = new DAC_場地遴選(conn);
場地遴選List 場地List = Dao場地遴選.SelectOne(課程id);
bool 場地已簽准 = 場地List.Count > 0;
if (場地List.Count > 0)
{
表單簽核主檔 場地簽核status = Dao表單簽核主檔.GetLastStatus("場地遴選", 場地List[0].課程企劃編號.ToString());
場地已簽准 &= 場地簽核status != null &&
場地簽核status.應簽關數.CompareTo("D") != 0 &&
場地簽核status.應簽關數.CompareTo(場地簽核status.已簽關數) == 0 &&
場地簽核status.最終結果 == "Y";
}
DAC_訓練課程內容 Dao訓練課程內容 = new DAC_訓練課程內容(conn);
訓練課程內容List 課程內容List = Dao訓練課程內容.SelectBy課程企劃(課程id);
bool 講師已簽准 = 課程內容List.Count > 0;
foreach (訓練課程內容 item in 課程內容List)
{
表單簽核主檔 講師簽核status = Dao表單簽核主檔.GetLastStatus("講師遴選", String.Format("{0}|{1}", 課程id, item.課程序號));
講師已簽准 &= 講師簽核status != null &&
講師簽核status.應簽關數.CompareTo("D") != 0 &&
講師簽核status.應簽關數.CompareTo(講師簽核status.已簽關數) == 0 &&
講師簽核status.最終結果 == "Y";
}
*/
1. = d[0]..CompareTo(UserId) == 0 && Dao訓練課程企劃.Get場地講師已輸入(id);
}
}
else
1.Visible = false;
}
protected void 1_Approved(object sender, EventArgs e)
{
this.DataBind();
}
protected void 1_Sending(object sender, SendingEventArgs e)
{
//int 課程id = DAC.GetInt32(Grid_View.SelectedValue);
//e.允許送簽 = Dao訓練課程企劃.Get場地講師已簽准(課程id);
//if (!e.允許送簽)
//{
// ScriptManager.RegisterStartupScript(Page, Page.GetType(), "client_mesage",
// String.Format("alert(\"{0}\");", StringTable.GetString("場地遴選與講師遴選均簽核完畢,才可送簽")), true);
//}
}
protected string Get選定場地名稱(object )
{
int id = DAC.GetInt32();
d = GetData.(id);
if (d. == 0)
{
List v = new DAC_場地異動(conn).Select最後異動(id);
if (v.Count > 0 && v[0]. == 0 && !String.IsNullOrEmpty(v[0].))
return Server.HtmlEncode(v[0].);
return "";
}
else
return d.;
}
}
}