From d5eb8c901b742b5ce45fb4007dfe0ef7062f42d9 Mon Sep 17 00:00:00 2001 From: kamonwan taengsuk Date: Wed, 8 Mar 2023 13:18:41 +0700 Subject: [PATCH] remove col --- Controllers/RepairCost.Controller.cs | 142 +++++++++++++-------------- Models/budget/repair_cost.cs | 2 +- 2 files changed, 72 insertions(+), 72 deletions(-) diff --git a/Controllers/RepairCost.Controller.cs b/Controllers/RepairCost.Controller.cs index 12d5791..f87422a 100644 --- a/Controllers/RepairCost.Controller.cs +++ b/Controllers/RepairCost.Controller.cs @@ -84,21 +84,21 @@ namespace rmutr_report.Controllers ws.Cell("D6").Style.Font.FontSize = 16; ws.Cell("D6").Style.Font.Bold = true; ws.Cell("D6").Style.Alignment.WrapText = true; - ws.Cell("E5").Value = "ค่าซ่อมแซม"; - ws.Cell("E5").Style.Font.FontName = "TH SarabunPSK"; - ws.Cell("E5").Style.Font.FontSize = 16; - ws.Cell("E5").Style.Font.Bold = true; - ws.Cell("E5").Style.Alignment.WrapText = true; - ws.Cell("E6").Value = "บาท/ปี"; - ws.Cell("E6").Style.Font.FontName = "TH SarabunPSK"; - ws.Cell("E6").Style.Font.FontSize = 16; - ws.Cell("E6").Style.Font.Bold = true; - ws.Cell("E6").Style.Alignment.WrapText = true; + // ws.Cell("E5").Value = "ค่าซ่อมแซม"; + // ws.Cell("E5").Style.Font.FontName = "TH SarabunPSK"; + // ws.Cell("E5").Style.Font.FontSize = 16; + // ws.Cell("E5").Style.Font.Bold = true; + // ws.Cell("E5").Style.Alignment.WrapText = true; + // ws.Cell("E6").Value = "บาท/ปี"; + // ws.Cell("E6").Style.Font.FontName = "TH SarabunPSK"; + // ws.Cell("E6").Style.Font.FontSize = 16; + // ws.Cell("E6").Style.Font.Bold = true; + // ws.Cell("E6").Style.Alignment.WrapText = true; - ws.Range("A5:E6").Style.Fill.BackgroundColor = XLColor.Gainsboro; - ws.Range("A5:E6").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; - ws.Range("A5:E6").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - ws.Range("A5:E6").Style.Border.OutsideBorder = + ws.Range("A5:D6").Style.Fill.BackgroundColor = XLColor.Gainsboro; + ws.Range("A5:D6").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Range("A5:D6").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("A5:D6").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; ws.Range("A5:A6").Style.Border.RightBorder = XLBorderStyleValues.Thin; @@ -113,7 +113,7 @@ namespace rmutr_report.Controllers ws.Column(2).Width = 40; ws.Column(3).Width = 10; ws.Column(4).Width = 15; - ws.Column(5).Width = 15; + //ws.Column(5).Width = 15; int row = 7; //int row2 = 9; @@ -128,27 +128,27 @@ namespace rmutr_report.Controllers ws.Cell(row, 2).Value = house.type_vehicle_transport; ws.Cell(row, 3).Value = house.quantity; ws.Cell(row, 4).Value = house.repair_rate; - ws.Cell(row, 5).Value = house.amount; + //ws.Cell(row, 5).Value = house.amount; - ws.Range(ws.Cell(row, 1), ws.Cell(row, 5)).Style.Font.FontName = + ws.Range(ws.Cell(row, 1), ws.Cell(row, 4)).Style.Font.FontName = "TH SarabunPSK"; - ws.Range(ws.Cell(row, 1), ws.Cell(row, 5)).Style.Font.FontSize = 16; - ws.Range(ws.Cell(row, 1), ws.Cell(row, 5)).Style.Alignment.WrapText = true; - ws.Range(ws.Cell(row, 1), ws.Cell(row, 5)).Style.Alignment.Vertical = + ws.Range(ws.Cell(row, 1), ws.Cell(row, 4)).Style.Font.FontSize = 16; + ws.Range(ws.Cell(row, 1), ws.Cell(row, 4)).Style.Alignment.WrapText = true; + ws.Range(ws.Cell(row, 1), ws.Cell(row, 4)).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - ws.Range(ws.Cell(row, 1), ws.Cell(row, 5)).Style.Border.OutsideBorder = + ws.Range(ws.Cell(row, 1), ws.Cell(row, 4)).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - ws.Range(ws.Cell(row, 1), ws.Cell(row, 5)).Style.Border.RightBorder = + ws.Range(ws.Cell(row, 1), ws.Cell(row, 4)).Style.Border.RightBorder = XLBorderStyleValues.Thin; ws.Cell(row, 1).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; ws.Cell(row, 2).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; ws.Cell(row, 3).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; ws.Cell(row, 4).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; - ws.Cell(row, 5).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + //ws.Cell(row, 5).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; - ws.Range(ws.Cell(row, 4), ws.Cell(row, 5)).SetDataType(XLDataType.Number); - ws.Range(ws.Cell(row, 4), ws.Cell(row, 5)).Style.NumberFormat.SetFormat("#,#"); + ws.Cell(row, 4).SetDataType(XLDataType.Number); + ws.Cell(row, 4).Style.NumberFormat.SetFormat("#,#"); row++; } @@ -158,31 +158,31 @@ namespace rmutr_report.Controllers ws.Cell(row, 2).Value = house.type_vehicle_transport; ws.Cell(row, 3).Value = house.quantity; ws.Cell(row, 4).Value = house.repair_rate; - ws.Cell(row, 5).Value = house.amount; - ws.Range(ws.Cell(row, 1), ws.Cell(row, 5)).Style.Font.FontName = + //ws.Cell(row, 5).Value = house.amount; + ws.Range(ws.Cell(row, 1), ws.Cell(row, 4)).Style.Font.FontName = "TH SarabunPSK"; - ws.Range(ws.Cell(row, 1), ws.Cell(row, 5)).Style.Font.FontSize = 16; - ws.Range(ws.Cell(row, 1), ws.Cell(row, 5)).Style.Alignment.WrapText = true; + ws.Range(ws.Cell(row, 1), ws.Cell(row, 4)).Style.Font.FontSize = 16; + ws.Range(ws.Cell(row, 1), ws.Cell(row, 4)).Style.Alignment.WrapText = true; ws.Cell(row, 2).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; ws.Cell(row, 1).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; ws.Cell(row, 2).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; ws.Cell(row, 3).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; ws.Cell(row, 4).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - ws.Cell(row, 5).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + //ws.Cell(row, 5).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; ws.Cell(row, 1).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; ws.Cell(row, 3).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; ws.Cell(row, 4).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; - ws.Cell(row, 5).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + //ws.Cell(row, 5).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; ws.Range(ws.Cell(row, 1), ws.Cell(row, 2)).Style.Border.LeftBorder = XLBorderStyleValues.None; - ws.Range(ws.Cell(row, 2), ws.Cell(row, 5)).Style.Border.RightBorder = + ws.Range(ws.Cell(row, 2), ws.Cell(row, 4)).Style.Border.RightBorder = XLBorderStyleValues.Thin; ws.Cell(row, 1).Style.Border.RightBorder = XLBorderStyleValues.None; - ws.Range(ws.Cell(row, 1), ws.Cell(row, 5)).Style.Border.OutsideBorder = + ws.Range(ws.Cell(row, 1), ws.Cell(row, 4)).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - ws.Range(ws.Cell(row, 4), ws.Cell(row, 5)).SetDataType(XLDataType.Number); - ws.Range(ws.Cell(row, 4), ws.Cell(row, 5)).Style.NumberFormat.SetFormat("#,#"); + ws.Cell(row, 4).SetDataType(XLDataType.Number); + ws.Cell(row, 4).Style.NumberFormat.SetFormat("#,#"); row++; } } @@ -269,21 +269,21 @@ namespace rmutr_report.Controllers ws.Cell("D6").Style.Font.FontSize = 16; ws.Cell("D6").Style.Font.Bold = true; ws.Cell("D6").Style.Alignment.WrapText = true; - ws.Cell("E5").Value = "ค่าน้ำมันเชื้อเพลิง"; - ws.Cell("E5").Style.Font.FontName = "TH SarabunPSK"; - ws.Cell("E5").Style.Font.FontSize = 16; - ws.Cell("E5").Style.Font.Bold = true; - ws.Cell("E5").Style.Alignment.WrapText = true; - ws.Cell("E6").Value = "บาท/ปี"; - ws.Cell("E6").Style.Font.FontName = "TH SarabunPSK"; - ws.Cell("E6").Style.Font.FontSize = 16; - ws.Cell("E6").Style.Font.Bold = true; - ws.Cell("E6").Style.Alignment.WrapText = true; + // ws.Cell("E5").Value = "ค่าน้ำมันเชื้อเพลิง"; + // ws.Cell("E5").Style.Font.FontName = "TH SarabunPSK"; + // ws.Cell("E5").Style.Font.FontSize = 16; + // ws.Cell("E5").Style.Font.Bold = true; + // ws.Cell("E5").Style.Alignment.WrapText = true; + // ws.Cell("E6").Value = "บาท/ปี"; + // ws.Cell("E6").Style.Font.FontName = "TH SarabunPSK"; + // ws.Cell("E6").Style.Font.FontSize = 16; + // ws.Cell("E6").Style.Font.Bold = true; + // ws.Cell("E6").Style.Alignment.WrapText = true; - ws.Range("A5:E6").Style.Fill.BackgroundColor = XLColor.Gainsboro; - ws.Range("A5:E6").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; - ws.Range("A5:E6").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - ws.Range("A5:E6").Style.Border.OutsideBorder = + ws.Range("A5:D6").Style.Fill.BackgroundColor = XLColor.Gainsboro; + ws.Range("A5:D6").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Range("A5:D6").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("A5:D6").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; ws.Range("A5:A6").Style.Border.RightBorder = XLBorderStyleValues.Thin; @@ -298,7 +298,7 @@ namespace rmutr_report.Controllers ws.Column(2).Width = 40; ws.Column(3).Width = 10; ws.Column(4).Width = 25; - ws.Column(5).Width = 25; + //ws.Column(5).Width = 25; int row = 7; //int row2 = 9; @@ -313,29 +313,29 @@ namespace rmutr_report.Controllers ws.Cell(row, 2).Value = house.type_vehicle_transport; ws.Cell(row, 3).Value = house.quantity; ws.Cell(row, 4).Value = house.repair_rate; - ws.Cell(row, 5).Value = house.amount; + //ws.Cell(row, 5).Value = house.amount; - ws.Range(ws.Cell(row, 1), ws.Cell(row, 5)).Style.Font.FontName = + ws.Range(ws.Cell(row, 1), ws.Cell(row, 4)).Style.Font.FontName = "TH SarabunPSK"; - ws.Range(ws.Cell(row, 1), ws.Cell(row, 5)).Style.Font.FontSize = 16; - ws.Range(ws.Cell(row, 1), ws.Cell(row, 5)).Style.Alignment.WrapText = true; - ws.Range(ws.Cell(row, 1), ws.Cell(row, 5)).Style.Alignment.Vertical = + ws.Range(ws.Cell(row, 1), ws.Cell(row, 4)).Style.Font.FontSize = 16; + ws.Range(ws.Cell(row, 1), ws.Cell(row, 4)).Style.Alignment.WrapText = true; + ws.Range(ws.Cell(row, 1), ws.Cell(row, 4)).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - ws.Range(ws.Cell(row, 1), ws.Cell(row, 5)).Style.Border.OutsideBorder = + ws.Range(ws.Cell(row, 1), ws.Cell(row, 4)).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - ws.Range(ws.Cell(row, 1), ws.Cell(row, 5)).Style.Border.RightBorder = + ws.Range(ws.Cell(row, 1), ws.Cell(row, 4)).Style.Border.RightBorder = XLBorderStyleValues.Thin; ws.Cell(row, 1).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; ws.Cell(row, 2).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; ws.Cell(row, 3).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; ws.Cell(row, 4).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; - ws.Cell(row, 5).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; - ws.Range(ws.Cell(row, 1), ws.Cell(row, 5)).Style.Alignment.Vertical = + //ws.Cell(row, 5).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Range(ws.Cell(row, 1), ws.Cell(row, 4)).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - ws.Range(ws.Cell(row, 4), ws.Cell(row, 5)).SetDataType(XLDataType.Number); - ws.Range(ws.Cell(row, 4), ws.Cell(row, 5)).Style.NumberFormat.SetFormat("#,#"); + ws.Cell(row, 4).SetDataType(XLDataType.Number); + ws.Cell(row, 4).Style.NumberFormat.SetFormat("#,#"); row++; } @@ -345,31 +345,31 @@ namespace rmutr_report.Controllers ws.Cell(row, 2).Value = house.type_vehicle_transport; ws.Cell(row, 3).Value = house.quantity; ws.Cell(row, 4).Value = house.repair_rate; - ws.Cell(row, 5).Value = house.amount; - ws.Range(ws.Cell(row, 1), ws.Cell(row, 5)).Style.Font.FontName = + //ws.Cell(row, 5).Value = house.amount; + ws.Range(ws.Cell(row, 1), ws.Cell(row, 4)).Style.Font.FontName = "TH SarabunPSK"; - ws.Range(ws.Cell(row, 1), ws.Cell(row, 5)).Style.Font.FontSize = 16; - ws.Range(ws.Cell(row, 1), ws.Cell(row, 5)).Style.Alignment.WrapText = true; + ws.Range(ws.Cell(row, 1), ws.Cell(row, 4)).Style.Font.FontSize = 16; + ws.Range(ws.Cell(row, 1), ws.Cell(row, 4)).Style.Alignment.WrapText = true; ws.Cell(row, 2).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; ws.Cell(row, 1).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; ws.Cell(row, 2).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; ws.Cell(row, 3).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; ws.Cell(row, 4).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - ws.Cell(row, 5).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + //ws.Cell(row, 5).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; ws.Cell(row, 1).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; ws.Cell(row, 3).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; ws.Cell(row, 4).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; - ws.Cell(row, 5).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + //ws.Cell(row, 5).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; ws.Range(ws.Cell(row, 1), ws.Cell(row, 2)).Style.Border.LeftBorder = XLBorderStyleValues.None; - ws.Range(ws.Cell(row, 2), ws.Cell(row, 5)).Style.Border.RightBorder = + ws.Range(ws.Cell(row, 2), ws.Cell(row, 4)).Style.Border.RightBorder = XLBorderStyleValues.Thin; ws.Cell(row, 1).Style.Border.RightBorder = XLBorderStyleValues.None; - ws.Range(ws.Cell(row, 1), ws.Cell(row, 5)).Style.Border.OutsideBorder = + ws.Range(ws.Cell(row, 1), ws.Cell(row, 4)).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - ws.Range(ws.Cell(row, 4), ws.Cell(row, 5)).SetDataType(XLDataType.Number); - ws.Range(ws.Cell(row, 4), ws.Cell(row, 5)).Style.NumberFormat.SetFormat("#,#"); + ws.Cell(row, 4).SetDataType(XLDataType.Number); + ws.Cell(row, 4).Style.NumberFormat.SetFormat("#,#"); row++; } } diff --git a/Models/budget/repair_cost.cs b/Models/budget/repair_cost.cs index 3eae4ea..dc30cf4 100644 --- a/Models/budget/repair_cost.cs +++ b/Models/budget/repair_cost.cs @@ -18,6 +18,6 @@ namespace rmutr_report.Models public string type_vehicle_transport { get; set; } public decimal? quantity { get; set; } public decimal? repair_rate { get; set; } - public decimal? amount { get; set; } + //public decimal? amount { get; set; } } } \ No newline at end of file