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
+129
View File
@@ -0,0 +1,129 @@
using System;
using System.Collections.Generic;
using System.Web;
using System.Data;
using System.Data.Common;
using NPOI.SS.UserModel;
using NPOI.HSSF.UserModel;
using NPOI.HSSF.Util;
using System.IO;
using NPOI.SS.Util;
using Wellan.Data;
/// <summary>
/// 差勤月報表
/// </summary>
public class : ExcelReportBase
{
public ()
{
= "差勤月報表";
}
public override MemoryStream ()
{
BodyRowHeight = 35;
#region
excel.MergeCell(0, 0, 0, 10);
excel.SetCellValue(0, 0, String.Format("{0}\r\n承辦{1}\r\n『{2}』\r\n{3}", , , , ), headerStyle);
excel.SetCellValue(1, 0, "月份:", titleStyleRightNoBorder);
excel.SetCellValue(1, 1, .ToString("MM月"), titleStyleLeftNoBorder);
excel.SetCellValue(1, 2, "單位:", titleStyleRightNoBorder);
excel.SetCellValue(1, 3, WDAC.GetStringValue(.Tables[0].Rows[0]["單位"]), titleStyleLeftNoBorder);
excel.SetCellValue(1, 4, "職稱:", titleStyleRightNoBorder);
excel.SetCellValue(1, 5, WDAC.GetStringValue(.Tables[0].Rows[0]["職稱"]), titleStyleLeftNoBorder);
excel.SetCellValue(1, 6, "姓名:", titleStyleRightNoBorder);
excel.SetCellValue(1, 7, WDAC.GetStringValue(.Tables[0].Rows[0]["姓名"]), titleStyleLeftNoBorder);
excel.SetRowHeight(0, HeaderRowHeight * 4);
excel.SetRowHeight(1, BodyRowHeight);
excel.MergeCell(2, 0, 2, 1);
excel.SetRangeOuterBorder(2, 0, 2, 1, BorderStyle.Thin);
excel.SetCellValue(2, 0, "日期", titleStyleCenter);
excel.SetCellValue(2, 2, "出勤別", titleStyleCenter);
excel.SetCellValue(2, 3, "實際上班", titleStyleCenter);
excel.SetCellValue(2, 4, "出差外出", titleStyleCenter);
excel.SetCellValue(2, 5, "出差返回", titleStyleCenter);
excel.SetCellValue(2, 6, "實際下班", titleStyleCenter);
excel.SetCellValue(2, 7, "請假", titleStyleCenter);
excel.SetCellValue(2, 8, "加班", titleStyleCenter);
excel.SetCellValue(2, 9, "公差", titleStyleCenter);
excel.SetCellValue(2, 10, "備註", titleStyleCenter);
excel.SetRowHeight(2, BodyRowHeight);
#endregion
#region
int rowId = 3;
ICellStyle rowStyle;
foreach (DataRow r in .Tables[0].Rows)
{
string = WDAC.GetStringValue(r["請假"]);
string = WDAC.GetStringValue(r["加班"]);
string = WDAC.GetStringValue(r["公差"]);
string = WDAC.GetStringValue(r["出勤別"]);
if ( == "上班")
rowStyle = titleStyleCenter;
else
rowStyle = titleStyleCenterYellowBGC;
excel.SetCellValue(rowId, 0, WDAC.GetDateTimeValue(r["日期"]).ToString("MM月dd日"), rowStyle);
excel.SetCellValue(rowId, 1, WDAC.GetDateTimeValue(r["日期"]).ToString("dddd"), rowStyle);
excel.SetCellValue(rowId, 2, , rowStyle);
excel.SetCellValue(rowId, 3, WDAC.GetStringValue(r["上班"]), rowStyle);
excel.SetCellValue(rowId, 4, WDAC.GetStringValue(r["出差外出"]), rowStyle);
excel.SetCellValue(rowId, 5, WDAC.GetStringValue(r["出差返回"]), rowStyle);
excel.SetCellValue(rowId, 6, WDAC.GetStringValue(r["下班"]), rowStyle);
if ( != "0:00")
excel.SetCellValue(rowId, 7, , rowStyle);
else
excel.SetCellValue(rowId, 7, "", rowStyle);
if ( != "0:00")
excel.SetCellValue(rowId, 8, , rowStyle);
else
excel.SetCellValue(rowId, 8, "", rowStyle);
if ( != "0:00")
excel.SetCellValue(rowId, 9, , rowStyle);
else
excel.SetCellValue(rowId, 9, "", rowStyle);
excel.SetCellValue(rowId, 10, string.Format("{0} {1} {2}", r["班別名稱"], r["班別時間"], r["出勤異常"]), rowStyle);
excel.SetRowHeight(rowId, BodyRowHeight);
rowId++;
}
#endregion
#region
//excel.MergeCell(rowId + 2, 0, rowId + 2, 8);
//excel.SetCellValue(rowId + 2, 0, "申請人:             計畫督導:             人事單位:", titleStyleLeftNoBorder);
//excel.SetRowHeight(rowId + 2, BodyRowHeight);
#endregion
excel.SetColumnWidth(0, 11);
excel.SetColumnWidth(1, 11);
excel.SetColumnWidth(2, 10);
excel.SetColumnWidth(3, 15);
excel.SetColumnWidth(4, 15);
excel.SetColumnWidth(5, 15);
excel.SetColumnWidth(6, 15);
excel.SetColumnWidth(7, 15);
excel.SetColumnWidth(8, 15);
excel.SetColumnWidth(9, 15);
excel.SetColumnWidth(10, 15);
MemoryStream ms = new MemoryStream();
workbook.Write(ms);
return ms;
}
}