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,209 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Script.Services;
using System.Web.Services;
using System.Web.UI;
using System.Web.UI.WebControls;
using WebLib;
namespace Education.Forms.
{
public partial class : FormBase
{
protected DAC_講師 daoTeacher;
protected DAC_講師外訓滿意度 daoEval;
protected int ;
protected int ;
protected string mode;
protected void Page_Load(object sender, EventArgs e)
{
daoTeacher = new DAC_講師(conn);
daoEval = new DAC_講師外訓滿意度(conn);
mode = Request["mode"];
= DAC.GetInt32(Request["id"]);
= DAC.GetInt32(Request["teacherid"]);
btnSaveAndContinue.Visible = mode == "new";
if (mode == "edit" && !IsPostBack)
{
LoadOne();
}
}
protected void ClearInput()
{
txt日期.Text = "";
txt地點.Text = "";
txt人數.Text = "";
txt對象.Text = "";
txt課程名稱.Text = "";
txt專業度.Text = "";
txt授課技巧.Text = "";
txt互動氛圍.Text = "";
txt內容切題.Text = "";
txt配合度.Text = "";
txt學員滿意度.Text = "";
txt講師授課方式.Text = "";
}
protected bool CheckInput()
{
return this.IsValid;
}
protected void LoadOne()
{
var item = daoEval.SelectOne().FirstOrDefault();
if (item != null)
{
txt日期.Value = item.;
txt地點.Text = item.;
txt人數.Text = DAC.GetString(item.);
txt對象.Text = item.;
txt課程名稱.Text = item.;
txt專業度.Text = DAC.GetString(item.);
txt授課技巧.Text = DAC.GetString(item.);
txt互動氛圍.Text = DAC.GetString(item.);
txt內容切題.Text = DAC.GetString(item.);
txt配合度.Text = DAC.GetString(item.);
txt學員滿意度.Text = DAC.GetString(item.滿);
txt跟課觀察.Text = DAC.GetString(item.);
txt講師授課方式.Text = DAC.GetString(item.);
}
}
protected bool SaveOne()
{
if (mode == "new")
{
try
{
var newItem = daoEval.InsertOne(new 滿Item()
{
= ,
= txt日期.Value,
= txt地點.Text,
= DAC.GetInt32(txt人數.Text),
= txt對象.Text,
= txt課程名稱.Text,
= DAC.GetInt32(txt專業度.Text),
= DAC.GetInt32(txt授課技巧.Text),
= DAC.GetInt32(txt互動氛圍.Text),
= DAC.GetInt32(txt內容切題.Text),
= DAC.GetInt32(txt配合度.Text),
滿 = DAC.GetInt32(txt學員滿意度.Text),
= txt跟課觀察.Text,
= txt講師授課方式.Text,
});
return true;
}
catch (Exception ex)
{
ClientShowMessage(string.Format("存檔過程中發生錯誤:\r\n{0}", ex.Message));
return false;
}
}
else if (mode == "edit")
{
try
{
var item = daoEval.SelectOne().FirstOrDefault();
if (item != null)
{
item. = txt日期.Value;
item. = txt地點.Text;
item. = DAC.GetInt32(txt人數.Text);
item. = txt對象.Text;
item. = txt課程名稱.Text;
item. = DAC.GetInt32(txt專業度.Text);
item. = DAC.GetInt32(txt授課技巧.Text);
item. = DAC.GetInt32(txt互動氛圍.Text);
item. = DAC.GetInt32(txt內容切題.Text);
item. = DAC.GetInt32(txt配合度.Text);
item.滿 = DAC.GetInt32(txt學員滿意度.Text);
item. = txt跟課觀察.Text;
item. = txt講師授課方式.Text;
}
daoEval.UpdateOne(item);
return true;
}
catch (Exception ex)
{
ClientShowMessage(string.Format("存檔過程中發生錯誤:\r\n{0}", ex.Message));
return false;
}
}
return false;
}
protected void btnSave_Click(object sender, EventArgs e)
{
if (CheckInput())
{
if (SaveOne())
{
ScriptManager.RegisterStartupScript(Page, Page.GetType(),
"close_dialog",
"window.parent.$(\"iframe#externalSite\").closest(\".ui-dialog-content\").dialog(\"close\");",
true);
}
}
}
protected void btnSaveAndContinue_Click(object sender, EventArgs e)
{
if (CheckInput())
{
if (SaveOne())
{
ClearInput();
}
}
}
protected void cv日期_ServerValidate(object source, ServerValidateEventArgs args)
{
args.IsValid = txt日期.Value.HasValue;
}
[WebMethod(EnableSession = true)]
[ScriptMethod(ResponseFormat = ResponseFormat.Json)]
public static bool DeleteOne(int id)
{
try
{
using (var conn = DAC.NewConnection())
{
var daoEval = new DAC_講師外訓滿意度(conn);
var item = daoEval.SelectOne(id).FirstOrDefault();
if (item != null)
{
daoEval.DeleteOne(item);
return true;
}
return false;
}
}
catch
{
return false;
}
}
protected string GetPhraseClientClick(Control control, string content)
{
string CID = "";
CID = control.ClientID;
if (CID.Length > 0)
return String.Format("javascript:FillMessage(\"{0}\", \"{1}\");return false;", CID, content);
else
return "javascript:return false;";
}
}
}