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,154 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using WebLib;
using System.Web.Services;
using System.Web.Script.Services;
using System.IO;
namespace Education.Forms.
{
public partial class : FormBase
{
private DAC_訓練溝通記錄 Dao訓練溝通記錄;
private DAC_訓練溝通記錄附件 Dao訓練溝通記錄附件;
protected DAC_訓練溝通記錄歷程 Dao訓練溝通記錄歷程;
private DAC_檔案圖示 Dao檔案圖示;
private string ;
protected void Page_Load(object sender, EventArgs e)
{
FunctionName = "課程溝通紀錄";
Dao訓練溝通記錄 = new DAC_訓練溝通記錄(conn);
Dao訓練溝通記錄附件 = new DAC_訓練溝通記錄附件(conn);
Dao訓練溝通記錄歷程 = new DAC_訓練溝通記錄歷程();
Dao檔案圖示 = new DAC_檔案圖示();
= Server.MapPath(Education.PublicVariable.);
Form_View = fv訓練溝通記錄;
Grid_View = gv訓練溝通記錄;
FormView_DataSource = ds訓練溝通記錄Form;
GridView_DataSource = ds訓練溝通記錄Grid;
if (IsPostBack)
{
Grid_View.DataBind();
}
}
protected void ds訓練溝通記錄Form_ObjectCreating(object sender, ObjectDataSourceEventArgs e)
{
e.ObjectInstance = Dao訓練溝通記錄;
}
protected void ds訓練溝通記錄Grid_ObjectCreating(object sender, ObjectDataSourceEventArgs e)
{
e.ObjectInstance = Dao訓練溝通記錄;
}
protected void btn查詢_Click(object sender, EventArgs e)
{
if (. == 0)
{
Panel1.Visible = false;
lbMessage.Text = "請選擇課程企劃";
return;
}
else
{
Grid_View.DataBind();
Form_View.DataBind();
Panel1.Visible = true;
}
}
protected void fv訓練溝通記錄_ItemInserting(object sender, FormViewInsertEventArgs e)
{
e.Values["訓練課程企劃編號"] = .;
}
protected void gv訓練溝通記錄_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
var ds訓練溝通記錄附件Grid = e.Row.Cells[5].FindControl("ds訓練溝通記錄附件Grid") as ObjectDataSource;
var dl訓練溝通記錄附件 = e.Row.Cells[5].FindControl("dl訓練溝通記錄附件") as DataList;
ds訓練溝通記錄附件Grid.SelectParameters["訓練溝通記錄編號"].DefaultValue = (e.Row.DataItem as Item)?..ToString();
dl訓練溝通記錄附件.DataBind();
}
}
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 dl訓練溝通記錄附件_ItemDataBound(object sender, DataListItemEventArgs e)
{
var hlItem = e.Item.FindControl("hlItem") as HyperLink;
hlItem.Attributes.Add("onclick", $"OpenAttachment({(e.Item.DataItem as 訓練溝通記錄附件Item)?.編號});");
}
protected void fv訓練溝通記錄_DataBound(object sender, EventArgs e)
{
if (fv訓練溝通記錄.CurrentMode == FormViewMode.Insert || fv訓練溝通記錄.CurrentMode == FormViewMode.Edit)
{
var lbReference = fv訓練溝通記錄.FindControl("lbReference") as Label;
if (lbReference != null)
{
if (fv訓練溝通記錄.CurrentMode == FormViewMode.Insert)
{
lbReference.Text = GetData.("1");
}
if (fv訓練溝通記錄.CurrentMode == FormViewMode.Edit)
{
lbReference.Text = GetData.((fv訓練溝通記錄.DataItem as Item)..ToString());
}
}
}
}
[WebMethod(EnableSession = true)]
[ScriptMethod(ResponseFormat = ResponseFormat.Json)]
public static string GetReference(string id)
{
return new DAC_GetData().(id);
}
protected void fv訓練溝通記錄_ItemDeleted(object sender, FormViewDeletedEventArgs e)
{
int = DAC.GetInt32(e.Keys["編號"]);
var attachList = Dao訓練溝通記錄附件.SelectBy訓練溝通記錄編號();
var path = $"{圖檔儲存路徑}{編號}";
foreach (var item in attachList)
{
Dao訓練溝通記錄附件.DeleteOne(item);
string fileName1 = String.Format("{0}\\{1:000000}.{2}", path, item., item.);
try
{
if (File.Exists(fileName1))
File.Delete(fileName1);
}
catch { }
}
try
{
if (Directory.Exists(path))
Directory.Delete(path);
}
catch { }
}
}
}