From f719a1a22f3a9e15df2b62984cf3899397d415ba Mon Sep 17 00:00:00 2001 From: kamonwan taengsuk Date: Thu, 15 Jun 2023 17:10:32 +0700 Subject: [PATCH] fixed --- Controllers/Personnel.Controller.cs | 612 +++++++++++++++------------- 1 file changed, 320 insertions(+), 292 deletions(-) diff --git a/Controllers/Personnel.Controller.cs b/Controllers/Personnel.Controller.cs index 1bd002f..5780461 100644 --- a/Controllers/Personnel.Controller.cs +++ b/Controllers/Personnel.Controller.cs @@ -5662,271 +5662,294 @@ namespace rmutr_report.Controllers foreach (var detail2 in detail.personnel_expense_budget_details_2) { - if (detail2.is_header==true) + if (detail2.is_header == true) { - - ws.Cell(row + 1, 1).Value = "ส่วนที่ 2 เงินเพิ่มอื่นที่จ่ายควบกับเงินเดือน"; - ws.Cell(row + 1, 1).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; - ws.Cell(row + 1, 1).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - ws.Cell(row + 1, 1).Style.Font.FontName = "TH SarabunPSK"; - ws.Cell(row + 1, 1).Style.Font.SetBold().Font.FontSize = 16; - ws.Cell(row + 1, 4).Value = "งบประมาณ"; - ws.Cell(row + 1, 4).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; - ws.Cell(row + 1, 4).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - ws.Cell(row + 1, 4).Style.Font.FontName = "TH SarabunPSK"; - ws.Cell(row + 1, 4).Style.Font.SetBold().Font.FontSize = 16; - ws.Cell(row + 1, 6).Value = personnel.other_additional; - ws.Cell(row + 1, 6).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; - ws.Cell(row + 1, 6).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - ws.Cell(row + 1, 6).Style.Font.FontName = "TH SarabunPSK"; - ws.Cell(row + 1, 6).Style.Font.SetBold().Font.FontSize = 16; + ws.Cell(row + 1, 1).Value = "ส่วนที่ 2 เงินเพิ่มอื่นที่จ่ายควบกับเงินเดือน"; + ws.Cell(row + 1, 1).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; + ws.Cell(row + 1, 1).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell(row + 1, 1).Style.Font.FontName = "TH SarabunPSK"; + ws.Cell(row + 1, 1).Style.Font.SetBold().Font.FontSize = 16; + ws.Cell(row + 1, 4).Value = "งบประมาณ"; + ws.Cell(row + 1, 4).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; + ws.Cell(row + 1, 4).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell(row + 1, 4).Style.Font.FontName = "TH SarabunPSK"; + ws.Cell(row + 1, 4).Style.Font.SetBold().Font.FontSize = 16; + ws.Cell(row + 1, 6).Value = personnel.other_additional; + ws.Cell(row + 1, 6).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell(row + 1, 6).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell(row + 1, 6).Style.Font.FontName = "TH SarabunPSK"; + ws.Cell(row + 1, 6).Style.Font.SetBold().Font.FontSize = 16; - ws.Cell(row + 1, 7).Value = "ล้านบาท"; - ws.Cell(row + 1, 7).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; - ws.Cell(row + 1, 7).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - ws.Cell(row + 1, 7).Style.Font.FontName = "TH SarabunPSK"; - ws.Cell(row + 1, 7).Style.Font.SetBold().Font.FontSize = 16; - ws.Cell(row + 1, 19).Value = "หน่วย : ล้านบาท (ทศนิยม 4 ตำแหน่ง)"; - ws.Cell(row + 1, 19).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; - ws.Cell(row + 1, 19).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - ws.Cell(row + 1, 19).Style.Font.FontName = "TH SarabunPSK"; - ws.Cell(row + 1, 19).Style.Font.SetBold().Font.FontSize = 16; + ws.Cell(row + 1, 7).Value = "ล้านบาท"; + ws.Cell(row + 1, 7).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; + ws.Cell(row + 1, 7).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell(row + 1, 7).Style.Font.FontName = "TH SarabunPSK"; + ws.Cell(row + 1, 7).Style.Font.SetBold().Font.FontSize = 16; + ws.Cell(row + 1, 19).Value = "หน่วย : ล้านบาท (ทศนิยม 4 ตำแหน่ง)"; + ws.Cell(row + 1, 19).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; + ws.Cell(row + 1, 19).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell(row + 1, 19).Style.Font.FontName = "TH SarabunPSK"; + ws.Cell(row + 1, 19).Style.Font.SetBold().Font.FontSize = 16; - ws.Cell(row + 3, 1).Value = "ประเภท"; - ws.Cell(row + 3, 1).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; - ws.Cell(row + 3, 1).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - ws.Cell(row + 3, 1).Style.Font.FontName = "TH SarabunPSK"; - ws.Cell(row + 3, 1).Style.Font.SetBold().Font.FontSize = 16; - ws.Cell(row + 2, 1).Style.Fill.BackgroundColor = XLColor.FromArgb(214, 220, 228); - ws.Cell(row + 3, 1).Style.Fill.BackgroundColor = XLColor.FromArgb(214, 220, 228); - ws.Cell(row + 4, 1).Style.Fill.BackgroundColor = XLColor.FromArgb(214, 220, 228); - ws.Cell(row + 4, 1).Style.Border.BottomBorder = XLBorderStyleValues.Thin; - ws.Cell(row + 2, 1).Style.Border.TopBorder = XLBorderStyleValues.Thin; + ws.Cell(row + 3, 1).Value = "ประเภท"; + ws.Cell(row + 3, 1).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell(row + 3, 1).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell(row + 3, 1).Style.Font.FontName = "TH SarabunPSK"; + ws.Cell(row + 3, 1).Style.Font.SetBold().Font.FontSize = 16; + ws.Cell(row + 2, 1).Style.Fill.BackgroundColor = XLColor.FromArgb(214, 220, 228); + ws.Cell(row + 3, 1).Style.Fill.BackgroundColor = XLColor.FromArgb(214, 220, 228); + ws.Cell(row + 4, 1).Style.Fill.BackgroundColor = XLColor.FromArgb(214, 220, 228); + ws.Cell(row + 4, 1).Style.Border.BottomBorder = XLBorderStyleValues.Thin; + ws.Cell(row + 2, 1).Style.Border.TopBorder = XLBorderStyleValues.Thin; - ws.Cell(row + 3, 3).Value = "รายการ"; - ws.Cell(row + 3, 3).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; - ws.Cell(row + 3, 3).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - ws.Cell(row + 3, 3).Style.Font.FontName = "TH SarabunPSK"; - ws.Cell(row + 3, 3).Style.Font.SetBold().Font.FontSize = 16; - ws.Cell(row + 2, 2).Style.Fill.BackgroundColor = XLColor.FromArgb(172, 185, 202); - ws.Cell(row + 2, 3).Style.Fill.BackgroundColor = XLColor.FromArgb(172, 185, 202); - ws.Cell(row + 2, 4).Style.Fill.BackgroundColor = XLColor.FromArgb(172, 185, 202); - ws.Cell(row + 3, 2).Style.Fill.BackgroundColor = XLColor.FromArgb(172, 185, 202); - ws.Cell(row + 3, 3).Style.Fill.BackgroundColor = XLColor.FromArgb(172, 185, 202); - ws.Cell(row + 3, 4).Style.Fill.BackgroundColor = XLColor.FromArgb(172, 185, 202); - ws.Cell(row + 4, 2).Style.Fill.BackgroundColor = XLColor.FromArgb(172, 185, 202); - ws.Cell(row + 4, 3).Style.Fill.BackgroundColor = XLColor.FromArgb(172, 185, 202); - ws.Cell(row + 4, 4).Style.Fill.BackgroundColor = XLColor.FromArgb(172, 185, 202); - ws.Cell(row + 4, 3).Style.Border.BottomBorder = XLBorderStyleValues.Thin; - ws.Cell(row + 2, 2).Style.Border.TopBorder = XLBorderStyleValues.Thin; - ws.Cell(row + 2, 3).Style.Border.TopBorder = XLBorderStyleValues.Thin; - ws.Cell(row + 2, 4).Style.Border.TopBorder = XLBorderStyleValues.Thin; - ws.Range(ws.Cell(row + 2, 5), ws.Cell(row + 2, 8)).Merge().Value = "งปม. 2566"; - ws.Range(ws.Cell(row + 2, 5), ws.Cell(row + 2, 8)).Style.Alignment.Horizontal = - XLAlignmentHorizontalValues.Center; - ws.Range(ws.Cell(row + 2, 5), ws.Cell(row + 2, 8)).Style.Alignment.Vertical = - XLAlignmentVerticalValues.Center; - ws.Range(ws.Cell(row + 2, 5), ws.Cell(row + 2, 8)).Style.Font.FontName = "TH SarabunPSK"; - ws.Range(ws.Cell(row + 2, 5), ws.Cell(row + 2, 8)).Style.Font.SetBold().Font.FontSize = 16; - ws.Range(ws.Cell(row + 2, 5), ws.Cell(row + 2, 8)).Style.Fill.BackgroundColor = - XLColor.FromArgb(214, 220, 228); - ws.Range(ws.Cell(row + 2, 5), ws.Cell(row + 2, 8)).Style.Border.OutsideBorder = - XLBorderStyleValues.Thin; - ws.Range(ws.Cell(row + 3, 5), ws.Cell(row + 3, 6)).Merge().Value = "คำขอ"; - ws.Range(ws.Cell(row + 3, 5), ws.Cell(row + 3, 6)).Style.Alignment.Horizontal = - XLAlignmentHorizontalValues.Center; - ws.Range(ws.Cell(row + 3, 5), ws.Cell(row + 3, 6)).Style.Alignment.Vertical = - XLAlignmentVerticalValues.Center; - ws.Range(ws.Cell(row + 3, 5), ws.Cell(row + 3, 6)).Style.Font.FontName = "TH SarabunPSK"; - ws.Range(ws.Cell(row + 3, 5), ws.Cell(row + 3, 6)).Style.Font.SetBold().Font.FontSize = 16; - ws.Range(ws.Cell(row + 3, 5), ws.Cell(row + 3, 6)).Style.Fill.BackgroundColor = - XLColor.FromArgb(214, 220, 228); - ws.Range(ws.Cell(row + 3, 5), ws.Cell(row + 3, 6)).Style.Border.OutsideBorder = - XLBorderStyleValues.Thin; - ws.Range(ws.Cell(row + 3, 7), ws.Cell(row + 3, 8)).Merge().Value = "ข้อเสนอ"; - ws.Range(ws.Cell(row + 3, 7), ws.Cell(row + 3, 8)).Style.Alignment.Horizontal = - XLAlignmentHorizontalValues.Center; - ws.Range(ws.Cell(row + 3, 7), ws.Cell(row + 3, 8)).Style.Alignment.Vertical = - XLAlignmentVerticalValues.Center; - ws.Range(ws.Cell(row + 3, 7), ws.Cell(row + 3, 8)).Style.Font.FontName = "TH SarabunPSK"; - ws.Range(ws.Cell(row + 3, 7), ws.Cell(row + 3, 8)).Style.Font.SetBold().Font.FontSize = 16; - ws.Range(ws.Cell(row + 3, 7), ws.Cell(row + 3, 8)).Style.Fill.BackgroundColor = - XLColor.FromArgb(214, 220, 228); - ws.Range(ws.Cell(row + 3, 7), ws.Cell(row + 3, 8)).Style.Border.OutsideBorder = - XLBorderStyleValues.Thin; - ws.Cell(row + 4, 5).Value = "อัตรา"; - ws.Cell(row + 4, 5).Style.Alignment.Horizontal = - XLAlignmentHorizontalValues.Center; - ws.Cell(row + 4, 5).Style.Alignment.Vertical = - XLAlignmentVerticalValues.Center; - ws.Cell(row + 4, 5).Style.Font.FontName = "TH SarabunPSK"; - ws.Cell(row + 4, 5).Style.Font.SetBold().Font.FontSize = 16; - ws.Cell(row + 4, 5).Style.Fill.BackgroundColor = - XLColor.FromArgb(214, 220, 228); - ws.Cell(row + 4, 5).Style.Border.OutsideBorder = - XLBorderStyleValues.Thin; - ws.Cell(row + 4, 6).Value = "งบประมาณ"; - ws.Cell(row + 4, 6).Style.Alignment.Horizontal = - XLAlignmentHorizontalValues.Center; - ws.Cell(row + 4, 6).Style.Alignment.Vertical = - XLAlignmentVerticalValues.Center; - ws.Cell(row + 4, 6).Style.Font.FontName = "TH SarabunPSK"; - ws.Cell(row + 4, 6).Style.Font.SetBold().Font.FontSize = 16; - ws.Cell(row + 4, 6).Style.Fill.BackgroundColor = - XLColor.FromArgb(214, 220, 228); - ws.Cell(row + 4, 6).Style.Border.OutsideBorder = - XLBorderStyleValues.Thin; - ws.Cell(row + 4, 7).Value = "อัตรา"; - ws.Cell(row + 4, 7).Style.Alignment.Horizontal = - XLAlignmentHorizontalValues.Center; - ws.Cell(row + 4, 7).Style.Alignment.Vertical = - XLAlignmentVerticalValues.Center; - ws.Cell(row + 4, 7).Style.Font.FontName = "TH SarabunPSK"; - ws.Cell(row + 4, 7).Style.Font.SetBold().Font.FontSize = 16; - ws.Cell(row + 4, 7).Style.Fill.BackgroundColor = - XLColor.FromArgb(214, 220, 228); - ws.Cell(row + 4, 7).Style.Border.OutsideBorder = - XLBorderStyleValues.Thin; - ws.Cell(row + 4, 8).Value = "งบประมาณ"; - ws.Cell(row + 4, 8).Style.Alignment.Horizontal = - XLAlignmentHorizontalValues.Center; - ws.Cell(row + 4, 8).Style.Alignment.Vertical = - XLAlignmentVerticalValues.Center; - ws.Cell(row + 4, 8).Style.Font.FontName = "TH SarabunPSK"; - ws.Cell(row + 4, 8).Style.Font.SetBold().Font.FontSize = 16; - ws.Cell(row + 4, 8).Style.Fill.BackgroundColor = - XLColor.FromArgb(214, 220, 228); - ws.Cell(row + 4, 8).Style.Border.OutsideBorder = - XLBorderStyleValues.Thin; - ws.Range(ws.Cell(row + 2, 9), ws.Cell(row + 2, 14)).Merge().Value = "MTEF"; - ws.Range(ws.Cell(row + 2, 9), ws.Cell(row + 2, 14)).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; - ws.Range(ws.Cell(row + 2, 9), ws.Cell(row + 2, 14)).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - ws.Range(ws.Cell(row + 2, 9), ws.Cell(row + 2, 14)).Style.Font.FontName = "TH SarabunPSK"; - ws.Range(ws.Cell(row + 2, 9), ws.Cell(row + 2, 14)).Style.Font.SetBold().Font.FontSize = 16; - ws.Range(ws.Cell(row + 2, 9), ws.Cell(row + 2, 14)).Style.Fill.BackgroundColor = XLColor.FromArgb(172, 185, 202); - ws.Range(ws.Cell(row + 2, 9), ws.Cell(row + 2, 14)).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - - ws.Range(ws.Cell(row + 3, 9), ws.Cell(row + 3, 10)).Merge().Value = "2567"; - ws.Range(ws.Cell(row + 3, 9), ws.Cell(row + 3, 10)).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; - ws.Range(ws.Cell(row + 3, 9), ws.Cell(row + 3, 10)).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - ws.Range(ws.Cell(row + 3, 9), ws.Cell(row + 3, 10)).Style.Font.FontName = "TH SarabunPSK"; - ws.Range(ws.Cell(row + 3, 9), ws.Cell(row + 3, 10)).Style.Font.SetBold().Font.FontSize = 16; - ws.Range(ws.Cell(row + 3, 9), ws.Cell(row + 3, 10)).Style.Fill.BackgroundColor = XLColor.FromArgb(172, 185, 202); - ws.Range(ws.Cell(row + 3, 9), ws.Cell(row + 3, 10)).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - - ws.Range(ws.Cell(row + 3, 11), ws.Cell(row + 3, 12)).Merge().Value = "2568"; - ws.Range(ws.Cell(row + 3, 11), ws.Cell(row + 3, 12)).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; - ws.Range(ws.Cell(row + 3, 11), ws.Cell(row + 3, 12)).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - ws.Range(ws.Cell(row + 3, 11), ws.Cell(row + 3, 12)).Style.Font.FontName = "TH SarabunPSK"; - ws.Range(ws.Cell(row + 3, 11), ws.Cell(row + 3, 12)).Style.Font.SetBold().Font.FontSize = 16; - ws.Range(ws.Cell(row + 3, 11), ws.Cell(row + 3, 12)).Style.Fill.BackgroundColor = XLColor.FromArgb(172, 185, 202); - ws.Range(ws.Cell(row + 3,11), ws.Cell(row + 3, 12)).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - ws.Range(ws.Cell(row + 3, 13), ws.Cell(row + 3, 14)).Merge().Value = "2569"; - ws.Range(ws.Cell(row + 3, 13), ws.Cell(row + 3, 14)).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; - ws.Range(ws.Cell(row + 3, 13), ws.Cell(row + 3, 14)).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - ws.Range(ws.Cell(row + 3, 13), ws.Cell(row + 3, 14)).Style.Font.FontName = "TH SarabunPSK"; - ws.Range(ws.Cell(row + 3, 13), ws.Cell(row + 3, 14)).Style.Font.SetBold().Font.FontSize = 16; - ws.Range(ws.Cell(row + 3, 13), ws.Cell(row + 3, 14)).Style.Fill.BackgroundColor = XLColor.FromArgb(172, 185, 202); - ws.Range(ws.Cell(row + 3,13), ws.Cell(row + 3, 14)).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - - ws.Cell(row + 4, 9).Value = "อัตรา"; - ws.Cell(row + 4, 9).Style.Alignment.Horizontal = - XLAlignmentHorizontalValues.Center; - ws.Cell(row + 4, 9).Style.Alignment.Vertical = - XLAlignmentVerticalValues.Center; - ws.Cell(row + 4, 9).Style.Font.FontName = "TH SarabunPSK"; - ws.Cell(row + 4, 9).Style.Font.SetBold().Font.FontSize = 16; - ws.Cell(row + 4, 9).Style.Fill.BackgroundColor = - XLColor.FromArgb(172, 185, 202); - ws.Cell(row + 4, 9).Style.Border.OutsideBorder = - XLBorderStyleValues.Thin; - ws.Cell(row + 4, 10).Value = "งบประมาณ"; - ws.Cell(row + 4, 10).Style.Alignment.Horizontal = - XLAlignmentHorizontalValues.Center; - ws.Cell(row + 4, 10).Style.Alignment.Vertical = - XLAlignmentVerticalValues.Center; - ws.Cell(row + 4, 10).Style.Font.FontName = "TH SarabunPSK"; - ws.Cell(row + 4, 10).Style.Font.SetBold().Font.FontSize = 16; - ws.Cell(row + 4, 10).Style.Fill.BackgroundColor = - XLColor.FromArgb(172, 185, 202); - ws.Cell(row + 4, 10).Style.Border.OutsideBorder = - XLBorderStyleValues.Thin; - ws.Cell(row + 4, 11).Value = "อัตรา"; - ws.Cell(row + 4, 11).Style.Alignment.Horizontal = - XLAlignmentHorizontalValues.Center; - ws.Cell(row + 4, 11).Style.Alignment.Vertical = - XLAlignmentVerticalValues.Center; - ws.Cell(row + 4, 11).Style.Font.FontName = "TH SarabunPSK"; - ws.Cell(row + 4, 11).Style.Font.SetBold().Font.FontSize = 16; - ws.Cell(row + 4, 11).Style.Fill.BackgroundColor = - XLColor.FromArgb(172, 185, 202); - ws.Cell(row + 4, 11).Style.Border.OutsideBorder = - XLBorderStyleValues.Thin; - ws.Cell(row + 4, 12).Value = "งบประมาณ"; - ws.Cell(row + 4, 12).Style.Alignment.Horizontal = - XLAlignmentHorizontalValues.Center; - ws.Cell(row + 4, 12).Style.Alignment.Vertical = - XLAlignmentVerticalValues.Center; - ws.Cell(row + 4, 12).Style.Font.FontName = "TH SarabunPSK"; - ws.Cell(row + 4, 12).Style.Font.SetBold().Font.FontSize = 16; - ws.Cell(row + 4, 12).Style.Fill.BackgroundColor = - XLColor.FromArgb(172, 185, 202); - ws.Cell(row + 4, 12).Style.Border.OutsideBorder = - XLBorderStyleValues.Thin; - ws.Cell(row + 4, 13).Value = "อัตรา"; - ws.Cell(row + 4, 13).Style.Alignment.Horizontal = - XLAlignmentHorizontalValues.Center; - ws.Cell(row + 4, 13).Style.Alignment.Vertical = - XLAlignmentVerticalValues.Center; - ws.Cell(row + 4, 13).Style.Font.FontName = "TH SarabunPSK"; - ws.Cell(row + 4, 13).Style.Font.SetBold().Font.FontSize = 16; - ws.Cell(row + 4, 13).Style.Fill.BackgroundColor = - XLColor.FromArgb(172, 185, 202); - ws.Cell(row + 4, 13).Style.Border.OutsideBorder = - XLBorderStyleValues.Thin; - ws.Cell(row + 4, 14).Value = "งบประมาณ"; - ws.Cell(row + 4, 14).Style.Alignment.Horizontal = - XLAlignmentHorizontalValues.Center; - ws.Cell(row + 4, 14).Style.Alignment.Vertical = - XLAlignmentVerticalValues.Center; - ws.Cell(row + 4, 14).Style.Font.FontName = "TH SarabunPSK"; - ws.Cell(row + 4, 14).Style.Font.SetBold().Font.FontSize = 16; - ws.Cell(row + 4, 14).Style.Fill.BackgroundColor = - XLColor.FromArgb(172, 185, 202); - ws.Cell(row + 4, 14).Style.Border.OutsideBorder = - XLBorderStyleValues.Thin; - ws.Range(ws.Cell(row + 2, 15), ws.Cell(row + 4, 19)).Merge().Value = "คำชี้แจง"; - ws.Range(ws.Cell(row + 2, 15), ws.Cell(row + 4, 19)).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; - ws.Range(ws.Cell(row + 2, 15), ws.Cell(row + 4, 19)).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - ws.Range(ws.Cell(row + 2, 15), ws.Cell(row + 4, 19)).Style.Font.FontName = "TH SarabunPSK"; - ws.Range(ws.Cell(row + 2, 15), ws.Cell(row + 4, 19)).Style.Font.SetBold().Font.FontSize = 16; - ws.Range(ws.Cell(row + 2, 15), ws.Cell(row + 4, 19)).Style.Fill.BackgroundColor = XLColor.FromArgb(214, 220, 228); - ws.Range(ws.Cell(row + 2, 15), ws.Cell(row + 4, 19)).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row + 3, 3).Value = "รายการ"; + ws.Cell(row + 3, 3).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell(row + 3, 3).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell(row + 3, 3).Style.Font.FontName = "TH SarabunPSK"; + ws.Cell(row + 3, 3).Style.Font.SetBold().Font.FontSize = 16; + ws.Cell(row + 2, 2).Style.Fill.BackgroundColor = XLColor.FromArgb(172, 185, 202); + ws.Cell(row + 2, 3).Style.Fill.BackgroundColor = XLColor.FromArgb(172, 185, 202); + ws.Cell(row + 2, 4).Style.Fill.BackgroundColor = XLColor.FromArgb(172, 185, 202); + ws.Cell(row + 3, 2).Style.Fill.BackgroundColor = XLColor.FromArgb(172, 185, 202); + ws.Cell(row + 3, 3).Style.Fill.BackgroundColor = XLColor.FromArgb(172, 185, 202); + ws.Cell(row + 3, 4).Style.Fill.BackgroundColor = XLColor.FromArgb(172, 185, 202); + ws.Cell(row + 4, 2).Style.Fill.BackgroundColor = XLColor.FromArgb(172, 185, 202); + ws.Cell(row + 4, 3).Style.Fill.BackgroundColor = XLColor.FromArgb(172, 185, 202); + ws.Cell(row + 4, 4).Style.Fill.BackgroundColor = XLColor.FromArgb(172, 185, 202); + ws.Cell(row + 4, 3).Style.Border.BottomBorder = XLBorderStyleValues.Thin; + ws.Cell(row + 2, 2).Style.Border.TopBorder = XLBorderStyleValues.Thin; + ws.Cell(row + 2, 3).Style.Border.TopBorder = XLBorderStyleValues.Thin; + ws.Cell(row + 2, 4).Style.Border.TopBorder = XLBorderStyleValues.Thin; + ws.Range(ws.Cell(row + 2, 5), ws.Cell(row + 2, 8)).Merge().Value = "งปม. 2566"; + ws.Range(ws.Cell(row + 2, 5), ws.Cell(row + 2, 8)).Style.Alignment.Horizontal = + XLAlignmentHorizontalValues.Center; + ws.Range(ws.Cell(row + 2, 5), ws.Cell(row + 2, 8)).Style.Alignment.Vertical = + XLAlignmentVerticalValues.Center; + ws.Range(ws.Cell(row + 2, 5), ws.Cell(row + 2, 8)).Style.Font.FontName = "TH SarabunPSK"; + ws.Range(ws.Cell(row + 2, 5), ws.Cell(row + 2, 8)).Style.Font.SetBold().Font.FontSize = 16; + ws.Range(ws.Cell(row + 2, 5), ws.Cell(row + 2, 8)).Style.Fill.BackgroundColor = + XLColor.FromArgb(214, 220, 228); + ws.Range(ws.Cell(row + 2, 5), ws.Cell(row + 2, 8)).Style.Border.OutsideBorder = + XLBorderStyleValues.Thin; + ws.Range(ws.Cell(row + 3, 5), ws.Cell(row + 3, 6)).Merge().Value = "คำขอ"; + ws.Range(ws.Cell(row + 3, 5), ws.Cell(row + 3, 6)).Style.Alignment.Horizontal = + XLAlignmentHorizontalValues.Center; + ws.Range(ws.Cell(row + 3, 5), ws.Cell(row + 3, 6)).Style.Alignment.Vertical = + XLAlignmentVerticalValues.Center; + ws.Range(ws.Cell(row + 3, 5), ws.Cell(row + 3, 6)).Style.Font.FontName = "TH SarabunPSK"; + ws.Range(ws.Cell(row + 3, 5), ws.Cell(row + 3, 6)).Style.Font.SetBold().Font.FontSize = 16; + ws.Range(ws.Cell(row + 3, 5), ws.Cell(row + 3, 6)).Style.Fill.BackgroundColor = + XLColor.FromArgb(214, 220, 228); + ws.Range(ws.Cell(row + 3, 5), ws.Cell(row + 3, 6)).Style.Border.OutsideBorder = + XLBorderStyleValues.Thin; + ws.Range(ws.Cell(row + 3, 7), ws.Cell(row + 3, 8)).Merge().Value = "ข้อเสนอ"; + ws.Range(ws.Cell(row + 3, 7), ws.Cell(row + 3, 8)).Style.Alignment.Horizontal = + XLAlignmentHorizontalValues.Center; + ws.Range(ws.Cell(row + 3, 7), ws.Cell(row + 3, 8)).Style.Alignment.Vertical = + XLAlignmentVerticalValues.Center; + ws.Range(ws.Cell(row + 3, 7), ws.Cell(row + 3, 8)).Style.Font.FontName = "TH SarabunPSK"; + ws.Range(ws.Cell(row + 3, 7), ws.Cell(row + 3, 8)).Style.Font.SetBold().Font.FontSize = 16; + ws.Range(ws.Cell(row + 3, 7), ws.Cell(row + 3, 8)).Style.Fill.BackgroundColor = + XLColor.FromArgb(214, 220, 228); + ws.Range(ws.Cell(row + 3, 7), ws.Cell(row + 3, 8)).Style.Border.OutsideBorder = + XLBorderStyleValues.Thin; + ws.Cell(row + 4, 5).Value = "อัตรา"; + ws.Cell(row + 4, 5).Style.Alignment.Horizontal = + XLAlignmentHorizontalValues.Center; + ws.Cell(row + 4, 5).Style.Alignment.Vertical = + XLAlignmentVerticalValues.Center; + ws.Cell(row + 4, 5).Style.Font.FontName = "TH SarabunPSK"; + ws.Cell(row + 4, 5).Style.Font.SetBold().Font.FontSize = 16; + ws.Cell(row + 4, 5).Style.Fill.BackgroundColor = + XLColor.FromArgb(214, 220, 228); + ws.Cell(row + 4, 5).Style.Border.OutsideBorder = + XLBorderStyleValues.Thin; + ws.Cell(row + 4, 6).Value = "งบประมาณ"; + ws.Cell(row + 4, 6).Style.Alignment.Horizontal = + XLAlignmentHorizontalValues.Center; + ws.Cell(row + 4, 6).Style.Alignment.Vertical = + XLAlignmentVerticalValues.Center; + ws.Cell(row + 4, 6).Style.Font.FontName = "TH SarabunPSK"; + ws.Cell(row + 4, 6).Style.Font.SetBold().Font.FontSize = 16; + ws.Cell(row + 4, 6).Style.Fill.BackgroundColor = + XLColor.FromArgb(214, 220, 228); + ws.Cell(row + 4, 6).Style.Border.OutsideBorder = + XLBorderStyleValues.Thin; + ws.Cell(row + 4, 7).Value = "อัตรา"; + ws.Cell(row + 4, 7).Style.Alignment.Horizontal = + XLAlignmentHorizontalValues.Center; + ws.Cell(row + 4, 7).Style.Alignment.Vertical = + XLAlignmentVerticalValues.Center; + ws.Cell(row + 4, 7).Style.Font.FontName = "TH SarabunPSK"; + ws.Cell(row + 4, 7).Style.Font.SetBold().Font.FontSize = 16; + ws.Cell(row + 4, 7).Style.Fill.BackgroundColor = + XLColor.FromArgb(214, 220, 228); + ws.Cell(row + 4, 7).Style.Border.OutsideBorder = + XLBorderStyleValues.Thin; + ws.Cell(row + 4, 8).Value = "งบประมาณ"; + ws.Cell(row + 4, 8).Style.Alignment.Horizontal = + XLAlignmentHorizontalValues.Center; + ws.Cell(row + 4, 8).Style.Alignment.Vertical = + XLAlignmentVerticalValues.Center; + ws.Cell(row + 4, 8).Style.Font.FontName = "TH SarabunPSK"; + ws.Cell(row + 4, 8).Style.Font.SetBold().Font.FontSize = 16; + ws.Cell(row + 4, 8).Style.Fill.BackgroundColor = + XLColor.FromArgb(214, 220, 228); + ws.Cell(row + 4, 8).Style.Border.OutsideBorder = + XLBorderStyleValues.Thin; + ws.Range(ws.Cell(row + 2, 9), ws.Cell(row + 2, 14)).Merge().Value = "MTEF"; + ws.Range(ws.Cell(row + 2, 9), ws.Cell(row + 2, 14)).Style.Alignment.Horizontal = + XLAlignmentHorizontalValues.Center; + ws.Range(ws.Cell(row + 2, 9), ws.Cell(row + 2, 14)).Style.Alignment.Vertical = + XLAlignmentVerticalValues.Center; + ws.Range(ws.Cell(row + 2, 9), ws.Cell(row + 2, 14)).Style.Font.FontName = "TH SarabunPSK"; + ws.Range(ws.Cell(row + 2, 9), ws.Cell(row + 2, 14)).Style.Font.SetBold().Font.FontSize = 16; + ws.Range(ws.Cell(row + 2, 9), ws.Cell(row + 2, 14)).Style.Fill.BackgroundColor = + XLColor.FromArgb(172, 185, 202); + ws.Range(ws.Cell(row + 2, 9), ws.Cell(row + 2, 14)).Style.Border.OutsideBorder = + XLBorderStyleValues.Thin; + ws.Range(ws.Cell(row + 3, 9), ws.Cell(row + 3, 10)).Merge().Value = "2567"; + ws.Range(ws.Cell(row + 3, 9), ws.Cell(row + 3, 10)).Style.Alignment.Horizontal = + XLAlignmentHorizontalValues.Center; + ws.Range(ws.Cell(row + 3, 9), ws.Cell(row + 3, 10)).Style.Alignment.Vertical = + XLAlignmentVerticalValues.Center; + ws.Range(ws.Cell(row + 3, 9), ws.Cell(row + 3, 10)).Style.Font.FontName = "TH SarabunPSK"; + ws.Range(ws.Cell(row + 3, 9), ws.Cell(row + 3, 10)).Style.Font.SetBold().Font.FontSize = 16; + ws.Range(ws.Cell(row + 3, 9), ws.Cell(row + 3, 10)).Style.Fill.BackgroundColor = + XLColor.FromArgb(172, 185, 202); + ws.Range(ws.Cell(row + 3, 9), ws.Cell(row + 3, 10)).Style.Border.OutsideBorder = + XLBorderStyleValues.Thin; + + ws.Range(ws.Cell(row + 3, 11), ws.Cell(row + 3, 12)).Merge().Value = "2568"; + ws.Range(ws.Cell(row + 3, 11), ws.Cell(row + 3, 12)).Style.Alignment.Horizontal = + XLAlignmentHorizontalValues.Center; + ws.Range(ws.Cell(row + 3, 11), ws.Cell(row + 3, 12)).Style.Alignment.Vertical = + XLAlignmentVerticalValues.Center; + ws.Range(ws.Cell(row + 3, 11), ws.Cell(row + 3, 12)).Style.Font.FontName = "TH SarabunPSK"; + ws.Range(ws.Cell(row + 3, 11), ws.Cell(row + 3, 12)).Style.Font.SetBold().Font.FontSize = + 16; + ws.Range(ws.Cell(row + 3, 11), ws.Cell(row + 3, 12)).Style.Fill.BackgroundColor = + XLColor.FromArgb(172, 185, 202); + ws.Range(ws.Cell(row + 3, 11), ws.Cell(row + 3, 12)).Style.Border.OutsideBorder = + XLBorderStyleValues.Thin; + ws.Range(ws.Cell(row + 3, 13), ws.Cell(row + 3, 14)).Merge().Value = "2569"; + ws.Range(ws.Cell(row + 3, 13), ws.Cell(row + 3, 14)).Style.Alignment.Horizontal = + XLAlignmentHorizontalValues.Center; + ws.Range(ws.Cell(row + 3, 13), ws.Cell(row + 3, 14)).Style.Alignment.Vertical = + XLAlignmentVerticalValues.Center; + ws.Range(ws.Cell(row + 3, 13), ws.Cell(row + 3, 14)).Style.Font.FontName = "TH SarabunPSK"; + ws.Range(ws.Cell(row + 3, 13), ws.Cell(row + 3, 14)).Style.Font.SetBold().Font.FontSize = + 16; + ws.Range(ws.Cell(row + 3, 13), ws.Cell(row + 3, 14)).Style.Fill.BackgroundColor = + XLColor.FromArgb(172, 185, 202); + ws.Range(ws.Cell(row + 3, 13), ws.Cell(row + 3, 14)).Style.Border.OutsideBorder = + XLBorderStyleValues.Thin; + + ws.Cell(row + 4, 9).Value = "อัตรา"; + ws.Cell(row + 4, 9).Style.Alignment.Horizontal = + XLAlignmentHorizontalValues.Center; + ws.Cell(row + 4, 9).Style.Alignment.Vertical = + XLAlignmentVerticalValues.Center; + ws.Cell(row + 4, 9).Style.Font.FontName = "TH SarabunPSK"; + ws.Cell(row + 4, 9).Style.Font.SetBold().Font.FontSize = 16; + ws.Cell(row + 4, 9).Style.Fill.BackgroundColor = + XLColor.FromArgb(172, 185, 202); + ws.Cell(row + 4, 9).Style.Border.OutsideBorder = + XLBorderStyleValues.Thin; + ws.Cell(row + 4, 10).Value = "งบประมาณ"; + ws.Cell(row + 4, 10).Style.Alignment.Horizontal = + XLAlignmentHorizontalValues.Center; + ws.Cell(row + 4, 10).Style.Alignment.Vertical = + XLAlignmentVerticalValues.Center; + ws.Cell(row + 4, 10).Style.Font.FontName = "TH SarabunPSK"; + ws.Cell(row + 4, 10).Style.Font.SetBold().Font.FontSize = 16; + ws.Cell(row + 4, 10).Style.Fill.BackgroundColor = + XLColor.FromArgb(172, 185, 202); + ws.Cell(row + 4, 10).Style.Border.OutsideBorder = + XLBorderStyleValues.Thin; + ws.Cell(row + 4, 11).Value = "อัตรา"; + ws.Cell(row + 4, 11).Style.Alignment.Horizontal = + XLAlignmentHorizontalValues.Center; + ws.Cell(row + 4, 11).Style.Alignment.Vertical = + XLAlignmentVerticalValues.Center; + ws.Cell(row + 4, 11).Style.Font.FontName = "TH SarabunPSK"; + ws.Cell(row + 4, 11).Style.Font.SetBold().Font.FontSize = 16; + ws.Cell(row + 4, 11).Style.Fill.BackgroundColor = + XLColor.FromArgb(172, 185, 202); + ws.Cell(row + 4, 11).Style.Border.OutsideBorder = + XLBorderStyleValues.Thin; + ws.Cell(row + 4, 12).Value = "งบประมาณ"; + ws.Cell(row + 4, 12).Style.Alignment.Horizontal = + XLAlignmentHorizontalValues.Center; + ws.Cell(row + 4, 12).Style.Alignment.Vertical = + XLAlignmentVerticalValues.Center; + ws.Cell(row + 4, 12).Style.Font.FontName = "TH SarabunPSK"; + ws.Cell(row + 4, 12).Style.Font.SetBold().Font.FontSize = 16; + ws.Cell(row + 4, 12).Style.Fill.BackgroundColor = + XLColor.FromArgb(172, 185, 202); + ws.Cell(row + 4, 12).Style.Border.OutsideBorder = + XLBorderStyleValues.Thin; + ws.Cell(row + 4, 13).Value = "อัตรา"; + ws.Cell(row + 4, 13).Style.Alignment.Horizontal = + XLAlignmentHorizontalValues.Center; + ws.Cell(row + 4, 13).Style.Alignment.Vertical = + XLAlignmentVerticalValues.Center; + ws.Cell(row + 4, 13).Style.Font.FontName = "TH SarabunPSK"; + ws.Cell(row + 4, 13).Style.Font.SetBold().Font.FontSize = 16; + ws.Cell(row + 4, 13).Style.Fill.BackgroundColor = + XLColor.FromArgb(172, 185, 202); + ws.Cell(row + 4, 13).Style.Border.OutsideBorder = + XLBorderStyleValues.Thin; + ws.Cell(row + 4, 14).Value = "งบประมาณ"; + ws.Cell(row + 4, 14).Style.Alignment.Horizontal = + XLAlignmentHorizontalValues.Center; + ws.Cell(row + 4, 14).Style.Alignment.Vertical = + XLAlignmentVerticalValues.Center; + ws.Cell(row + 4, 14).Style.Font.FontName = "TH SarabunPSK"; + ws.Cell(row + 4, 14).Style.Font.SetBold().Font.FontSize = 16; + ws.Cell(row + 4, 14).Style.Fill.BackgroundColor = + XLColor.FromArgb(172, 185, 202); + ws.Cell(row + 4, 14).Style.Border.OutsideBorder = + XLBorderStyleValues.Thin; + ws.Range(ws.Cell(row + 2, 15), ws.Cell(row + 4, 19)).Merge().Value = "คำชี้แจง"; + ws.Range(ws.Cell(row + 2, 15), ws.Cell(row + 4, 19)).Style.Alignment.Horizontal = + XLAlignmentHorizontalValues.Center; + ws.Range(ws.Cell(row + 2, 15), ws.Cell(row + 4, 19)).Style.Alignment.Vertical = + XLAlignmentVerticalValues.Center; + ws.Range(ws.Cell(row + 2, 15), ws.Cell(row + 4, 19)).Style.Font.FontName = "TH SarabunPSK"; + ws.Range(ws.Cell(row + 2, 15), ws.Cell(row + 4, 19)).Style.Font.SetBold().Font.FontSize = + 16; + ws.Range(ws.Cell(row + 2, 15), ws.Cell(row + 4, 19)).Style.Fill.BackgroundColor = + XLColor.FromArgb(214, 220, 228); + ws.Range(ws.Cell(row + 2, 15), ws.Cell(row + 4, 19)).Style.Border.OutsideBorder = + XLBorderStyleValues.Thin; } - - if (detail2.is_bold == true && detail2.list == "รวมทั้งสิ้น") + + if (detail2.is_bold == true && detail2.list == "รวมทั้งสิ้น") { - ws.Cell(row+5, 2).Value = "รวมทั้งสิ้น"; - ws.Cell(row+5, 5).Value = detail2.request_rate; - ws.Cell(row+5, 6).Value = detail2.request_budget; - ws.Cell(row+5, 7).Value = detail2.offer_rate; - ws.Cell(row+5, 8).Value = detail2.offer_budget; - ws.Cell(row+5, 9).Value = detail2.year1_rate; - ws.Cell(row+5, 10).Value = detail2.year1_budget; - ws.Cell(row+5, 11).Value = detail2.year2_rate; - ws.Cell(row+5, 12).Value = detail2.year2_budget; - ws.Cell(row+5, 13).Value = detail2.year3_rate; - ws.Cell(row+5, 14).Value = detail2.year3_budget; + ws.Cell(row + 5, 2).Value = "รวมทั้งสิ้น"; + ws.Cell(row + 5, 5).Value = detail2.request_rate; + ws.Cell(row + 5, 6).Value = detail2.request_budget; + ws.Cell(row + 5, 7).Value = detail2.offer_rate; + ws.Cell(row + 5, 8).Value = detail2.offer_budget; + ws.Cell(row + 5, 9).Value = detail2.year1_rate; + ws.Cell(row + 5, 10).Value = detail2.year1_budget; + ws.Cell(row + 5, 11).Value = detail2.year2_rate; + ws.Cell(row + 5, 12).Value = detail2.year2_budget; + ws.Cell(row + 5, 13).Value = detail2.year3_rate; + ws.Cell(row + 5, 14).Value = detail2.year3_budget; // ws.Cell(row, 15).Value = detail.year3_rate; // ws.Cell(row, 16).Value = detail.year3_budget; - ws.Range(ws.Cell(row+5, 15), ws.Cell(row+5, 19)).Merge().Value = detail2.remark; - + ws.Range(ws.Cell(row + 5, 15), ws.Cell(row + 5, 19)).Merge().Value = detail2.remark; + //ws.Cell(row + 5, 1).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; // ws.Cell(row + 5, 2).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; // ws.Cell(row + 5, 3).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - ws.Range(ws.Cell(row + 5, 1), ws.Cell(row + 5, 4)).Style.Border.BottomBorder = XLBorderStyleValues.Thin; - ws.Range(ws.Cell(row + 5, 1), ws.Cell(row + 5, 4)).Style.Border.TopBorder = XLBorderStyleValues.Thin; + ws.Range(ws.Cell(row + 5, 1), ws.Cell(row + 5, 4)).Style.Border.BottomBorder = + XLBorderStyleValues.Thin; + ws.Range(ws.Cell(row + 5, 1), ws.Cell(row + 5, 4)).Style.Border.TopBorder = + XLBorderStyleValues.Thin; ws.Cell(row + 5, 5).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; ws.Cell(row + 5, 6).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; @@ -5938,10 +5961,10 @@ namespace rmutr_report.Controllers ws.Cell(row + 5, 12).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; ws.Cell(row + 5, 13).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; ws.Cell(row + 5, 14).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - + ws.Range(ws.Cell(row + 5, 15), ws.Cell(row + 5, 19)).Merge().Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - + ws.Range(ws.Cell(row + 5, 1), ws.Cell(row, 19)).Style.Font.FontName = "TH SarabunPSK"; ws.Range(ws.Cell(row + 5, 1), ws.Cell(row, 19)).Style.Font.SetBold().Font.FontSize = 16; @@ -5949,8 +5972,9 @@ namespace rmutr_report.Controllers ws.Range(ws.Cell(row + 5, 1), ws.Cell(row, 19)).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; ws.Range(ws.Cell(row + 5, 5), ws.Cell(row + 5, 14)).Style.NumberFormat.SetFormat("#,#"); - ws.Range(ws.Cell(row + 5, 1), ws.Cell(row + 5, 4)).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; - + ws.Range(ws.Cell(row + 5, 1), ws.Cell(row + 5, 4)).Style.Alignment.Horizontal = + XLAlignmentHorizontalValues.Center; + ws.Cell(row + 5, 5).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; ws.Cell(row + 5, 6).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; ws.Cell(row + 5, 7).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; @@ -5962,28 +5986,30 @@ namespace rmutr_report.Controllers ws.Cell(row + 5, 13).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; ws.Cell(row + 5, 14).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; ws.Cell(row + 5, 15).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; - } + if (detail2.is_bold == true) { - ws.Cell(row+5, 1).Value = detail2.type; + ws.Cell(row + 5, 1).Value = detail2.type; //ws.Cell(row+5, 2).Value = detail2.list; - ws.Cell(row+5, 5).Value = detail2.request_rate; - ws.Cell(row+5, 6).Value = detail2.request_budget; - ws.Cell(row+5, 7).Value = detail2.offer_rate; - ws.Cell(row+5, 8).Value = detail2.offer_budget; - ws.Cell(row+5, 9).Value = detail2.year1_rate; - ws.Cell(row+5, 10).Value = detail2.year1_budget; - ws.Cell(row+5, 11).Value = detail2.year2_rate; - ws.Cell(row+5, 12).Value = detail2.year2_budget; - ws.Cell(row+5, 13).Value = detail2.year3_rate; - ws.Cell(row+5, 14).Value = detail2.year3_budget; + ws.Cell(row + 5, 5).Value = detail2.request_rate; + ws.Cell(row + 5, 6).Value = detail2.request_budget; + ws.Cell(row + 5, 7).Value = detail2.offer_rate; + ws.Cell(row + 5, 8).Value = detail2.offer_budget; + ws.Cell(row + 5, 9).Value = detail2.year1_rate; + ws.Cell(row + 5, 10).Value = detail2.year1_budget; + ws.Cell(row + 5, 11).Value = detail2.year2_rate; + ws.Cell(row + 5, 12).Value = detail2.year2_budget; + ws.Cell(row + 5, 13).Value = detail2.year3_rate; + ws.Cell(row + 5, 14).Value = detail2.year3_budget; // ws.Cell(row, 15).Value = detail.year3_rate; // ws.Cell(row, 16).Value = detail.year3_budget; - ws.Range(ws.Cell(row+5, 15), ws.Cell(row+5, 19)).Merge().Value = detail2.remark; + ws.Range(ws.Cell(row + 5, 15), ws.Cell(row + 5, 19)).Merge().Value = detail2.remark; - ws.Range(ws.Cell(row + 5, 1), ws.Cell(row + 5, 4)).Style.Border.TopBorder = XLBorderStyleValues.Thin; - ws.Range(ws.Cell(row + 5, 1), ws.Cell(row + 5, 4)).Style.Border.BottomBorder = XLBorderStyleValues.Thin; + ws.Range(ws.Cell(row + 5, 1), ws.Cell(row + 5, 4)).Style.Border.TopBorder = + XLBorderStyleValues.Thin; + ws.Range(ws.Cell(row + 5, 1), ws.Cell(row + 5, 4)).Style.Border.BottomBorder = + XLBorderStyleValues.Thin; ws.Cell(row + 5, 5).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; ws.Cell(row + 5, 6).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; @@ -5995,7 +6021,7 @@ namespace rmutr_report.Controllers ws.Cell(row + 5, 12).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; ws.Cell(row + 5, 13).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; ws.Cell(row + 5, 14).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - + ws.Range(ws.Cell(row + 5, 15), ws.Cell(row + 5, 19)).Merge().Style.Border.OutsideBorder = XLBorderStyleValues.Thin; @@ -6020,26 +6046,27 @@ namespace rmutr_report.Controllers ws.Cell(row + 5, 13).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; ws.Cell(row + 5, 14).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; ws.Cell(row + 5, 15).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; - + row++; } + if (detail2.is_bold == false) { - ws.Range(ws.Cell(row+5, 2), ws.Cell(row+5, 4)).Merge().Value = detail2.list; - ws.Cell(row+5, 5).Value = detail2.request_rate; - ws.Cell(row+5, 6).Value = detail2.request_budget; - ws.Cell(row+5, 7).Value = detail2.offer_rate; - ws.Cell(row+5, 8).Value = detail2.offer_budget; - ws.Cell(row+5, 9).Value = detail2.year1_rate; - ws.Cell(row+5, 10).Value = detail2.year1_budget; - ws.Cell(row+5, 11).Value = detail2.year2_rate; - ws.Cell(row+5, 12).Value = detail2.year2_budget; - ws.Cell(row+5, 13).Value = detail2.year3_rate; - ws.Cell(row+5, 14).Value = detail2.year3_budget; + ws.Range(ws.Cell(row + 5, 2), ws.Cell(row + 5, 4)).Merge().Value = detail2.list; + ws.Cell(row + 5, 5).Value = detail2.request_rate; + ws.Cell(row + 5, 6).Value = detail2.request_budget; + ws.Cell(row + 5, 7).Value = detail2.offer_rate; + ws.Cell(row + 5, 8).Value = detail2.offer_budget; + ws.Cell(row + 5, 9).Value = detail2.year1_rate; + ws.Cell(row + 5, 10).Value = detail2.year1_budget; + ws.Cell(row + 5, 11).Value = detail2.year2_rate; + ws.Cell(row + 5, 12).Value = detail2.year2_budget; + ws.Cell(row + 5, 13).Value = detail2.year3_rate; + ws.Cell(row + 5, 14).Value = detail2.year3_budget; // ws.Cell(row, 15).Value = detail.year3_rate; // ws.Cell(row, 16).Value = detail.year3_budget; - ws.Range(ws.Cell(row+5, 15), ws.Cell(row+5, 19)).Merge().Value = detail2.remark; + ws.Range(ws.Cell(row + 5, 15), ws.Cell(row + 5, 19)).Merge().Value = detail2.remark; ws.Cell(row + 5, 1).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; ws.Cell(row + 5, 2).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; @@ -6055,7 +6082,7 @@ namespace rmutr_report.Controllers ws.Cell(row + 5, 12).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; ws.Cell(row + 5, 13).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; ws.Cell(row + 5, 14).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - + ws.Range(ws.Cell(row + 5, 15), ws.Cell(row + 5, 19)).Merge().Style.Border.OutsideBorder = XLBorderStyleValues.Thin; @@ -6066,8 +6093,9 @@ namespace rmutr_report.Controllers ws.Range(ws.Cell(row + 5, 1), ws.Cell(row + 5, 19)).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; ws.Range(ws.Cell(row + 5, 5), ws.Cell(row + 5, 14)).Style.NumberFormat.SetFormat("#,#"); - ws.Range(ws.Cell(row + 5, 2), ws.Cell(row + 5, 4)).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; - + ws.Range(ws.Cell(row + 5, 2), ws.Cell(row + 5, 4)).Style.Alignment.Horizontal = + XLAlignmentHorizontalValues.Left; + ws.Cell(row + 5, 5).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; ws.Cell(row + 5, 6).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; ws.Cell(row + 5, 7).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; @@ -6079,19 +6107,19 @@ namespace rmutr_report.Controllers ws.Cell(row + 5, 13).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; ws.Cell(row + 5, 14).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; ws.Cell(row + 5, 15).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; - + row++; } - } } + ws.Cell(row + 6, 1).Value = "หมายเหตุ : " + personnel.remark; ws.Cell(row + 6, 1).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; ws.Cell(row + 6, 1).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - ws.Range(ws.Cell(row + 6, 1), ws.Cell(row+6, 19)).Style.Alignment.WrapText = true; + ws.Range(ws.Cell(row + 6, 1), ws.Cell(row + 6, 19)).Style.Alignment.WrapText = true; ws.Cell(row + 6, 1).Style.Font.FontName = "TH SarabunPSK"; ws.Cell(row + 6, 1).Style.Font.SetBold().Font.FontSize = 16; }