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,122 @@
using System;
using System.Collections.Generic;
using System.IO;
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 int id;
private DAC_檔案圖示 Dao檔案圖示;
private DAC_訓練溝通記錄附件 Dao訓練溝通記錄附件;
private DAC_訓練溝通記錄 Dao訓練溝通記錄;
private string ;
protected void Page_Load(object sender, EventArgs e)
{
FunctionName = "溝通紀錄附件管理";
id = DAC.GetInt32(Request["id"]);
Dao檔案圖示 = new DAC_檔案圖示();
Dao訓練溝通記錄附件 = new DAC_訓練溝通記錄附件(conn);
Dao訓練溝通記錄 = new DAC_訓練溝通記錄(conn);
= Server.MapPath(Education.PublicVariable.);
RegisterPostbackTrigger(btnInsert);
if (!IsPostBack)
{
var = Dao訓練溝通記錄.SelectOne(id).FirstOrDefault();
if ( != null)
{
var = new DAC_訓練課程企劃().SelectOne(.).FirstOrDefault();
if ( != null)
lb課程.Text = $"[{訓練課程企劃.顯示編號}] [{訓練課程企劃.訓練日期, 0:yyyy-MM-dd}]{訓練課程企劃.訓練名稱}";
lb溝通歷程.Text = new DAC_訓練溝通記錄歷程().GetName(.);
lb檢附資料參考.Text = GetData.(..ToString());
}
}
else
{
gv訓練溝通記錄附件.DataBind();
}
(Master as PopupForm).RefreshOpener = true;
}
protected string GetAttachImageUrl(object o編號, object o檔案名稱, object o副檔名)
{
var = DAC.GetInt32(o編號);
var = DAC.GetString(o檔案名稱);
var = DAC.GetString(o副檔名);
var icon = Dao檔案圖示.GetName(.ToLower());
if (icon == String.Empty)
icon = "file.png";
return ResolveClientUrl($"~/picture/{icon}");
}
protected void gv訓練溝通記錄附件_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
var hlItem = e.Row.Cells[3].FindControl("hlItem") as HyperLink;
hlItem.Attributes.Add("onclick", $"OpenAttachment({(e.Row.DataItem as 訓練溝通記錄附件Item)?.編號});");
}
}
protected void btnInsert_Click(object sender, EventArgs e)
{
if (!IsValid)
return;
var fileName = fu檔案上傳.FileName;
var fileExt = Path.GetExtension(fu檔案上傳.FileName).ToLower();
if (fileExt.StartsWith("."))
fileExt = fileExt.Substring(1);
var newValue = new Item()
{
= id,
= txt標題.Text,
= fileName,
= fileExt,
ContentType = fu檔案上傳.PostedFile.ContentType
};
Dao訓練溝通記錄附件.InsertOne(newValue);
string savePath = String.Format("{0}{1}", , id);
if (!Directory.Exists(savePath))
Directory.CreateDirectory(savePath);
var tFullName = String.Format("{0}\\{1:000000}.{2}", savePath, newValue., fileExt);
fu檔案上傳.PostedFile.SaveAs(tFullName);
gv訓練溝通記錄附件.DataBind();
}
protected void ds訓練溝通記錄附件Grid_ObjectCreating(object sender, ObjectDataSourceEventArgs e)
{
e.ObjectInstance = Dao訓練溝通記錄附件;
}
protected void gv訓練溝通記錄附件_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
int = DAC.GetInt32(e.Keys["訓練溝通記錄編號"]);
int = DAC.GetInt32(e.Keys["編號"]);
string = DAC.GetString(e.Keys["副檔名"]);
string fileName1 = String.Format("{0}{1}\\{2:000000}.{3}", , , , );
if (File.Exists(fileName1))
File.Delete(fileName1);
}
protected void CustomValidator1_ServerValidate(object source, ServerValidateEventArgs args)
{
args.IsValid = fu檔案上傳.HasFile;
}
}
}