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,355 @@
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Linq;
using WebLib;
namespace Education.Forms.
{
public partial class PickupMaterial : FormBase
{
private DAC_訓練課程企劃 Dao課程企劃;
private DAC_訓練課程內容 Dao課程內容;
private DAC_教材遴選 Dao教材遴選;
private int ID;
private int ;
protected bool ;
protected void Page_Load(object sender, EventArgs e)
{
FunctionName = "訓練課程企劃書 >> 訓練課程內容 >> 教材評選";
Title = FunctionName;
if (!IsPostBack)
{
hf課程企劃ID.Value = Request["id"];
hf課程序號.Value = Request["class"];
}
ID = DAC.GetInt32(hf課程企劃ID.Value);
= DAC.GetInt32(hf課程序號.Value);
= Dao表單簽核主檔.("課程企劃", String.Format("{0}", ID));
Dao課程企劃 = new DAC_訓練課程企劃(conn);
Dao課程內容 = new DAC_訓練課程內容(conn);
Dao教材遴選 = new DAC_教材遴選(conn);
btnClearA.OnClientClick = String.Format("clearMaterial(\"{0}\", [{1}], \"{2}\"); return false;",
txt教材名稱A.ClientID, Get評選下拉ClientIDs("A"), btnClearA.ClientID);
btnClearB.OnClientClick = String.Format("clearMaterial(\"{0}\", [{1}], \"{2}\"); return false;",
txt教材名稱B.ClientID, Get評選下拉ClientIDs("B"), btnClearB.ClientID);
btnClearC.OnClientClick = String.Format("clearMaterial(\"{0}\", [{1}], \"{2}\"); return false;",
txt教材名稱C.ClientID, Get評選下拉ClientIDs("C"), btnClearC.ClientID);
if (!IsPostBack)
{
();
UpdateUI();
}
UIControl();
(Master as PopupForm).RefreshOpener = true;
}
private string Get評選下拉ClientIDs(string )
{
string[] ids = new string[]
{
"\"" + ().ClientID + "\"",
"\"" + ().ClientID + "\"",
"\"" + ().ClientID + "\"",
"\"" + ().ClientID + "\"",
"\"" + ().ClientID + "\"",
"\"" + 使().ClientID + "\"",
"\"" + ().ClientID + "\""
};
return String.Join(",", ids);
}
private void ()
{
DAC_教材評選選項 = new DAC_教材評選選項();
foreach (string in new[] { "A", "B", "C" })
{
((), .Select評選項目ForDropDown());
((), .Select評選項目ForDropDown());
((), .Select評選項目ForDropDown());
((), .Select評選項目ForDropDown());
((), .Select評選項目ForDropDown());
(使(), .Select評選項目ForDropDown());
((), .Select評選結果ForDropDown());
}
}
private void (DropDownList ddl, NameValueList list)
{
ddl.DataSource = list;
ddl.DataTextField = "Name";
ddl.DataValueField = "Value";
ddl.DataBind();
}
private DropDownList (string )
{
return == "A" ? ddl訓練目標相符A : == "B" ? ddl訓練目標相符B : ddl訓練目標相符C;
}
private DropDownList (string )
{
return == "A" ? ddl參訓對象符合A : == "B" ? ddl參訓對象符合B : ddl參訓對象符合C;
}
private DropDownList (string )
{
return == "A" ? ddl課程大綱相符A : == "B" ? ddl課程大綱相符B : ddl課程大綱相符C;
}
private DropDownList (string )
{
return == "A" ? ddl內容正確適切A : == "B" ? ddl內容正確適切B : ddl內容正確適切C;
}
private DropDownList (string )
{
return == "A" ? ddl學員理解應用A : == "B" ? ddl學員理解應用B : ddl學員理解應用C;
}
private DropDownList 使(string )
{
return == "A" ? ddl使用方式清楚A : == "B" ? ddl使用方式清楚B : ddl使用方式清楚C;
}
private DropDownList (string )
{
return == "A" ? ddl評選結果A : == "B" ? ddl評選結果B : ddl評選結果C;
}
private void UIControl()
{
btnSave.Visible = ;
btnClearA.Visible = ;
btnClearB.Visible = ;
btnClearC.Visible = ;
txt教材名稱A.Enabled = ;
txt教材名稱B.Enabled = ;
txt教材名稱C.Enabled = ;
foreach (string in new[] { "A", "B", "C" })
{
().Enabled = ;
().Enabled = ;
().Enabled = ;
().Enabled = ;
().Enabled = ;
使().Enabled = ;
().Enabled = ;
}
txt備註.Enabled = ;
}
private void UpdateUI()
{
List v1 = Dao課程企劃.SelectOne(ID);
List v2 = Dao課程內容.SelectOne(ID, );
List v3 = Dao教材遴選.SelectOne(ID, );
if (v1.Count > 0)
{
lb課程企劃.Text = String.Format("[{0}] {1}", v1[0]., v1[0].);
}
if (v2.Count > 0)
{
lb課程內容.Text = String.Format("[{0}] {1}", v2[0]., v2[0].);
}
foreach (string in new[] { "A", "B", "C" })
{
string = == "A" ? "一" : == "B" ? "二" : "三";
( == "A" ? txt教材名稱A : == "B" ? txt教材名稱B : txt教材名稱C).Text = "";
().SelectedValue = "";
().SelectedValue = "";
().SelectedValue = "";
().SelectedValue = "";
().SelectedValue = "";
使().SelectedValue = "";
().SelectedValue = "";
}
txt備註.Text = "";
if (v3.Count > 0)
{
if (!String.IsNullOrEmpty(v3[0]._A))
{
txt教材名稱A.Text = v3[0]._A;
("A").SelectedValue = v3[0]._A;
("A").SelectedValue = v3[0]._A;
("A").SelectedValue = v3[0]._A;
("A").SelectedValue = v3[0]._A;
("A").SelectedValue = v3[0]._A;
使("A").SelectedValue = v3[0].使_A;
("A").SelectedValue = v3[0]._A;
}
if (!String.IsNullOrEmpty(v3[0]._B))
{
txt教材名稱B.Text = v3[0]._B;
("B").SelectedValue = v3[0]._B;
("B").SelectedValue = v3[0]._B;
("B").SelectedValue = v3[0]._B;
("B").SelectedValue = v3[0]._B;
("B").SelectedValue = v3[0]._B;
使("B").SelectedValue = v3[0].使_B;
("B").SelectedValue = v3[0]._B;
}
if (!String.IsNullOrEmpty(v3[0]._C))
{
txt教材名稱C.Text = v3[0]._C;
("C").SelectedValue = v3[0]._C;
("C").SelectedValue = v3[0]._C;
("C").SelectedValue = v3[0]._C;
("C").SelectedValue = v3[0]._C;
("C").SelectedValue = v3[0]._C;
使("C").SelectedValue = v3[0].使_C;
("C").SelectedValue = v3[0]._C;
}
txt備註.Text = v3[0].;
}
}
private bool Validate評選()
{
string[] = { txt教材名稱A.Text.Trim(), txt教材名稱B.Text.Trim(), txt教材名稱C.Text.Trim() };
string[] = { "一", "二", "三" };
for (int i = 0; i < 3; i++)
{
if (String.IsNullOrEmpty([i]))
continue;
string = i == 0 ? "A" : i == 1 ? "B" : "C";
if (String.IsNullOrEmpty(().SelectedValue)
|| String.IsNullOrEmpty(().SelectedValue)
|| String.IsNullOrEmpty(().SelectedValue)
|| String.IsNullOrEmpty(().SelectedValue)
|| String.IsNullOrEmpty(().SelectedValue)
|| String.IsNullOrEmpty(使().SelectedValue)
|| String.IsNullOrEmpty(().SelectedValue))
{
ClientShowMessage(String.Format("請完整填寫教材{0}的評選項目與評選結果。", [i]));
return false;
}
}
return true;
}
protected void btnSave_Click(object sender, EventArgs e)
{
if (String.IsNullOrEmpty(txt教材名稱A.Text.Trim())
&& String.IsNullOrEmpty(txt教材名稱B.Text.Trim())
&& String.IsNullOrEmpty(txt教材名稱C.Text.Trim()))
{
ClientShowMessage("請至少輸入一項教材名稱。");
return;
}
if (!Validate評選())
return;
Item item = Dao教材遴選.SelectOne(ID, ).FirstOrDefault();
if (item == null)
{
item = new Item()
{
= ID,
= ,
_A = txt教材名稱A.Text,
_A = Get選擇值(("A")),
_A = Get選擇值(("A")),
_A = Get選擇值(("A")),
_A = Get選擇值(("A")),
_A = Get選擇值(("A")),
使_A = Get選擇值(使("A")),
_A = Get選擇值(("A")),
_B = txt教材名稱B.Text,
_B = Get選擇值(("B")),
_B = Get選擇值(("B")),
_B = Get選擇值(("B")),
_B = Get選擇值(("B")),
_B = Get選擇值(("B")),
使_B = Get選擇值(使("B")),
_B = Get選擇值(("B")),
_C = txt教材名稱C.Text,
_C = Get選擇值(("C")),
_C = Get選擇值(("C")),
_C = Get選擇值(("C")),
_C = Get選擇值(("C")),
_C = Get選擇值(("C")),
使_C = Get選擇值(使("C")),
_C = Get選擇值(("C")),
= txt備註.Text
};
Dao教材遴選.InsertOne(item);
}
else
{
item._A = txt教材名稱A.Text;
item._A = Get選擇值(("A"));
item._A = Get選擇值(("A"));
item._A = Get選擇值(("A"));
item._A = Get選擇值(("A"));
item._A = Get選擇值(("A"));
item.使_A = Get選擇值(使("A"));
item._A = Get選擇值(("A"));
item._B = txt教材名稱B.Text;
item._B = Get選擇值(("B"));
item._B = Get選擇值(("B"));
item._B = Get選擇值(("B"));
item._B = Get選擇值(("B"));
item._B = Get選擇值(("B"));
item.使_B = Get選擇值(使("B"));
item._B = Get選擇值(("B"));
item._C = txt教材名稱C.Text;
item._C = Get選擇值(("C"));
item._C = Get選擇值(("C"));
item._C = Get選擇值(("C"));
item._C = Get選擇值(("C"));
item._C = Get選擇值(("C"));
item.使_C = Get選擇值(使("C"));
item._C = Get選擇值(("C"));
item. = txt備註.Text;
Dao教材遴選.UpdateOne(item);
}
UpdateUI();
ClientShowMessage("儲存成功!");
}
private string Get選擇值(DropDownList ddl)
{
return String.IsNullOrEmpty(ddl.SelectedValue) ? null : ddl.SelectedValue;
}
}
}