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
+211
View File
@@ -0,0 +1,211 @@
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;
using System.Linq;
/// <summary>
/// 請假申請單
/// </summary>
public class : ExcelReportBase
{
public ()
{
= "請假申請單";
}
public override MemoryStream ()
{
BodyRowHeight = 35;
TimeCalc timeCalc = new TimeCalc();
#region
excel.MergeCell(0, 0, 0, 9);
excel.SetCellValue(0, 0, String.Format("{0}\r\n承辦{1}\r\n『{2}』\r\n{3}", , , , ), headerStyle);
excel.SetCellValue(1, 0, "月份:", titleStyleRightNoBorder);
excel.MergeCell(1, 1, 1, 2);
excel.SetCellValue(1, 1, .ToString("MM月"), titleStyleLeftNoBorder);
excel.SetCellValue(1, 3, "單位:", titleStyleRightNoBorder);
excel.SetCellValue(1, 4, WDAC.GetStringValue(.Tables[0].Rows[0]["站別"]), titleStyleLeftNoBorder);
excel.SetCellValue(1, 5, "職稱:", titleStyleRightNoBorder);
excel.SetCellValue(1, 6, WDAC.GetStringValue(.Tables[0].Rows[0]["職稱"]), titleStyleLeftNoBorder);
excel.SetCellValue(1, 7, "姓名:", titleStyleRightNoBorder);
excel.SetCellValue(1, 8, WDAC.GetStringValue(.Tables[0].Rows[0]["BPNME"]), titleStyleLeftNoBorder);
excel.SetRowHeight(0, HeaderRowHeight * 4);
excel.SetRowHeight(1, BodyRowHeight);
excel.MergeCell(2, 0, 2, 2);
excel.SetRangeOuterBorder(2, 0, 2, 2, BorderStyle.Thin);
excel.SetCellValue(2, 0, "請假日期", 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.SetRowHeight(2, BodyRowHeight);
#endregion
#region
DateTime = ;
DateTime = .AddMonths(1).AddDays(-1);
var summarys = new List<Summary>()
{
new Summary() { Title = "補休" , RparTyps = new List<string>() { RPAR_TYPE.T00_補休 } },
new Summary() { Title = "特休" , RparTyps = new List<string>() { RPAR_TYPE.T01_特休 } } ,
new Summary() { Title = "事假" , RparTyps = new List<string>() { RPAR_TYPE.T02_事假 } },
new Summary() { Title = "病假" , RparTyps = new List<string>() { RPAR_TYPE.T03_病假 } },
new Summary() { Title = "喪假" , RparTyps = new List<string>() { RPAR_TYPE.T04_喪假 } },
new Summary() { Title = "產假" , RparTyps = new List<string>() { RPAR_TYPE.T05_產假 } },
new Summary() { Title = "婚假" , RparTyps = new List<string>() { RPAR_TYPE.T06_婚假 } },
new Summary() { Title = "陪產假" , RparTyps = new List<string>() { RPAR_TYPE.T07_陪產假 } },
new Summary() { Title = "公假(出)" , RparTyps = new List<string>() { RPAR_TYPE.T08_公假 } },
new Summary() { Title = "公傷假" , RparTyps = new List<string>() { RPAR_TYPE.T09_公傷假 } },
new Summary() { Title = "生理假" , RparTyps = new List<string>() { RPAR_TYPE.T0A_生理假 } },
new Summary() { Title = "家庭照顧假" , RparTyps = new List<string>() { RPAR_TYPE.T0B_家庭照顧假 } },
new Summary() { Title = "育嬰假" , RparTyps = new List<string>() { RPAR_TYPE.T0C_育嬰假 } },
new Summary() { Title = "原民祭儀假" , RparTyps = new List<string>() { RPAR_TYPE.T0D_原民祭儀假 } },
new Summary() { Title = "產檢假" , RparTyps = new List<string>() { RPAR_TYPE.T0E_產檢假 } },
new Summary() { Title = "其他假別(一)", RparTyps = new List<string>() { RPAR_TYPE.T0F_防疫照顧假,
RPAR_TYPE.T0G_無薪假,
RPAR_TYPE.T0H_防疫隔離假 } }
};
int = 0;
int rowId = 3;
foreach (DataRow r in .Tables[0].Rows)
{
DateTime = WDAC.GetDateTimeValue(r["RPRDT"]);
DateTime = WDAC.GetDateTimeValue(r["RPEDT"]);
string = WDAC.GetStringValue(r["RPRTM"]);
string = WDAC.GetStringValue(r["RPETM"]);
string = WDAC.GetStringValue(r["RPTYP"]);
if ( < )
{
= ;
= timeCalc.;
}
if ( > )
{
= ;
= timeCalc.;
}
//Double 時數 = WDAC.GetDoubleValue(r["RPTCT"]) / 60;
int = timeCalc.(WDAC.GetStringValue(.Tables[0].Rows[0]["RPNUM"]), , , , , , !);
+= ;
#region
var summary = summarys.FirstOrDefault(p => p.RparTyps.Contains());
if (summary != null) {
summary.Minutes += ;
}
#endregion
excel.SetCellValue(rowId, 0, .ToString("MM月dd日"), titleStyleCenter);
excel.SetCellValue(rowId, 1, "", titleStyleCenter);
excel.SetCellValue(rowId, 2, .ToString("MM月dd日"), titleStyleCenter);
excel.SetCellValue(rowId, 3, , titleStyleCenter);
excel.SetCellValue(rowId, 4, , titleStyleCenter);
excel.SetCellValue(rowId, 5, WDAC.GetStringValue(r["類別"]), titleStyleCenter);
excel.SetCellValue(rowId, 6, MinuteToTime(), titleStyleCenter);
excel.SetCellValue(rowId, 7, WDAC.GetStringValue(r["RPAGT"]), titleStyleCenter);
excel.SetCellValue(rowId, 8, WDAC.GetStringValue(r["RPRSN"]), bodyStyleCenterS);
excel.SetCellValue(rowId, 9, WDAC.GetStringValue(r["RPDOC"]), bodyStyleCenterS);
excel.SetRowHeight(rowId, BodyRowHeight);
rowId++;
}
#region
var summaryRows = summarys.Count + 1;
excel.MergeCell(rowId + 2, 2, rowId + summaryRows, 3);
excel.MergeCell(rowId + 2, 4, rowId + summaryRows, 4);
excel.MergeCell(rowId + 2, 5, rowId + summaryRows, 5);
excel.SetCellValue(rowId + 2, 2, "總請假時數:", titleStyleRightNoBorder);
excel.SetCellValue(rowId + 2, 4, MinuteToTime(), titleStyleCenterNoBorder);
excel.SetCellValue(rowId + 2, 5, "hrs", titleStyleLeftNoBorder);
excel.SetRangeOuterBorder(rowId + 2, 2, rowId + summaryRows, 5, BorderStyle.Thin);
var rr = 2;
foreach (var symmary in summarys)
{
excel.SetCellValue(rowId + rr, 6, symmary.Title + "", titleStyleLeftNoBorder);
excel.SetCellValue(rowId + rr, 7, MinuteToTime(symmary.Minutes), titleStyleCenterNoBorder);
excel.SetCellValue(rowId + rr, 8, "hrs", titleStyleLeftNoBorder);
excel.SetRangeOuterBorder(rowId + rr, 6, rowId + rr, 8, BorderStyle.Thin);
excel.SetRowHeight(rowId + rr, BodyRowHeight);
rr++;
}
rowId += summaryRows;
#endregion
#region
//excel.MergeCell(rowId + 10, 0, rowId + 10, 9);
//excel.SetCellValue(rowId + 10, 0, "申請人:             計畫督導:             人事單位:", titleStyleLeftNoBorder);
//excel.SetRowHeight(rowId + 10, BodyRowHeight);
//excel.MergeCell(rowId + 1, 1, rowId + 1, 3);
//excel.MergeCell(rowId + 2, 1, rowId + 2, 3);
//excel.SetCellValue(rowId + 1, 1, "申請人", titleStyleCenter);
//excel.SetRangeOuterBorder(rowId + 1, 1, rowId + 1, 3, BorderStyle.Thin);
//excel.SetRangeOuterBorder(rowId + 2, 1, rowId + 2, 3, BorderStyle.Thin);
//excel.MergeCell(rowId + 1, 4, rowId + 1, 6);
//excel.MergeCell(rowId + 2, 4, rowId + 2, 6);
//excel.SetCellValue(rowId + 1, 4, "公司計畫督導", titleStyleCenter);
//excel.SetRangeOuterBorder(rowId + 1, 4, rowId + 1, 6, BorderStyle.Thin);
//excel.SetRangeOuterBorder(rowId + 2, 4, rowId + 2, 6, BorderStyle.Thin);
//excel.MergeCell(rowId + 1, 7, rowId + 1, 8);
//excel.MergeCell(rowId + 2, 7, rowId + 2, 8);
//excel.SetCellValue(rowId + 1, 7, "公司計畫主持人", titleStyleCenter);
//excel.SetRangeOuterBorder(rowId + 1, 7, rowId + 1, 8, BorderStyle.Thin);
//excel.SetRangeOuterBorder(rowId + 2, 7, rowId + 2, 8, BorderStyle.Thin);
//excel.SetRowHeight(rowId + 1, BodyRowHeight);
//excel.SetRowHeight(rowId + 2, BodyRowHeight);
#endregion
#endregion
excel.SetColumnWidth(0, 11);
excel.SetColumnWidth(1, 4);
excel.SetColumnWidth(2, 11);
excel.SetColumnWidth(3, 11);
excel.SetColumnWidth(4, 11);
excel.SetColumnWidth(5, 11);
excel.SetColumnWidth(6, 18);
excel.SetColumnWidth(7, 12);
excel.SetColumnWidth(8, 20);
excel.SetColumnWidth(9, 15);
MemoryStream ms = new MemoryStream();
workbook.Write(ms);
return ms;
}
}
class Summary
{
public string Title;
public int Minutes;
public List<string> RparTyps;
}