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,108 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using WebLib;
namespace Education.Forms.
{
public partial class : FormBase
{
protected void Page_Load(object sender, EventArgs e)
{
FunctionName = "報名查詢及取消報名";
if (IsPostBack)
{
GridView1.DataBind();
}
}
protected void ds選課_ObjectCreating(object sender, ObjectDataSourceEventArgs e)
{
e.ObjectInstance = Dao課程報名;
}
protected void ds選課_Selecting(object sender, ObjectDataSourceSelectingEventArgs e)
{
e.InputParameters["學員編號"] = UserId;
e.InputParameters["僅已簽核"] = IsBackend;
e.InputParameters["僅必修"] = false;
}
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
if (!(e.Row.DataItem is DataRowView dataItem))
return;
TableCell cell = e.Row.Cells[6];
Literal lt狀態 = FindControl<Literal>(cell, "lb狀態");
lt狀態.Text = "";
int = DAC.GetInt32(dataItem["訓練課程編號"]);
string = DAC.GetString(dataItem["報名狀態"]);
DateTime = DAC.GetDateTime(dataItem["訓練日期"]);
int = DAC.GetInt32(dataItem["取消報名截止期限"]);
// 已過訓練日期,狀態均不顯示
if ( < DateTime.UtcNow.AddHours(8).Date)
return;
// 已取消,狀態均不顯示
if ( != "Y" && != "R")
return;
// 選修的,未到取消報名截止期限,可取消
if ( == "Y")
{
if (.AddDays(-) > DateTime.UtcNow.AddHours(8).Date)
{
cell.FindControl("btn取消報名").Visible = true;
}
else
{
lt狀態.Text += "<div style=\"color:red\">已超過取消報名截止期限</div>";
}
}
// 尚未報名
if ( == "S")
{
}
}
}
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
// 處理報名動作
if (e.CommandName == "取消報名")
{
// 1. 寫一筆報名紀錄
int = DAC.GetInt32(e.CommandArgument);
Dao課程報名.(UserId, , UserId);
// 2. 發送報名確認郵件
List values = Dao訓練課程企劃.SelectOne();
string = Dao員工.Get電子郵件(UserId);
string = Dao員工.Get員工姓名(UserId);
if (values.Count > 0)
{
= new ();
.Context = this.Context;
.(, , values[0].,
values[0]., values[0].);
}
GridView1.DataBind();
}
}
}
}