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,128 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using WebLib;
namespace Education.Forms.
{
public partial class : FormBase
{
private DAC_場地遴選 Dao場地遴選;
protected void Page_Load(object sender, EventArgs e)
{
FunctionName = "課程查詢及線上報名";
Dao場地遴選 = new DAC_場地遴選(conn);
if (!IsPostBack)
{
// 查詢範圍初始值為本月月初至下個月月底
DateTextBox1.Value = new DateTime(DateTime.UtcNow.AddHours(8).Date.Year, DateTime.UtcNow.AddHours(8).Date.Month, 1);
DateTextBox2.Value = new DateTime(DateTime.UtcNow.AddHours(8).Date.Year, DateTime.UtcNow.AddHours(8).Date.Month, 1).AddMonths(2).AddDays(-1);
}
else
{
GridView1.DataBind();
}
}
protected string Get訓練地點(object ID)
{
return GetData.(DAC.GetInt32(ID)).;
}
protected string Get剩餘名額(object ID, object )
{
int = DAC.GetInt32();
int = Dao課程報名.Get報名人數(DAC.GetInt32(ID));
if ( > )
return String.Format("{0}", - );
else
return "額滿";
}
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
dataItem = e.Row.DataItem as ;
if (dataItem == null)
return;
TableCell cell = e.Row.Cells[5];
Literal lt狀態 = FindControl<Literal>(cell, "lb狀態");
lt狀態.Text = "";
string = Dao課程報名.Get報名狀態(UserId, dataItem.);
int = Dao課程報名.Get報名人數(dataItem.);
// 報名未開放
if (dataItem. > DateTime.UtcNow.AddHours(8).Date)
{
lt狀態.Text = "<div style=\"color:red\">尚未開放報名</div>";
return;
}
// 已截止報名
if (dataItem..AddDays(-dataItem.) <= DateTime.UtcNow.AddHours(8).Date)
{
lt狀態.Text += "<div style=\"color:red\">已截止報名</div>";
return;
}
// 已額滿
if ( >= dataItem.)
{
lt狀態.Text += "<div style=\"color:red\">已額滿</div>";
return;
}
// 報名狀態
if ( == "Y")
{
lt狀態.Text += "<div style=\"color:green\">已報名(選修)</div>";
return;
}
else if ( == "R")
{
lt狀態.Text += "<div style=\"color:green\">已報名(必修)</div>";
return;
}
// 可報名
if ( < dataItem. && == "S")
{
FindControl<Control>(cell, "btn報名").Visible = true;
}
}
}
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();
}
}
}
}