From 5c51403917e32d017e6cec4684d5f5fd23672885 Mon Sep 17 00:00:00 2001 From: kamonwan taengsuk Date: Tue, 14 Mar 2023 18:02:05 +0700 Subject: [PATCH] bug fixed --- Controllers/Summary.Controller.cs | 402 +++++++++--------- .../budget/summary_building_construction.cs | 6 +- 2 files changed, 204 insertions(+), 204 deletions(-) diff --git a/Controllers/Summary.Controller.cs b/Controllers/Summary.Controller.cs index 45871c2..349221a 100644 --- a/Controllers/Summary.Controller.cs +++ b/Controllers/Summary.Controller.cs @@ -897,147 +897,148 @@ namespace rmutr_report.Controllers var workbook = new XLWorkbook(); var ws = workbook.Worksheets.Add("รายการก่อสร้างอาคาร"); var imagePath = _setting.report_path + @"Logo-RMUTR.png"; - ws.AddPicture(imagePath).MoveTo(ws.Cell("A1")).Scale(0.3); - ws.Range("A4:A6").Merge().Value = "ลำดับความสำคัญ(1)"; - ws.Range("A4:A6").Style.Alignment.WrapText = true; - ws.Range("A4:A6").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; - ws.Range("A4:A6").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - ws.Range("A4:A6").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - ws.Cell("A4").Style.Font.FontName = "TH Sarabun New"; - ws.Cell("A4").Style.Font.FontSize = 14; - ws.Range("A4:A6").Style.Fill.BackgroundColor = XLColor.MistyRose; - ws.Range("B4:B6").Merge().Value = "รายการ"; - ws.Cell("B4").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; - ws.Cell("B4").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - ws.Cell("B4").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - ws.Cell("B4").Style.Font.FontName = "TH Sarabun New"; - ws.Cell("B4").Style.Font.FontSize = 14; - ws.Range("B4:B6").Style.Fill.BackgroundColor = XLColor.MistyRose; - ws.Range("C4:C6").Merge().Value = "จำนวน"; - ws.Cell("C4").Style.Font.FontName = "TH Sarabun New"; - ws.Cell("C4").Style.Font.FontSize = 14; - ws.Range("C4:C6").Style.Fill.BackgroundColor = XLColor.MistyRose; - ws.Range("C4:C6").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; - ws.Range("C4:C6").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - ws.Range("C4:C6").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - ws.Range("C4").Style.Alignment.SetTextRotation(90); - ws.Range("D4:F4").Merge().Value = "อายุการใช้งาน"; - ws.Cell("D4").Style.Font.FontName = "TH Sarabun New"; - ws.Cell("D4").Style.Font.FontSize = 14; - ws.Range("D4:F4").Style.Fill.BackgroundColor = XLColor.MistyRose; - ws.Range("D4:F4").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; - ws.Range("D4:F4").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - ws.Range("D4:F4").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - ws.Cell("D5").Value = "ต่ำกว่า 10 ปี"; - ws.Cell("D5").Style.Alignment.WrapText = true; - ws.Cell("D5").Style.Font.FontName = "TH Sarabun New"; - ws.Cell("D5").Style.Font.FontSize = 10; - ws.Cell("D5").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; - ws.Cell("D5").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - ws.Cell("D5").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - ws.Cell("E5").Value = "10-20 ปี"; - ws.Cell("E5").Style.Alignment.WrapText = true; - ws.Cell("E5").Style.Font.FontName = "TH Sarabun New"; - ws.Cell("E5").Style.Font.FontSize = 10; - ws.Cell("E5").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; - ws.Cell("E5").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - ws.Cell("E5").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - ws.Cell("F5").Value = "มากกว่า 20 ปี"; - ws.Cell("F5").Style.Alignment.WrapText = true; - ws.Cell("F5").Style.Font.FontName = "TH Sarabun New"; - ws.Cell("F5").Style.Font.FontSize = 10; - ws.Cell("F5").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; - ws.Cell("F5").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - ws.Cell("F5").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - ws.Range("D5:F5").Style.Fill.BackgroundColor = XLColor.MistyRose; - ws.Cell("D6").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - ws.Cell("E6").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - ws.Cell("F6").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - ws.Range("G4:G6").Merge().Value = "ปัญหาของอาคาร"; - ws.Cell("G4").Style.Font.FontName = "TH Sarabun New"; - ws.Cell("G4").Style.Font.FontSize = 14; - ws.Range("G4:G6").Style.Fill.BackgroundColor = XLColor.MistyRose; - ws.Range("G4:G6").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; - ws.Range("G4:G6").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - ws.Range("G4:G6").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - ws.Range("H4:I4").Merge().Value = "ประเภท"; - ws.Cell("H4").Style.Font.FontName = "TH Sarabun New"; - ws.Cell("H4").Style.Font.FontSize = 14; - ws.Range("H4:I4").Style.Fill.BackgroundColor = XLColor.MistyRose; - ws.Range("H4:I4").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; - ws.Range("H4:I4").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - ws.Range("H4:I4").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - ws.Cell("H5").Value = "ทดแทนอาคารเดิม"; - ws.Cell("H5").Style.Alignment.WrapText = true; - ws.Cell("H5").Style.Font.FontName = "TH Sarabun New"; - ws.Cell("H5").Style.Font.FontSize = 10; - ws.Cell("H5").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; - ws.Cell("H5").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - ws.Cell("H5").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - ws.Cell("I5").Value = "อาคารใหม่"; - ws.Cell("I5").Style.Font.FontName = "TH Sarabun New"; - ws.Cell("I5").Style.Font.FontSize = 10; - ws.Cell("I5").Style.Alignment.WrapText = true; - ws.Cell("I5").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; - ws.Cell("I5").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - ws.Cell("I5").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - ws.Range("H5:I5").Style.Fill.BackgroundColor = XLColor.MistyRose; - ws.Range("J4:J5").Merge().Value = "ปรับปรุง/ซ่อมแซม/ต่อเติม"; - ws.Range("J4:J5").Style.Alignment.WrapText = true; - ws.Cell("J4").Style.Font.FontName = "TH Sarabun New"; - ws.Cell("J4").Style.Font.FontSize = 14; - ws.Range("J4:J5").Style.Fill.BackgroundColor = XLColor.MistyRose; - ws.Range("J4:J5").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; - ws.Range("J4:J5").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - ws.Range("J4:J5").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - ws.Cell("J6").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - ws.Cell("I6").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - ws.Cell("H6").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - ws.Range("K4:K5").Merge().Value = "วงเงินที่จะเสนอของบประมาณ"; - ws.Range("K4:K5").Style.Alignment.WrapText = true; - ws.Cell("K4").Style.Font.FontName = "TH Sarabun New"; - ws.Cell("K4").Style.Font.FontSize = 14; - ws.Range("K4:K5").Style.Fill.BackgroundColor = XLColor.MistyRose; - ws.Range("K4:K5").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; - ws.Range("K4:K5").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - ws.Range("K4:K5").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - ws.Cell("K6").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - ws.Range("L4:P4").Merge().Value = "ปีงบประมาณที่จะเสนอขอ"; - ws.Range("L4:P4").Style.Alignment.WrapText = true; - ws.Cell("L4").Style.Font.FontName = "TH Sarabun New"; - ws.Cell("L4").Style.Font.FontSize = 14; - ws.Range("L4:P4").Style.Fill.BackgroundColor = XLColor.MistyRose; - ws.Range("L4:P4").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; - ws.Range("L4:P4").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.AddPicture(imagePath).MoveTo(ws.Cell("A1")).Scale(0.20); + ws.Range("A2:A4").Merge().Value = "ลำดับความสำคัญ(1)"; + ws.Range("A2:A4").Style.Alignment.WrapText = true; + ws.Range("A2:A4").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Range("A2:A4").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("A2:A4").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Range("A2:A4").Style.Font.FontName = "TH Sarabun New"; + ws.Cell("A2").Style.Font.FontSize = 14; + ws.Range("A2:A4").Style.Fill.BackgroundColor = XLColor.MistyRose; + ws.Range("B2:B4").Merge().Value = "รายการ"; + ws.Cell("B2").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("B2").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("B2").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("B2").Style.Font.FontName = "TH Sarabun New"; + ws.Cell("B2").Style.Font.FontSize = 14; + ws.Range("B2:B4").Style.Fill.BackgroundColor = XLColor.MistyRose; + ws.Range("C2:C4").Merge().Value = "จำนวน"; + ws.Cell("C2").Style.Font.FontName = "TH Sarabun New"; + ws.Cell("C2").Style.Font.FontSize = 14; + ws.Range("C2:C4").Style.Fill.BackgroundColor = XLColor.MistyRose; + ws.Range("C2:C4").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Range("C2:C4").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("C2:C4").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Range("C3").Style.Alignment.SetTextRotation(90); + ws.Range("D2:F2").Merge().Value = "อายุการใช้งาน"; + ws.Cell("D2").Style.Font.FontName = "TH Sarabun New"; + ws.Cell("D2").Style.Font.FontSize = 14; + ws.Range("D2:F2").Style.Fill.BackgroundColor = XLColor.MistyRose; + ws.Range("D2:F2").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Range("D2:F2").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("D2:F2").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("D3").Value = "ต่ำกว่า 10 ปี"; + ws.Cell("D3").Style.Alignment.WrapText = true; + ws.Cell("D3").Style.Font.FontName = "TH Sarabun New"; + ws.Cell("D3").Style.Font.FontSize = 10; + ws.Cell("D3").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("D3").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("D3").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("E3").Value = "10-20 ปี"; + ws.Cell("E3").Style.Alignment.WrapText = true; + ws.Cell("E3").Style.Font.FontName = "TH Sarabun New"; + ws.Cell("E3").Style.Font.FontSize = 10; + ws.Cell("E3").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("E3").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("E3").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("F3").Value = "มากกว่า 20 ปี"; + ws.Cell("F3").Style.Alignment.WrapText = true; + ws.Cell("F3").Style.Font.FontName = "TH Sarabun New"; + ws.Cell("F3").Style.Font.FontSize = 10; + ws.Cell("F3").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("F3").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("F3").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Range("D3:F3").Style.Fill.BackgroundColor = XLColor.MistyRose; + ws.Cell("D4").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("E4").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("F4").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Range("G2:G4").Merge().Value = "ปัญหาของอาคาร"; + ws.Cell("G2").Style.Font.FontName = "TH Sarabun New"; + ws.Cell("G2").Style.Font.FontSize = 14; + ws.Range("G2:G4").Style.Fill.BackgroundColor = XLColor.MistyRose; + ws.Range("G2:G4").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Range("G2:G4").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("G2:G4").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Range("H2:I2").Merge().Value = "ประเภท"; + ws.Cell("H2").Style.Font.FontName = "TH Sarabun New"; + ws.Cell("H2").Style.Font.FontSize = 14; + ws.Range("H2:I2").Style.Fill.BackgroundColor = XLColor.MistyRose; + ws.Range("H2:I2").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Range("H2:I2").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("H2:I2").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("H3").Value = "ทดแทนอาคารเดิม"; + ws.Cell("H3").Style.Alignment.WrapText = true; + ws.Cell("H3").Style.Font.FontName = "TH Sarabun New"; + ws.Cell("H3").Style.Font.FontSize = 10; + ws.Cell("H3").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("H3").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("H3").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("I3").Value = "อาคารใหม่"; + ws.Cell("I3").Style.Font.FontName = "TH Sarabun New"; + ws.Cell("I3").Style.Font.FontSize = 10; + ws.Cell("I3").Style.Alignment.WrapText = true; + ws.Cell("I3").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("I3").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("I3").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Range("H3:I3").Style.Fill.BackgroundColor = XLColor.MistyRose; + ws.Range("J2:J3").Merge().Value = "ปรับปรุง/ซ่อมแซม/ต่อเติม"; + ws.Range("J2:J3").Style.Alignment.WrapText = true; + ws.Cell("J2").Style.Font.FontName = "TH Sarabun New"; + ws.Cell("J2").Style.Font.FontSize = 14; + ws.Range("J2:J3").Style.Fill.BackgroundColor = XLColor.MistyRose; + ws.Range("J2:J3").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Range("J2:J3").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("J2:J3").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("J4").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("I4").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("H4").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Range("K2:K3").Merge().Value = "วงเงินที่จะเสนอของบประมาณ"; + ws.Range("K2:K3").Style.Alignment.WrapText = true; + ws.Cell("K2").Style.Font.FontName = "TH Sarabun New"; + ws.Cell("K2").Style.Font.FontSize = 14; + ws.Range("K2:K3").Style.Fill.BackgroundColor = XLColor.MistyRose; + ws.Range("K2:K3").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Range("K2:K3").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("K2:K3").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("K4").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Range("L2:P2").Merge().Value = "ปีงบประมาณที่จะเสนอขอ"; + ws.Range("L2:P2").Style.Alignment.WrapText = true; + ws.Cell("L2").Style.Font.FontName = "TH Sarabun New"; + ws.Cell("L2").Style.Font.FontSize = 14; + ws.Range("L2:P2").Style.Fill.BackgroundColor = XLColor.MistyRose; + ws.Range("L2:P2").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Range("L2:P2").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("L2:P2").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; ws.Range("L4:P4").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - ws.Range("L6:P6").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - ws.Cell("Q5").Value = "BOQ"; - ws.Cell("Q5").Style.Alignment.WrapText = true; - ws.Cell("Q5").Style.Font.FontName = "TH Sarabun New"; - ws.Cell("Q5").Style.Font.FontSize = 10; - ws.Cell("Q5").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; - ws.Cell("Q5").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - ws.Cell("Q5").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - ws.Cell("R5").Value = "แบบรูป"; - ws.Cell("R5").Style.Font.FontName = "TH Sarabun New"; - ws.Cell("R5").Style.Font.FontSize = 10; - ws.Range("Q5:R5").Style.Fill.BackgroundColor = XLColor.MistyRose; - ws.Cell("R5").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; - ws.Cell("R5").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - ws.Cell("R5").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - ws.Range("Q6:R6").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - ws.Range("S4:S5").Merge().Value = "คำอธิบาย"; - ws.Range("S4:S5").Style.Alignment.WrapText = true; - ws.Cell("S4").Style.Font.FontName = "TH Sarabun New"; - ws.Cell("S4").Style.Font.FontSize = 14; - ws.Range("S4:S5").Style.Fill.BackgroundColor = XLColor.MistyRose; - ws.Range("S4:S5").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; - ws.Range("S4:S5").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - ws.Range("S4:S5").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - ws.Cell("S6").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - ws.Row(4).Height = 30; - ws.Row(5).Height = 30; - ws.Row(6).Height = 30; + ws.Cell("Q3").Value = "BOQ"; + ws.Cell("Q3").Style.Alignment.WrapText = true; + ws.Cell("Q3").Style.Font.FontName = "TH Sarabun New"; + ws.Cell("Q3").Style.Font.FontSize = 10; + ws.Cell("Q3").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("Q3").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("Q3").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("R3").Value = "แบบรูป"; + ws.Cell("R3").Style.Font.FontName = "TH Sarabun New"; + ws.Cell("R3").Style.Font.FontSize = 10; + ws.Range("Q3:R3").Style.Fill.BackgroundColor = XLColor.MistyRose; + ws.Cell("R3").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("R3").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("R3").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Range("Q4:R4").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Range("S2:S3").Merge().Value = "คำอธิบาย"; + ws.Range("S2:S3").Style.Alignment.WrapText = true; + ws.Cell("S2").Style.Font.FontName = "TH Sarabun New"; + ws.Cell("S2").Style.Font.FontSize = 14; + ws.Range("S2:S3").Style.Fill.BackgroundColor = XLColor.MistyRose; + ws.Range("S2:S3").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Range("S2:S3").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("S2:S3").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("S4").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Row(1).Height = 45; + // ws.Row(4).Height = 30; + // ws.Row(5).Height = 30; + // ws.Row(6).Height = 30; ws.Column(1).Width = 9; ws.Column(2).Width = 40; ws.Column(3).Width = 5; @@ -1058,7 +1059,7 @@ namespace rmutr_report.Controllers ws.Column(18).Width = 15; ws.Column(19).Width = 50; - int row = 7; + int row = 5; int no = 1; // foreach (var build in summary_building_constructions) @@ -1066,70 +1067,69 @@ namespace rmutr_report.Controllers if (summary_building_constructions != null) { //string first = "สรุปแผนความต้องการ รายการก่อสร้างอาคารหรือสิ่งก่อสร้างและปรับปรุงซ่อมแซมต่อเติม ของมหาวิทยาลัยเทคโนโลยีราชมงคลรัตนโกสินทร์"; - string second = "ปีงบประมาณ " + summary_building_constructions.academic_year_name_th + " " + - summary_building_constructions.header_name; - string third = "หน่วยงาน/คณะ " + summary_building_constructions.agency_name_th + - " พื้นที่ " + summary_building_constructions.location; + string second = "ปีงบประมาณ " + summary_building_constructions.academic_year_name_th ; + // string third = "หน่วยงาน/คณะ " + summary_building_constructions.agency_name_th + + // " พื้นที่ " + summary_building_constructions.location; ws.Range("A1:S1").Merge().Value = - "สรุปแผนความต้องการ รายการก่อสร้างอาคารหรือสิ่งก่อสร้างและปรับปรุงซ่อมแซมต่อเติม ของมหาวิทยาลัยเทคโนโลยีราชมงคลรัตนโกสินทร์"; + "สรุปแผนความต้องการ รายการก่อสร้างอาคารหรือสิ่งก่อสร้างและปรับปรุงซ่อมแซมต่อเติม ของมหาวิทยาลัยเทคโนโลยีราชมงคลรัตนโกสินทร์" + second; ws.Range("A1:S1").Merge().Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; ws.Range("A1:S1").Merge().Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - ws.Range("A2:S2").Merge().Value = second; - ws.Range("A2:S2").Merge().Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; - ws.Range("A2:S2").Merge().Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - ws.Range("A3:S3").Merge().Value = third; - ws.Range("A3:S3").Merge().Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; - ws.Range("A3:S3").Merge().Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - ws.Range("A1:A3").Style.Font.Bold = true; - ws.Range("A1:A3").Style.Font.FontSize = 16; - ws.Range("A1:A3").Style.Font.FontName = "TH Sarabun New"; - ws.Cell("L5").Value = summary_building_constructions.budget_year_1; - ws.Cell("L5").Style.Alignment.WrapText = true; - ws.Cell("L5").Style.Font.FontName = "TH Sarabun New"; - ws.Cell("L5").Style.Font.FontSize = 10; - ws.Cell("L5").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; - ws.Cell("L5").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - ws.Cell("L5").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - ws.Cell("M5").Value = summary_building_constructions.budget_year_2; - ws.Cell("M5").Style.Alignment.WrapText = true; - ws.Cell("M5").Style.Font.FontName = "TH Sarabun New"; - ws.Cell("M5").Style.Font.FontSize = 10; - ws.Cell("M5").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; - ws.Cell("M5").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - ws.Cell("M5").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - ws.Cell("N5").Value = summary_building_constructions.budget_year_3; - ws.Cell("N5").Style.Alignment.WrapText = true; - ws.Cell("N5").Style.Font.FontName = "TH Sarabun New"; - ws.Cell("N5").Style.Font.FontSize = 10; - ws.Cell("N5").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; - ws.Cell("N5").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - ws.Cell("N5").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - ws.Cell("O5").Value = summary_building_constructions.budget_year_4; - ws.Cell("O5").Style.Alignment.WrapText = true; - ws.Cell("O5").Style.Font.FontName = "TH Sarabun New"; - ws.Cell("O5").Style.Font.FontSize = 10; - ws.Cell("O5").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; - ws.Cell("O5").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - ws.Cell("O5").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - ws.Cell("P5").Value = summary_building_constructions.budget_year_5; - ws.Cell("P5").Style.Alignment.WrapText = true; - ws.Cell("P5").Style.Font.FontName = "TH Sarabun New"; - ws.Cell("P5").Style.Font.FontSize = 10; - ws.Cell("P5").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; - ws.Cell("P5").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - ws.Cell("P5").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - ws.Range("L5:P5").Style.Fill.BackgroundColor = XLColor.MistyRose; - ws.Range("Q4:R4").Merge().Value = "ความพร้อมสิ่งก่อสร้าง ปี " + + // ws.Range("A2:S2").Merge().Value = second; + // ws.Range("A2:S2").Merge().Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + // ws.Range("A2:S2").Merge().Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + // ws.Range("A3:S3").Merge().Value = third; + // ws.Range("A3:S3").Merge().Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + // ws.Range("A3:S3").Merge().Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + // ws.Range("A1:A3").Style.Font.Bold = true; + // ws.Range("A1:A3").Style.Font.FontSize = 16; + // ws.Range("A1:A3").Style.Font.FontName = "TH Sarabun New"; + ws.Cell("L3").Value = summary_building_constructions.budget_year_1; + ws.Cell("L3").Style.Alignment.WrapText = true; + ws.Cell("L3").Style.Font.FontName = "TH Sarabun New"; + ws.Cell("L3").Style.Font.FontSize = 10; + ws.Cell("L3").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("L3").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("L3").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("M3").Value = summary_building_constructions.budget_year_2; + ws.Cell("M3").Style.Alignment.WrapText = true; + ws.Cell("M3").Style.Font.FontName = "TH Sarabun New"; + ws.Cell("M3").Style.Font.FontSize = 10; + ws.Cell("M3").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("M3").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("M3").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("N3").Value = summary_building_constructions.budget_year_3; + ws.Cell("N3").Style.Alignment.WrapText = true; + ws.Cell("N3").Style.Font.FontName = "TH Sarabun New"; + ws.Cell("N3").Style.Font.FontSize = 10; + ws.Cell("N3").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("N3").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("N3").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("O3").Value = summary_building_constructions.budget_year_4; + ws.Cell("O3").Style.Alignment.WrapText = true; + ws.Cell("O3").Style.Font.FontName = "TH Sarabun New"; + ws.Cell("O3").Style.Font.FontSize = 10; + ws.Cell("O3").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("O3").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("O3").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("P3").Value = summary_building_constructions.budget_year_5; + ws.Cell("P3").Style.Alignment.WrapText = true; + ws.Cell("P3").Style.Font.FontName = "TH Sarabun New"; + ws.Cell("P3").Style.Font.FontSize = 10; + ws.Cell("P3").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("P3").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("P3").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Range("L3:P3").Style.Fill.BackgroundColor = XLColor.MistyRose; + ws.Range("Q2:R2").Merge().Value = "ความพร้อมสิ่งก่อสร้าง ปี " + summary_building_constructions.academic_year; - ws.Range("Q4:R4").Style.Fill.BackgroundColor = XLColor.MistyRose; - ws.Cell("Q4").Style.Font.FontName = "TH Sarabun New"; - ws.Cell("Q4").Style.Font.FontSize = 14; - ws.Range("Q4:R4").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; - ws.Range("Q4:R4").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - ws.Range("Q4:R4").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - ws.Range("L6:R6").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - ws.Range("D6:F6").Style.Fill.BackgroundColor = XLColor.Gainsboro; - ws.Range("H6:S6").Style.Fill.BackgroundColor = XLColor.Gainsboro; + ws.Range("Q2:R2").Style.Fill.BackgroundColor = XLColor.MistyRose; + ws.Cell("Q2").Style.Font.FontName = "TH Sarabun New"; + ws.Cell("Q2").Style.Font.FontSize = 14; + ws.Range("Q2:R2").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Range("Q2:R2").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("Q2:R2").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Range("L4:R4").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Range("D4:F4").Style.Fill.BackgroundColor = XLColor.Gainsboro; + ws.Range("H4:S4").Style.Fill.BackgroundColor = XLColor.Gainsboro; foreach (var buildings in summary_building_constructions.header_data) { if (buildings.color == 1) diff --git a/Models/budget/summary_building_construction.cs b/Models/budget/summary_building_construction.cs index 2323d14..9f59446 100644 --- a/Models/budget/summary_building_construction.cs +++ b/Models/budget/summary_building_construction.cs @@ -5,9 +5,9 @@ namespace rmutr_report.Models public class summary_building_construction { public string academic_year_name_th { get; set; } - public string header_name { get; set; } - public string agency_name_th { get; set; } - public string location { get; set; } + //public string header_name { get; set; } + // public string agency_name_th { get; set; } + // public string location { get; set; } public string academic_year { get; set; } public string budget_year_1 { get; set; } public string budget_year_2 { get; set; }