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
+223
View File
@@ -0,0 +1,223 @@
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;
using System.Diagnostics.Eventing.Reader;
/// <summary>
/// 差勤日報表
/// </summary>
public class : ExcelReportBase
{
public ()
{
= "差勤日報表";
}
public DateTime { get; set; }
public DateTime { get; set; }
public List<ProjectEmployeeItem> Data { get; set; }
public List<Item> Data { get; set; }
public List<Item> Data { get; set; }
public List<Item> Data { get; set; }
public List<RASNBRHItem> { get; set; }
private RparDAC rparDao = new RparDAC();
public override MemoryStream ()
{
var groupIdList = new List<string>();
foreach (var in )
{
if (!groupIdList.Contains(.GroupID))
groupIdList.Add(.GroupID);
}
var row = 0;
foreach (var groupId in groupIdList)
{
var = .FindAll(p => p.GroupID.CompareTo(groupId) == 0);
var branchID = String.Join(",", (from in select .BranchID).ToArray());
var branchName = String.Join("+", (from in select .BranchName).ToArray());
row += (row, branchName, branchID) + 2;
}
excel.SetColumnWidth(0, 8);
excel.SetColumnWidth(1, 20);
excel.SetColumnWidth(2, 40);
excel.SetColumnWidth(3, 20);
excel.SetColumnWidth(4, 40);
excel.SetColumnWidth(5, 20);
excel.SetColumnWidth(6, 40);
excel.SetColumnWidth(7, 60);
excel.SetColumnWidth(8, 20);
MemoryStream ms = new MemoryStream();
workbook.Write(ms);
return ms;
}
public int (int startRow, string branchName, string branchID)
{
var rows = (startRow, branchName);
rows += (startRow + rows, branchID);
return rows;
}
public int (int startRow, string branchName)
{
excel.MergeCell(startRow + 0, 0, startRow + 1, 0);
excel.SetCellValue(startRow + 0, 0, "單位", titleStyleCenter);
excel.SetRangeOuterBorder(startRow + 0, 0, startRow + 1, 0, BorderStyle.Thin);
excel.MergeCell(startRow + 0, 1, startRow + 1, 1);
excel.SetCellValue(startRow + 0, 1, branchName, titleStyleCenter);
excel.SetRangeOuterBorder(startRow + 0, 1, startRow + 1, 1, BorderStyle.Thin);
excel.MergeCell(startRow + 0, 2, startRow + 0, 3);
excel.SetCellValue(startRow + 0, 2, String.Format("日期-{0:MM月dd日}", ), titleStyleCenter);
excel.SetRangeOuterBorder(startRow + 0, 2, startRow + 0, 3, BorderStyle.Thin);
excel.MergeCell(startRow + 1, 2, startRow + 1, 3);
excel.SetCellValue(startRow + 1, 2, "加班申請", titleStyleCenter);
excel.SetRangeOuterBorder(startRow + 1, 2, startRow + 1, 3, BorderStyle.Thin);
excel.MergeCell(startRow + 0, 4, startRow + 0, 7);
excel.SetCellValue(startRow + 0, 4, String.Format("日期-{0:MM月dd日}", ), titleStyleCenter);
excel.SetRangeOuterBorder(startRow + 0, 4, startRow + 0, 7, BorderStyle.Thin);
excel.MergeCell(startRow + 1, 4, startRow + 1, 5);
excel.SetCellValue(startRow + 1, 4, "請假申請", titleStyleCenter);
excel.SetRangeOuterBorder(startRow + 1, 4, startRow + 1, 5, BorderStyle.Thin);
excel.MergeCell(startRow + 1, 6, startRow + 1, 7);
excel.SetCellValue(startRow + 1, 6, "出差申請", titleStyleCenter);
excel.SetRangeOuterBorder(startRow + 1, 6, startRow + 1, 7, BorderStyle.Thin);
excel.MergeCell(startRow + 0, 8, startRow + 1, 8);
excel.SetCellValue(startRow + 0, 8, "備註說明", titleStyleCenter);
excel.SetRangeOuterBorder(startRow + 0, 8, startRow + 1, 8, BorderStyle.Thin);
excel.SetCellValue(startRow + 2, 0, "序號", titleStyleCenter);
excel.SetCellValue(startRow + 2, 1, "姓名", titleStyleCenter);
excel.SetCellValue(startRow + 2, 2, "起迄時間", titleStyleCenter);
excel.SetCellValue(startRow + 2, 3, "時數", titleStyleCenter);
excel.SetCellValue(startRow + 2, 4, "起迄時間", titleStyleCenter);
excel.SetCellValue(startRow + 2, 5, "假別/事由", titleStyleCenter);
excel.SetCellValue(startRow + 2, 6, "起迄時間", titleStyleCenter);
excel.SetCellValue(startRow + 2, 7, "地點", titleStyleCenter);
excel.SetCellValue(startRow + 2, 8, "剩餘補休時數", titleStyleCenter);
return 3;
}
public int (int startRow, string branchID)
{
int rows = 0;
var Data1 = Data.FindAll(p => branchID.Contains(p.BPBRH)).OrderBy(p => p.BPENO);
foreach (var Item in Data1)
{
excel.SetCellValue(startRow + rows, 0, rows + 1, bodyStyleCenter);
excel.SetCellValue(startRow + rows, 1, Item.BPNME, bodyStyleCenter);
var = "";
var = 0D;
foreach (var Item in Data.FindAll(p => p. == Item.BPENO).OrderBy(p => p.))
{
+= (.Length > 0 ? "\n" : "") + String.Format("{0:yyyy/MM/dd} {1}~{2}", Item., Item., Item.);
+= Item.;
}
excel.SetCellValue(startRow + rows, 2, , bodyStyleCenter);
if ( > 0)
excel.SetCellValue(startRow + rows, 3, (int), bodyStyleCenter);
else
excel.SetCellValue(startRow + rows, 3, "", bodyStyleCenter);
var = "";
var = "";
foreach (var Item in Data.FindAll(p => p. == Item.BPENO).OrderBy(p => p.))
{
+= (.Length > 0 ? "\n" : "")
+ (Item. == Item.
? String.Format("{0:yyyy/MM/dd} {1}~{2}", Item., Item., Item.)
: String.Format("{0:yyyy/MM/dd} {1}~{2:yyyy/MM/dd} {3}", Item., Item., Item., Item.));
+= (.Length > 0 ? "\n" : "") + Item.;
}
excel.SetCellValue(startRow + rows, 4, , bodyStyleCenter);
excel.SetCellValue(startRow + rows, 5, , bodyStyleCenter);
var = "";
var = "";
foreach (var Item in Data.FindAll(p => p. == Item.BPENO).OrderBy(p => p.))
{
+= (.Length > 0 ? "\n" : "")
+ (Item. == Item.
? String.Format("{0:yyyy/MM/dd} {1}~{2}", Item., Item., Item.)
: String.Format("{0:yyyy/MM/dd} {1}~{2:yyyy/MM/dd} {3}", Item., Item., Item., Item.));
+= (.Length > 0 ? "\n" : "") + Item.;
}
excel.SetCellValue(startRow + rows, 6, , bodyStyleCenter);
excel.SetCellValue(startRow + rows, 7, , bodyStyleCenter);
var = 0D;
var = "";
foreach (var Item in rparDao.(Item.BPENO))
{
+= Item. * 60 + Item.;
if ()
+= (.Length > 0 ? "\n" : "")
+ String.Format("{0}:{1:00} {2:yyyy/MM/dd}", Item., Item., Item.);
else
+= (.Length > 0 ? "\n" : "")
+ String.Format("{0}H {1:yyyy/MM/dd}", Item., Item.);
}
if ( > 0) {
if ()
excel.SetCellValue(startRow + rows, 8, String.Format("{0}:{1:00}\n{2}", (int) / 60, (int) % 60, ), bodyStyleCenter);
else
excel.SetCellValue(startRow + rows, 8, String.Format("{0}H\n{1}", (int) / 60, ), bodyStyleCenter);
}
else
excel.SetCellValue(startRow + rows, 8, "", bodyStyleCenter);
excel.SetRowHeight(startRow + rows, 35);
rows++;
}
excel.SetCellValue(startRow + rows, 0, "小計", bodyStyleCenter);
excel.SetCellValue(startRow + rows, 1, String.Format("共 {0} 位", Data1.ToList().Count), bodyStyleCenter);
excel.SetCellValue(startRow + rows, 2, "總申請時數", bodyStyleCenter);
if (Data1.ToList().Count > 0)
excel.SetCellFormula(startRow + rows, 3, String.Format("SUM({0}:{1})", excel.RCtoA1(startRow, 3), excel.RCtoA1(startRow + rows - 1, 3)) , bodyStyleCenter);
else
excel.SetCellValue(startRow + rows, 3, 0, bodyStyleCenter);
excel.SetCellValue(startRow + rows, 4, "", bodyStyleCenter);
excel.SetCellValue(startRow + rows, 5, "", bodyStyleCenter);
excel.SetCellValue(startRow + rows, 6, "", bodyStyleCenter);
excel.SetCellValue(startRow + rows, 7, "", bodyStyleCenter);
excel.SetCellValue(startRow + rows, 8, "", bodyStyleCenter);
rows++;
return rows;
}
}