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,195 @@
using System;
using System.Data.Common;
using System.Web;
using System.Web.UI.WebControls;
using WebLib;
namespace Education.MobileSurvey
{
public partial class SurveyForm : System.Web.UI.Page
{
private DAC_滿意度調查 Dao滿意度調查;
private DAC_心得報告 Dao心得報告;
private DAC_訓練課程內容 Dao訓練課程內容;
private DAC_訓練課程企劃 Dao訓練課程企劃;
private DAC_滿意度調查講師 Dao滿意度調查講師;
private DAC_滿意度調查課程企劃 Dao滿意度調查課程企劃;
private DataListItem footerItem;
private int ID;
private string ID;
protected void Page_Load(object sender, EventArgs e)
{
if (Session[PublicVariable.UserId] == null || string.IsNullOrEmpty(Session[PublicVariable.UserId].ToString()))
{
Response.Redirect("Login.aspx");
return;
}
DbConnection conn = DAC.NewConnection();
Dao滿意度調查 = new DAC_滿意度調查(conn);
Dao心得報告 = new DAC_心得報告(conn);
Dao訓練課程內容 = new DAC_訓練課程內容(conn);
Dao訓練課程企劃 = new DAC_訓練課程企劃(conn);
Dao滿意度調查講師 = new DAC_滿意度調查講師(conn);
Dao滿意度調查課程企劃 = new DAC_滿意度調查課程企劃(conn);
hf課程編號.Value = Request["course"];
hf學員.Value = Request["student"];
ID = DAC.GetInt32(hf課程編號.Value);
ID = hf學員.Value;
if (string.IsNullOrEmpty(hf課程編號.Value) || string.IsNullOrEmpty(hf學員.Value))
{
lbMessage.Text = "參數錯誤,請從問卷列表重新進入。";
btnSave.Visible = false;
return;
}
if (!IsPostBack)
{
List d1 = Dao訓練課程企劃.SelectOne(ID);
if (d1.Count > 0)
{
lb課程企劃.Text = string.Format("{0} {1}", d1[0]., d1[0].);
}
lb學員.Text = string.Format("{0} {1}", ID, Get員工姓名(ID));
List d = Dao心得報告.Select(false, ID, ID);
if (d.Count > 0)
{
txt心得.Text = d[0].;
txt建議.Text = d[0].;
}
else
{
txt心得.Text = "";
txt建議.Text = "";
}
List courses = Dao訓練課程內容.SelectBy課程企劃(ID);
DataList1.DataSource = courses;
DataList1.DataBind();
}
}
protected void btnSave_Click(object sender, EventArgs e)
{
if (!CheckRequired())
{
lbMessage.Text = "尚有項目未填寫完整,請填寫完整再儲存!";
ClientShowMessage("尚有項目未填寫完整,請填寫完整再儲存!");
return;
}
foreach (DataListItem item in DataList1.Items)
{
int = DAC.GetInt32((item.FindControl("hf課程序號") as HiddenField).Value);
RadioButtonList rbl1 = item.FindControl("rbl1") as RadioButtonList;
RadioButtonList rbl2 = item.FindControl("rbl2") as RadioButtonList;
RadioButtonList rbl3 = item.FindControl("rbl3") as RadioButtonList;
RadioButtonList rbl4 = item.FindControl("rbl4") as RadioButtonList;
Dao滿意度調查.Update(ID, ID, , 1, DAC.GetInt32(rbl1.SelectedValue), ID);
Dao滿意度調查.Update(ID, ID, , 2, DAC.GetInt32(rbl2.SelectedValue), ID);
Dao滿意度調查.Update(ID, ID, , 3, DAC.GetInt32(rbl3.SelectedValue), ID);
Dao滿意度調查.Update(ID, ID, , 4, DAC.GetInt32(rbl4.SelectedValue), ID);
Dao滿意度調查講師.Update(ID, ID, , ID);
}
RadioButtonList frbl1 = footerItem.FindControl("rbl1") as RadioButtonList;
RadioButtonList frbl2 = footerItem.FindControl("rbl2") as RadioButtonList;
RadioButtonList frbl3 = footerItem.FindControl("rbl3") as RadioButtonList;
RadioButtonList frbl4 = footerItem.FindControl("rbl4") as RadioButtonList;
Dao滿意度調查.Update(ID, ID, 0, 1, DAC.GetInt32(frbl1.SelectedValue), ID);
Dao滿意度調查.Update(ID, ID, 0, 2, DAC.GetInt32(frbl2.SelectedValue), ID);
Dao滿意度調查.Update(ID, ID, 0, 3, DAC.GetInt32(frbl3.SelectedValue), ID);
Dao滿意度調查.Update(ID, ID, 0, 4, DAC.GetInt32(frbl4.SelectedValue), ID);
Dao滿意度調查課程企劃.Update(ID, ID, ID);
Dao心得報告.Update(ID, ID, txt建議.Text, txt心得.Text, ID);
Response.Redirect("Complete.aspx");
}
protected void DataList1_ItemCreated(object sender, DataListItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Footer)
{
footerItem = e.Item;
}
}
protected void DataList1_ItemDataBound(object sender, DataListItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Item ||
e.Item.ItemType == ListItemType.AlternatingItem ||
e.Item.ItemType == ListItemType.Footer)
{
RadioButtonList rbl1 = e.Item.FindControl("rbl1") as RadioButtonList;
RadioButtonList rbl2 = e.Item.FindControl("rbl2") as RadioButtonList;
RadioButtonList rbl3 = e.Item.FindControl("rbl3") as RadioButtonList;
RadioButtonList rbl4 = e.Item.FindControl("rbl4") as RadioButtonList;
int = 0;
if (e.Item.ItemType != ListItemType.Footer)
= DAC.GetInt32((e.Item.FindControl("hf課程序號") as HiddenField).Value);
滿調List d1 = Dao滿意度調查.SelectOne(ID, ID, , 1);
滿調List d2 = Dao滿意度調查.SelectOne(ID, ID, , 2);
滿調List d3 = Dao滿意度調查.SelectOne(ID, ID, , 3);
滿調List d4 = Dao滿意度調查.SelectOne(ID, ID, , 4);
if (d1.Count > 0 && !string.IsNullOrEmpty(DAC.GetString(d1[0].)))
rbl1.SelectedValue = DAC.GetString(d1[0].);
if (d2.Count > 0 && !string.IsNullOrEmpty(DAC.GetString(d2[0].)))
rbl2.SelectedValue = DAC.GetString(d2[0].);
if (d3.Count > 0 && !string.IsNullOrEmpty(DAC.GetString(d3[0].)))
rbl3.SelectedValue = DAC.GetString(d3[0].);
if (d4.Count > 0 && !string.IsNullOrEmpty(DAC.GetString(d4[0].)))
rbl4.SelectedValue = DAC.GetString(d4[0].);
}
}
private bool CheckRequired()
{
foreach (DataListItem item in DataList1.Items)
{
RadioButtonList rbl1 = item.FindControl("rbl1") as RadioButtonList;
RadioButtonList rbl2 = item.FindControl("rbl2") as RadioButtonList;
RadioButtonList rbl3 = item.FindControl("rbl3") as RadioButtonList;
RadioButtonList rbl4 = item.FindControl("rbl4") as RadioButtonList;
if (rbl1 != null && string.IsNullOrEmpty(rbl1.SelectedValue))
return false;
if (rbl2 != null && string.IsNullOrEmpty(rbl2.SelectedValue))
return false;
if (rbl3 != null && string.IsNullOrEmpty(rbl3.SelectedValue))
return false;
if (rbl4 != null && string.IsNullOrEmpty(rbl4.SelectedValue))
return false;
}
return true;
}
private string Get員工姓名(string ID)
{
DAC_BPSN dao = new DAC_BPSN(DAC.NewConnection());
return dao.Get員工姓名(ID);
}
private void ClientShowMessage(string message)
{
ClientScript.RegisterStartupScript(Page.GetType(), "msg",
string.Format("alert(\"{0}\");", message), true);
}
protected void btnBack_Click(object sender, EventArgs e)
{
Response.Redirect("SurveyList.aspx");
}
}
}