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,99 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.IO;
using WebLib;
namespace Education.Forms.
{
public partial class : FormBase
{
private DAC_課程剪影 Dao課程剪影;
private string ;
protected void Page_Load(object sender, EventArgs e)
{
FunctionName = "課程剪影";
Dao課程剪影 = new DAC_課程剪影(conn);
= Server.MapPath(Education.PublicVariable.);
if (IsPostBack)
{
GridView1.DataBind();
}
Panel1.Style["display"] = . > 0 ? "block" : "none";
RegisterPostbackTrigger(btnInsert);
}
protected void ds已上課_ObjectCreating(object sender, ObjectDataSourceEventArgs e)
{
e.ObjectInstance = Dao訓練課程企劃;
}
protected void btnInsert_Click(object sender, EventArgs e)
{
if (!IsValid)
return;
newValue = new ();
newValue. = .;
newValue. = txt照片說明.Text;
newValue. = Dao課程剪影.Next照片序號(newValue.);
newValue.DB_CRUSR = UserId;
Dao課程剪影.InsertOne(newValue);
string savePath = String.Format("{0}{1}", , newValue.);
if (!Directory.Exists(savePath))
Directory.CreateDirectory(savePath);
string tFullName = String.Format("{0}\\T_{1:000000}.jpg", savePath, newValue.);
MemoryStream ms = PictureProcess.(fu照片上傳.PostedFile.InputStream, 270, 270);
File.WriteAllBytes(tFullName, ms.ToArray());
ms.Dispose();
tFullName = String.Format("{0}\\{1:000000}.jpg", savePath, newValue.);
ms = PictureProcess.(fu照片上傳.PostedFile.InputStream, 1200, 1200);
File.WriteAllBytes(tFullName, ms.ToArray());
ms.Dispose();
GridView1.DataBind();
}
protected void CustomValidator1_ServerValidate(object source, ServerValidateEventArgs args)
{
args.IsValid = fu照片上傳.HasFile;
}
protected void btn查詢_Click(object sender, EventArgs e)
{
GridView1.DataBind();
}
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType != DataControlRowType.DataRow)
return;
dataItem = e.Row.DataItem as ;
(e.Row.Cells[3].FindControl("Image1") as Image).ImageUrl = String.Format(Education.PublicVariable. + "{0}/T_{1:000000}.jpg",
dataItem., dataItem.);
}
protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
int ID = DAC.GetInt32(e.Keys["課程企劃編號"]);
int = DAC.GetInt32(e.Keys["照片序號"]);
string fileName1 = String.Format("{0}{1}\\T_{2:000000}.jpg", , ID, );
string fileName2 = String.Format("{0}{1}\\{2:000000}.jpg", , ID, );
if (File.Exists(fileName1))
File.Delete(fileName1);
if (File.Exists(fileName2))
File.Delete(fileName2);
}
}
}