bug fixed
This commit is contained in:
@@ -194,7 +194,6 @@ namespace rmutr_report.Controllers
|
|||||||
ws.Cell("M6").Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
ws.Cell("M6").Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||||
foreach (var equipments in summary_of_equipments.data)
|
foreach (var equipments in summary_of_equipments.data)
|
||||||
{
|
{
|
||||||
|
|
||||||
ws.Cell(row, 1).Value = no;
|
ws.Cell(row, 1).Value = no;
|
||||||
no++;
|
no++;
|
||||||
ws.Cell(row, 2).Value = equipments.list;
|
ws.Cell(row, 2).Value = equipments.list;
|
||||||
@@ -250,6 +249,7 @@ namespace rmutr_report.Controllers
|
|||||||
row++;
|
row++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Report report = new Report();
|
Report report = new Report();
|
||||||
report.Load(_setting.report_path + "summary_of_equipment.frx");
|
report.Load(_setting.report_path + "summary_of_equipment.frx");
|
||||||
report.RegisterData(_summary_of_equipment, "summary_of_equipment");
|
report.RegisterData(_summary_of_equipment, "summary_of_equipment");
|
||||||
@@ -275,7 +275,8 @@ namespace rmutr_report.Controllers
|
|||||||
stream.Seek(0, SeekOrigin.Begin);
|
stream.Seek(0, SeekOrigin.Begin);
|
||||||
return File(stream, "text/csv");
|
return File(stream, "text/csv");
|
||||||
break;
|
break;
|
||||||
case "xlsx": case "xls":
|
case "xlsx":
|
||||||
|
case "xls":
|
||||||
workbook.SaveAs(stream);
|
workbook.SaveAs(stream);
|
||||||
var content = stream.ToArray();
|
var content = stream.ToArray();
|
||||||
string date = DateTime.Now.ToString("yyyyMMddHHmmss");
|
string date = DateTime.Now.ToString("yyyyMMddHHmmss");
|
||||||
@@ -296,7 +297,6 @@ namespace rmutr_report.Controllers
|
|||||||
// "equipments_" + date + ".xlsx");
|
// "equipments_" + date + ".xlsx");
|
||||||
// }
|
// }
|
||||||
return Ok();
|
return Ok();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpPost, Route("reports/summary_of_equipment_five_year/{type}")]
|
[HttpPost, Route("reports/summary_of_equipment_five_year/{type}")]
|
||||||
@@ -309,7 +309,8 @@ namespace rmutr_report.Controllers
|
|||||||
var imagePath = _setting.report_path + @"Logo-RMUTR.png";
|
var imagePath = _setting.report_path + @"Logo-RMUTR.png";
|
||||||
ws.AddPicture(imagePath).MoveTo(ws.Cell("A1")).Scale(0.27);
|
ws.AddPicture(imagePath).MoveTo(ws.Cell("A1")).Scale(0.27);
|
||||||
ws.Range("A1:P1").Merge().Value =
|
ws.Range("A1:P1").Merge().Value =
|
||||||
"สรุปแผนความต้องการ รายการครุภัณฑ์ ของมหาวิทยาลัยเทคโนโลยีราชมงคลรัตนโกสินทร์ ปีงบประมาณ" + summary_of_equipments.budget_year;
|
"สรุปแผนความต้องการ รายการครุภัณฑ์ ของมหาวิทยาลัยเทคโนโลยีราชมงคลรัตนโกสินทร์ ปีงบประมาณ" +
|
||||||
|
summary_of_equipments.budget_year;
|
||||||
ws.Range("A1:P1").Merge().Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
ws.Range("A1:P1").Merge().Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||||||
ws.Range("A1:P1").Merge().Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
ws.Range("A1:P1").Merge().Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||||||
ws.Cell("A1").Style.Font.Bold = true;
|
ws.Cell("A1").Style.Font.Bold = true;
|
||||||
@@ -543,21 +544,24 @@ namespace rmutr_report.Controllers
|
|||||||
ws.Range(ws.Cell(row, 8), ws.Cell(row, 14)).Style.NumberFormat.SetFormat("#,#");
|
ws.Range(ws.Cell(row, 8), ws.Cell(row, 14)).Style.NumberFormat.SetFormat("#,#");
|
||||||
row++;
|
row++;
|
||||||
}
|
}
|
||||||
if (equipments.color == 2)
|
|
||||||
|
foreach (var equipments1 in equipments.data)
|
||||||
|
{
|
||||||
|
if (equipments1.color == 2)
|
||||||
{
|
{
|
||||||
ws.Cell(row, 1).Value = null;
|
ws.Cell(row, 1).Value = null;
|
||||||
ws.Cell(row, 2).Value = equipments.list;
|
ws.Cell(row, 2).Value = equipments1.faculty_name;
|
||||||
ws.Cell(row, 3).Value = null;
|
ws.Cell(row, 3).Value = null;
|
||||||
ws.Cell(row, 4).Value = null;
|
ws.Cell(row, 4).Value = null;
|
||||||
ws.Cell(row, 5).Value = null;
|
ws.Cell(row, 5).Value = null;
|
||||||
ws.Cell(row, 6).Value = null;
|
ws.Cell(row, 6).Value = null;
|
||||||
ws.Cell(row, 7).Value = null;
|
ws.Cell(row, 7).Value = null;
|
||||||
ws.Cell(row, 8).Value = equipments.unit_price;
|
ws.Cell(row, 8).Value = equipments1.unit_price;
|
||||||
ws.Cell(row, 9).Value = equipments.price_1;
|
ws.Cell(row, 9).Value = equipments1.price_1;
|
||||||
ws.Cell(row, 10).Value = equipments.price_2;
|
ws.Cell(row, 10).Value = equipments1.price_2;
|
||||||
ws.Cell(row, 11).Value = equipments.price_3;
|
ws.Cell(row, 11).Value = equipments1.price_3;
|
||||||
ws.Cell(row, 12).Value = equipments.price_4;
|
ws.Cell(row, 12).Value = equipments1.price_4;
|
||||||
ws.Cell(row, 13).Value = equipments.price_5;
|
ws.Cell(row, 13).Value = equipments1.price_5;
|
||||||
ws.Cell(row, 14).Value = null;
|
ws.Cell(row, 14).Value = null;
|
||||||
ws.Cell(row, 15).Value = null;
|
ws.Cell(row, 15).Value = null;
|
||||||
ws.Cell(row, 16).Value = null;
|
ws.Cell(row, 16).Value = null;
|
||||||
@@ -583,7 +587,8 @@ namespace rmutr_report.Controllers
|
|||||||
ws.Range(ws.Cell(row, 1), ws.Cell(row, 16)).Style.Alignment.WrapText = true;
|
ws.Range(ws.Cell(row, 1), ws.Cell(row, 16)).Style.Alignment.WrapText = true;
|
||||||
ws.Range(ws.Cell(row, 1), ws.Cell(row, 16)).Style.Alignment.Vertical =
|
ws.Range(ws.Cell(row, 1), ws.Cell(row, 16)).Style.Alignment.Vertical =
|
||||||
XLAlignmentVerticalValues.Center;
|
XLAlignmentVerticalValues.Center;
|
||||||
ws.Range(ws.Cell(row, 1), ws.Cell(row, 16)).Style.Fill.BackgroundColor=XLColor.LavenderPurple;
|
ws.Range(ws.Cell(row, 1), ws.Cell(row, 16)).Style.Fill.BackgroundColor =
|
||||||
|
XLColor.LavenderPurple;
|
||||||
ws.Cell(row, 1).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
ws.Cell(row, 1).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||||||
ws.Cell(row, 2).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left;
|
ws.Cell(row, 2).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left;
|
||||||
ws.Cell(row, 3).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
ws.Cell(row, 3).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||||||
@@ -603,22 +608,24 @@ namespace rmutr_report.Controllers
|
|||||||
ws.Range(ws.Cell(row, 8), ws.Cell(row, 14)).Style.NumberFormat.SetFormat("#,#");
|
ws.Range(ws.Cell(row, 8), ws.Cell(row, 14)).Style.NumberFormat.SetFormat("#,#");
|
||||||
row++;
|
row++;
|
||||||
}
|
}
|
||||||
if (equipments.color == 3)
|
|
||||||
{
|
|
||||||
|
|
||||||
|
foreach (var equipments2 in equipments1.data)
|
||||||
|
{
|
||||||
|
if (equipments2.color == 3)
|
||||||
|
{
|
||||||
ws.Cell(row, 1).Value = null;
|
ws.Cell(row, 1).Value = null;
|
||||||
ws.Cell(row, 2).Value = equipments.list;
|
ws.Cell(row, 2).Value = equipments2.list;
|
||||||
ws.Cell(row, 3).Value = null;
|
ws.Cell(row, 3).Value = null;
|
||||||
ws.Cell(row, 4).Value = null;
|
ws.Cell(row, 4).Value = null;
|
||||||
ws.Cell(row, 5).Value = null;
|
ws.Cell(row, 5).Value = null;
|
||||||
ws.Cell(row, 6).Value = null;
|
ws.Cell(row, 6).Value = null;
|
||||||
ws.Cell(row, 7).Value = null;
|
ws.Cell(row, 7).Value = null;
|
||||||
ws.Cell(row, 8).Value = equipments.unit_price;
|
ws.Cell(row, 8).Value = equipments2.unit_price;
|
||||||
ws.Cell(row, 9).Value = equipments.price_1;
|
ws.Cell(row, 9).Value = equipments2.price_1;
|
||||||
ws.Cell(row, 10).Value = equipments.price_2;
|
ws.Cell(row, 10).Value = equipments2.price_2;
|
||||||
ws.Cell(row, 11).Value = equipments.price_3;
|
ws.Cell(row, 11).Value = equipments2.price_3;
|
||||||
ws.Cell(row, 12).Value = equipments.price_4;
|
ws.Cell(row, 12).Value = equipments2.price_4;
|
||||||
ws.Cell(row, 13).Value = equipments.price_5;
|
ws.Cell(row, 13).Value = equipments2.price_5;
|
||||||
ws.Cell(row, 14).Value = null;
|
ws.Cell(row, 14).Value = null;
|
||||||
ws.Cell(row, 15).Value = null;
|
ws.Cell(row, 15).Value = null;
|
||||||
ws.Cell(row, 16).Value = null;
|
ws.Cell(row, 16).Value = null;
|
||||||
@@ -644,7 +651,8 @@ namespace rmutr_report.Controllers
|
|||||||
ws.Range(ws.Cell(row, 1), ws.Cell(row, 16)).Style.Alignment.WrapText = true;
|
ws.Range(ws.Cell(row, 1), ws.Cell(row, 16)).Style.Alignment.WrapText = true;
|
||||||
ws.Range(ws.Cell(row, 1), ws.Cell(row, 16)).Style.Alignment.Vertical =
|
ws.Range(ws.Cell(row, 1), ws.Cell(row, 16)).Style.Alignment.Vertical =
|
||||||
XLAlignmentVerticalValues.Center;
|
XLAlignmentVerticalValues.Center;
|
||||||
ws.Range(ws.Cell(row, 1), ws.Cell(row, 16)).Style.Fill.BackgroundColor=XLColor.GrannySmithApple;
|
ws.Range(ws.Cell(row, 1), ws.Cell(row, 16)).Style.Fill.BackgroundColor =
|
||||||
|
XLColor.GrannySmithApple;
|
||||||
ws.Cell(row, 1).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
ws.Cell(row, 1).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||||||
ws.Cell(row, 2).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left;
|
ws.Cell(row, 2).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left;
|
||||||
ws.Cell(row, 3).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
ws.Cell(row, 3).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||||||
@@ -663,28 +671,27 @@ namespace rmutr_report.Controllers
|
|||||||
ws.Cell(row, 16).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left;
|
ws.Cell(row, 16).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left;
|
||||||
ws.Range(ws.Cell(row, 8), ws.Cell(row, 14)).Style.NumberFormat.SetFormat("#,#");
|
ws.Range(ws.Cell(row, 8), ws.Cell(row, 14)).Style.NumberFormat.SetFormat("#,#");
|
||||||
row++;
|
row++;
|
||||||
|
|
||||||
}
|
}
|
||||||
foreach (var equipment in equipments.data)
|
|
||||||
{
|
|
||||||
|
|
||||||
|
foreach (var equipment3 in equipments2.data)
|
||||||
|
{
|
||||||
ws.Cell(row, 1).Value = no;
|
ws.Cell(row, 1).Value = no;
|
||||||
no++;
|
no++;
|
||||||
ws.Cell(row, 2).Value = equipment.list;
|
ws.Cell(row, 2).Value = equipment3.list;
|
||||||
ws.Cell(row, 3).Value = equipment.type_1;
|
ws.Cell(row, 3).Value = equipment3.type_1;
|
||||||
ws.Cell(row, 4).Value = equipment.type_2;
|
ws.Cell(row, 4).Value = equipment3.type_2;
|
||||||
ws.Cell(row, 5).Value = equipment.type_3;
|
ws.Cell(row, 5).Value = equipment3.type_3;
|
||||||
ws.Cell(row, 6).Value = equipment.unit;
|
ws.Cell(row, 6).Value = equipment3.unit;
|
||||||
ws.Cell(row, 7).Value = equipment.quantity;
|
ws.Cell(row, 7).Value = equipment3.quantity;
|
||||||
ws.Cell(row, 8).Value = equipment.unit_price;
|
ws.Cell(row, 8).Value = equipment3.unit_price;
|
||||||
ws.Cell(row, 9).Value = equipment.price_1;
|
ws.Cell(row, 9).Value = equipment3.price_1;
|
||||||
ws.Cell(row, 10).Value = equipment.price_2;
|
ws.Cell(row, 10).Value = equipment3.price_2;
|
||||||
ws.Cell(row, 11).Value = equipment.price_3;
|
ws.Cell(row, 11).Value = equipment3.price_3;
|
||||||
ws.Cell(row, 12).Value = equipment.price_4;
|
ws.Cell(row, 12).Value = equipment3.price_4;
|
||||||
ws.Cell(row, 13).Value = equipment.price_5;
|
ws.Cell(row, 13).Value = equipment3.price_5;
|
||||||
ws.Cell(row, 14).Value = equipment.amount;
|
ws.Cell(row, 14).Value = equipment3.amount;
|
||||||
ws.Cell(row, 15).Value = equipment.company;
|
ws.Cell(row, 15).Value = equipment3.company;
|
||||||
ws.Cell(row, 16).Value = equipment.description;
|
ws.Cell(row, 16).Value = equipment3.description;
|
||||||
ws.Cell(row, 1).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
ws.Cell(row, 1).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||||
ws.Cell(row, 2).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
ws.Cell(row, 2).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||||
ws.Cell(row, 3).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
ws.Cell(row, 3).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||||
@@ -724,53 +731,58 @@ namespace rmutr_report.Controllers
|
|||||||
ws.Cell(row, 15).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left;
|
ws.Cell(row, 15).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left;
|
||||||
ws.Cell(row, 16).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left;
|
ws.Cell(row, 16).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left;
|
||||||
ws.Range(ws.Cell(row, 8), ws.Cell(row, 14)).Style.NumberFormat.SetFormat("#,#");
|
ws.Range(ws.Cell(row, 8), ws.Cell(row, 14)).Style.NumberFormat.SetFormat("#,#");
|
||||||
//string str = equipment.amount;
|
string str = equipment3.amount;
|
||||||
string str = equipment.amount+"\n"+ equipment.amount+"\n"+ equipment.amount;
|
string str2 = equipment3.amount + "\n" + equipment3.amount + "\n" + equipment3.amount;
|
||||||
//string str3 = str2.Substring(7, 39);
|
//string str3 = str2.Substring(0, 7);
|
||||||
if (str.Length == 4)
|
if (str.Length == 4)
|
||||||
{
|
{
|
||||||
for (int i = 1; i <= str.Length - 1; i += 4)
|
for (int i = 1; i <= str.Length - 1; i += 4)
|
||||||
{
|
{
|
||||||
equipment.amount = str.Insert(i, ",");
|
equipment3.amount = str.Insert(i, ",");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (str.Length == 5)
|
else if (str.Length == 5)
|
||||||
{
|
{
|
||||||
for (int i = 2; i <= str.Length - 1; i += 5)
|
for (int i = 2; i <= str.Length - 1; i += 5)
|
||||||
{
|
{
|
||||||
equipment.amount= str.Insert(i, ",");
|
equipment3.amount = str.Insert(i, ",");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (str.Length == 6)
|
else if (str.Length == 6)
|
||||||
{
|
{
|
||||||
for (int i = 3; i <= str.Length - 1; i += 6)
|
for (int i = 3; i <= str.Length - 1; i += 6)
|
||||||
{
|
{
|
||||||
equipment.amount= str.Insert(i, ",");
|
equipment3.amount = str.Insert(i, ",");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (str.Length == 7)
|
else if (str.Length == 7)
|
||||||
{
|
{
|
||||||
for (int i = 4; i <= str.Length - 1; i += 7)
|
for (int i = 4; i <= str.Length - 1; i += 7)
|
||||||
{
|
{
|
||||||
equipment.amount= str.Insert(i, ",");
|
equipment3.amount = str.Insert(i, ",");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// else if (str3.Length == 7)
|
||||||
|
// {
|
||||||
|
// for (int i = 4; i <= str3.Length - 1; i += 7)
|
||||||
|
// {
|
||||||
|
// equipment.amount= str3.Insert(i, ",");
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
equipment.amount = str;
|
equipment3.amount = str;
|
||||||
}
|
}
|
||||||
|
|
||||||
row++;
|
row++;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
//}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
using (var stream = new MemoryStream())
|
using (var stream = new MemoryStream())
|
||||||
{
|
{
|
||||||
@@ -781,13 +793,14 @@ namespace rmutr_report.Controllers
|
|||||||
content,
|
content,
|
||||||
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
||||||
"equipment_" + date + ".xlsx");
|
"equipment_" + date + ".xlsx");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[HttpPost, Route("reports/statement_of_equipment/{type}")]
|
[HttpPost, Route("reports/statement_of_equipment/{type}")]
|
||||||
[ApiExplorerSettings(GroupName = "reports")]
|
[ApiExplorerSettings(GroupName = "reports")]
|
||||||
public IActionResult GetStEquipmentReport([FromRoute] string type, [FromBody] statement_of_equipment equipments)
|
public IActionResult GetStEquipmentReport([FromRoute] string type,
|
||||||
|
[FromBody] statement_of_equipment equipments)
|
||||||
{
|
{
|
||||||
var a = equipments.page_1.ToArray();
|
var a = equipments.page_1.ToArray();
|
||||||
foreach (var aa in a)
|
foreach (var aa in a)
|
||||||
@@ -1053,9 +1066,12 @@ namespace rmutr_report.Controllers
|
|||||||
if (summary_building_constructions != null)
|
if (summary_building_constructions != null)
|
||||||
{
|
{
|
||||||
//string first = "สรุปแผนความต้องการ รายการก่อสร้างอาคารหรือสิ่งก่อสร้างและปรับปรุงซ่อมแซมต่อเติม ของมหาวิทยาลัยเทคโนโลยีราชมงคลรัตนโกสินทร์";
|
//string first = "สรุปแผนความต้องการ รายการก่อสร้างอาคารหรือสิ่งก่อสร้างและปรับปรุงซ่อมแซมต่อเติม ของมหาวิทยาลัยเทคโนโลยีราชมงคลรัตนโกสินทร์";
|
||||||
string second = "ปีงบประมาณ " + summary_building_constructions.academic_year_name_th + " " + summary_building_constructions.header_name;
|
string second = "ปีงบประมาณ " + summary_building_constructions.academic_year_name_th + " " +
|
||||||
string third = "หน่วยงาน/คณะ " + summary_building_constructions.agency_name_th + " พื้นที่ " + summary_building_constructions.location;
|
summary_building_constructions.header_name;
|
||||||
ws.Range("A1:S1").Merge().Value = "สรุปแผนความต้องการ รายการก่อสร้างอาคารหรือสิ่งก่อสร้างและปรับปรุงซ่อมแซมต่อเติม ของมหาวิทยาลัยเทคโนโลยีราชมงคลรัตนโกสินทร์";
|
string third = "หน่วยงาน/คณะ " + summary_building_constructions.agency_name_th +
|
||||||
|
" พื้นที่ " + summary_building_constructions.location;
|
||||||
|
ws.Range("A1:S1").Merge().Value =
|
||||||
|
"สรุปแผนความต้องการ รายการก่อสร้างอาคารหรือสิ่งก่อสร้างและปรับปรุงซ่อมแซมต่อเติม ของมหาวิทยาลัยเทคโนโลยีราชมงคลรัตนโกสินทร์";
|
||||||
ws.Range("A1:S1").Merge().Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
ws.Range("A1:S1").Merge().Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||||||
ws.Range("A1:S1").Merge().Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
ws.Range("A1:S1").Merge().Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||||||
ws.Range("A2:S2").Merge().Value = second;
|
ws.Range("A2:S2").Merge().Value = second;
|
||||||
@@ -1103,7 +1119,8 @@ namespace rmutr_report.Controllers
|
|||||||
ws.Cell("P5").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
ws.Cell("P5").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||||||
ws.Cell("P5").Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
ws.Cell("P5").Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||||
ws.Range("L5:P5").Style.Fill.BackgroundColor = XLColor.MistyRose;
|
ws.Range("L5:P5").Style.Fill.BackgroundColor = XLColor.MistyRose;
|
||||||
ws.Range("Q4:R4").Merge().Value = "ความพร้อมสิ่งก่อสร้าง ปี "+summary_building_constructions.academic_year;
|
ws.Range("Q4:R4").Merge().Value = "ความพร้อมสิ่งก่อสร้าง ปี " +
|
||||||
|
summary_building_constructions.academic_year;
|
||||||
ws.Range("Q4:R4").Style.Fill.BackgroundColor = XLColor.MistyRose;
|
ws.Range("Q4:R4").Style.Fill.BackgroundColor = XLColor.MistyRose;
|
||||||
ws.Cell("Q4").Style.Font.FontName = "TH Sarabun New";
|
ws.Cell("Q4").Style.Font.FontName = "TH Sarabun New";
|
||||||
ws.Cell("Q4").Style.Font.FontSize = 14;
|
ws.Cell("Q4").Style.Font.FontSize = 14;
|
||||||
@@ -1161,7 +1178,8 @@ namespace rmutr_report.Controllers
|
|||||||
ws.Range(ws.Cell(row, 1), ws.Cell(row, 19)).Style.Alignment.WrapText = true;
|
ws.Range(ws.Cell(row, 1), ws.Cell(row, 19)).Style.Alignment.WrapText = true;
|
||||||
ws.Range(ws.Cell(row, 1), ws.Cell(row, 19)).Style.Alignment.Vertical =
|
ws.Range(ws.Cell(row, 1), ws.Cell(row, 19)).Style.Alignment.Vertical =
|
||||||
XLAlignmentVerticalValues.Center;
|
XLAlignmentVerticalValues.Center;
|
||||||
ws.Range(ws.Cell(row, 1), ws.Cell(row, 19)).Style.Fill.BackgroundColor=XLColor.BabyBlue;
|
ws.Range(ws.Cell(row, 1), ws.Cell(row, 19)).Style.Fill.BackgroundColor =
|
||||||
|
XLColor.BabyBlue;
|
||||||
ws.Cell(row, 1).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
ws.Cell(row, 1).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||||||
ws.Cell(row, 2).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left;
|
ws.Cell(row, 2).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left;
|
||||||
ws.Cell(row, 3).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
ws.Cell(row, 3).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||||||
@@ -1184,167 +1202,185 @@ namespace rmutr_report.Controllers
|
|||||||
ws.Range(ws.Cell(row, 11), ws.Cell(row, 16)).Style.NumberFormat.SetFormat("#,#");
|
ws.Range(ws.Cell(row, 11), ws.Cell(row, 16)).Style.NumberFormat.SetFormat("#,#");
|
||||||
row++;
|
row++;
|
||||||
}
|
}
|
||||||
if (buildings.color == 2)
|
|
||||||
{
|
|
||||||
ws.Cell(row, 1).Value = null;
|
|
||||||
ws.Cell(row, 2).Value = buildings.list;
|
|
||||||
ws.Cell(row, 3).Value = null;
|
|
||||||
ws.Cell(row, 4).Value = null;
|
|
||||||
ws.Cell(row, 5).Value =null;
|
|
||||||
ws.Cell(row, 6).Value = null;
|
|
||||||
ws.Cell(row, 7).Value = null;
|
|
||||||
ws.Cell(row, 8).Value = null;
|
|
||||||
ws.Cell(row, 9).Value = null;
|
|
||||||
ws.Cell(row, 10).Value = null;
|
|
||||||
ws.Cell(row, 11).Value = buildings.budget;
|
|
||||||
ws.Cell(row, 12).Value = buildings.price_1;
|
|
||||||
ws.Cell(row, 13).Value = buildings.price_2;
|
|
||||||
ws.Cell(row, 14).Value = buildings.price_3;
|
|
||||||
ws.Cell(row, 15).Value = buildings.price_4;
|
|
||||||
ws.Cell(row, 16).Value = buildings.price_5;
|
|
||||||
ws.Cell(row, 17).Value = null;
|
|
||||||
ws.Cell(row, 18).Value = null;
|
|
||||||
ws.Cell(row, 19).Value = null;
|
|
||||||
ws.Cell(row, 1).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
|
||||||
ws.Cell(row, 2).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
|
||||||
ws.Cell(row, 3).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
|
||||||
ws.Cell(row, 4).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
|
||||||
ws.Cell(row, 5).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
|
||||||
ws.Cell(row, 6).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
|
||||||
ws.Cell(row, 7).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
|
||||||
ws.Cell(row, 8).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
|
||||||
ws.Cell(row, 9).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
|
||||||
ws.Cell(row, 10).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
|
||||||
ws.Cell(row, 11).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
|
||||||
ws.Cell(row, 12).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
|
||||||
ws.Cell(row, 13).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
|
||||||
ws.Cell(row, 14).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
|
||||||
ws.Cell(row, 15).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
|
||||||
ws.Cell(row, 16).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
|
||||||
ws.Cell(row, 17).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
|
||||||
ws.Cell(row, 18).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
|
||||||
ws.Cell(row, 19).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
|
||||||
ws.Range(ws.Cell(row, 1), ws.Cell(row, 19)).Style.Font.FontName =
|
|
||||||
"TH Sarabun New";
|
|
||||||
ws.Range(ws.Cell(row, 1), ws.Cell(row, 19)).Style.Font.FontSize = 11;
|
|
||||||
ws.Range(ws.Cell(row, 1), ws.Cell(row, 19)).Style.Alignment.WrapText = true;
|
|
||||||
ws.Range(ws.Cell(row, 1), ws.Cell(row, 19)).Style.Alignment.Vertical =
|
|
||||||
XLAlignmentVerticalValues.Center;
|
|
||||||
ws.Range(ws.Cell(row, 1), ws.Cell(row, 19)).Style.Fill.BackgroundColor=XLColor.LavenderPurple;
|
|
||||||
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, 6).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
|
||||||
ws.Cell(row, 7).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left;
|
|
||||||
ws.Cell(row, 8).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
|
||||||
ws.Cell(row, 9).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
|
||||||
ws.Cell(row, 10).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
|
||||||
ws.Cell(row, 11).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
|
|
||||||
ws.Cell(row, 12).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
|
|
||||||
ws.Cell(row, 13).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
|
|
||||||
ws.Cell(row, 14).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
|
|
||||||
ws.Cell(row, 15).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
|
|
||||||
ws.Cell(row, 16).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
|
|
||||||
ws.Cell(row, 17).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
|
||||||
ws.Cell(row, 18).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
|
||||||
ws.Cell(row, 19).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left;
|
|
||||||
ws.Range(ws.Cell(row, 11), ws.Cell(row, 16)).Style.NumberFormat.SetFormat("#,#");
|
|
||||||
row++;
|
|
||||||
}
|
|
||||||
if (buildings.color == 3)
|
|
||||||
{
|
|
||||||
ws.Cell(row, 1).Value = null;
|
|
||||||
ws.Cell(row, 2).Value = buildings.list;
|
|
||||||
ws.Cell(row, 3).Value = null;
|
|
||||||
ws.Cell(row, 4).Value = null;
|
|
||||||
ws.Cell(row, 5).Value =null;
|
|
||||||
ws.Cell(row, 6).Value = null;
|
|
||||||
ws.Cell(row, 7).Value = null;
|
|
||||||
ws.Cell(row, 8).Value = null;
|
|
||||||
ws.Cell(row, 9).Value = null;
|
|
||||||
ws.Cell(row, 10).Value = null;
|
|
||||||
ws.Cell(row, 11).Value = buildings.budget;
|
|
||||||
ws.Cell(row, 12).Value = buildings.price_1;
|
|
||||||
ws.Cell(row, 13).Value = buildings.price_2;
|
|
||||||
ws.Cell(row, 14).Value = buildings.price_3;
|
|
||||||
ws.Cell(row, 15).Value = buildings.price_4;
|
|
||||||
ws.Cell(row, 16).Value = buildings.price_5;
|
|
||||||
ws.Cell(row, 17).Value = null;
|
|
||||||
ws.Cell(row, 18).Value = null;
|
|
||||||
ws.Cell(row, 19).Value = null;
|
|
||||||
ws.Cell(row, 1).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
|
||||||
ws.Cell(row, 2).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
|
||||||
ws.Cell(row, 3).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
|
||||||
ws.Cell(row, 4).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
|
||||||
ws.Cell(row, 5).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
|
||||||
ws.Cell(row, 6).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
|
||||||
ws.Cell(row, 7).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
|
||||||
ws.Cell(row, 8).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
|
||||||
ws.Cell(row, 9).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
|
||||||
ws.Cell(row, 10).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
|
||||||
ws.Cell(row, 11).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
|
||||||
ws.Cell(row, 12).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
|
||||||
ws.Cell(row, 13).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
|
||||||
ws.Cell(row, 14).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
|
||||||
ws.Cell(row, 15).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
|
||||||
ws.Cell(row, 16).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
|
||||||
ws.Cell(row, 17).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
|
||||||
ws.Cell(row, 18).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
|
||||||
ws.Cell(row, 19).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
|
||||||
ws.Range(ws.Cell(row, 1), ws.Cell(row, 19)).Style.Font.FontName =
|
|
||||||
"TH Sarabun New";
|
|
||||||
ws.Range(ws.Cell(row, 1), ws.Cell(row, 19)).Style.Font.FontSize = 11;
|
|
||||||
ws.Range(ws.Cell(row, 1), ws.Cell(row, 19)).Style.Alignment.WrapText = true;
|
|
||||||
ws.Range(ws.Cell(row, 1), ws.Cell(row, 19)).Style.Alignment.Vertical =
|
|
||||||
XLAlignmentVerticalValues.Center;
|
|
||||||
ws.Range(ws.Cell(row, 1), ws.Cell(row, 19)).Style.Fill.BackgroundColor=XLColor.GrannySmithApple;
|
|
||||||
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, 6).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
|
||||||
ws.Cell(row, 7).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left;
|
|
||||||
ws.Cell(row, 8).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
|
||||||
ws.Cell(row, 9).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
|
||||||
ws.Cell(row, 10).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
|
||||||
ws.Cell(row, 11).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
|
|
||||||
ws.Cell(row, 12).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
|
|
||||||
ws.Cell(row, 13).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
|
|
||||||
ws.Cell(row, 14).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
|
|
||||||
ws.Cell(row, 15).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
|
|
||||||
ws.Cell(row, 16).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
|
|
||||||
ws.Cell(row, 17).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
|
||||||
ws.Cell(row, 18).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
|
||||||
ws.Cell(row, 19).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left;
|
|
||||||
ws.Range(ws.Cell(row, 11), ws.Cell(row, 16)).Style.NumberFormat.SetFormat("#,#");
|
|
||||||
row++;
|
|
||||||
|
|
||||||
|
foreach (var buildings1 in buildings.data)
|
||||||
|
{
|
||||||
|
|
||||||
|
if (buildings1.color == 2)
|
||||||
|
{
|
||||||
|
ws.Cell(row, 1).Value = null;
|
||||||
|
ws.Cell(row, 2).Value = buildings1.faculty_name;
|
||||||
|
ws.Cell(row, 3).Value = null;
|
||||||
|
ws.Cell(row, 4).Value = null;
|
||||||
|
ws.Cell(row, 5).Value = null;
|
||||||
|
ws.Cell(row, 6).Value = null;
|
||||||
|
ws.Cell(row, 7).Value = null;
|
||||||
|
ws.Cell(row, 8).Value = null;
|
||||||
|
ws.Cell(row, 9).Value = null;
|
||||||
|
ws.Cell(row, 10).Value = null;
|
||||||
|
ws.Cell(row, 11).Value = buildings1.budget;
|
||||||
|
ws.Cell(row, 12).Value = buildings1.price_1;
|
||||||
|
ws.Cell(row, 13).Value = buildings1.price_2;
|
||||||
|
ws.Cell(row, 14).Value = buildings1.price_3;
|
||||||
|
ws.Cell(row, 15).Value = buildings1.price_4;
|
||||||
|
ws.Cell(row, 16).Value = buildings1.price_5;
|
||||||
|
ws.Cell(row, 17).Value = null;
|
||||||
|
ws.Cell(row, 18).Value = null;
|
||||||
|
ws.Cell(row, 19).Value = null;
|
||||||
|
ws.Cell(row, 1).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||||
|
ws.Cell(row, 2).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||||
|
ws.Cell(row, 3).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||||
|
ws.Cell(row, 4).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||||
|
ws.Cell(row, 5).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||||
|
ws.Cell(row, 6).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||||
|
ws.Cell(row, 7).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||||
|
ws.Cell(row, 8).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||||
|
ws.Cell(row, 9).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||||
|
ws.Cell(row, 10).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||||
|
ws.Cell(row, 11).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||||
|
ws.Cell(row, 12).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||||
|
ws.Cell(row, 13).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||||
|
ws.Cell(row, 14).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||||
|
ws.Cell(row, 15).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||||
|
ws.Cell(row, 16).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||||
|
ws.Cell(row, 17).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||||
|
ws.Cell(row, 18).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||||
|
ws.Cell(row, 19).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||||
|
ws.Range(ws.Cell(row, 1), ws.Cell(row, 19)).Style.Font.FontName =
|
||||||
|
"TH Sarabun New";
|
||||||
|
ws.Range(ws.Cell(row, 1), ws.Cell(row, 19)).Style.Font.FontSize = 11;
|
||||||
|
ws.Range(ws.Cell(row, 1), ws.Cell(row, 19)).Style.Alignment.WrapText = true;
|
||||||
|
ws.Range(ws.Cell(row, 1), ws.Cell(row, 19)).Style.Alignment.Vertical =
|
||||||
|
XLAlignmentVerticalValues.Center;
|
||||||
|
ws.Range(ws.Cell(row, 1), ws.Cell(row, 19)).Style.Fill.BackgroundColor =
|
||||||
|
XLColor.LavenderPurple;
|
||||||
|
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, 6).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||||||
|
ws.Cell(row, 7).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left;
|
||||||
|
ws.Cell(row, 8).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||||||
|
ws.Cell(row, 9).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||||||
|
ws.Cell(row, 10).Style.Alignment.Horizontal =
|
||||||
|
XLAlignmentHorizontalValues.Center;
|
||||||
|
ws.Cell(row, 11).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
|
||||||
|
ws.Cell(row, 12).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
|
||||||
|
ws.Cell(row, 13).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
|
||||||
|
ws.Cell(row, 14).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
|
||||||
|
ws.Cell(row, 15).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
|
||||||
|
ws.Cell(row, 16).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
|
||||||
|
ws.Cell(row, 17).Style.Alignment.Horizontal =
|
||||||
|
XLAlignmentHorizontalValues.Center;
|
||||||
|
ws.Cell(row, 18).Style.Alignment.Horizontal =
|
||||||
|
XLAlignmentHorizontalValues.Center;
|
||||||
|
ws.Cell(row, 19).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left;
|
||||||
|
ws.Range(ws.Cell(row, 11), ws.Cell(row, 16)).Style.NumberFormat
|
||||||
|
.SetFormat("#,#");
|
||||||
|
row++;
|
||||||
}
|
}
|
||||||
foreach (var building in buildings.data)
|
|
||||||
|
foreach (var buildings2 in buildings1.data)
|
||||||
|
{
|
||||||
|
|
||||||
|
if (buildings2.color == 3)
|
||||||
|
{
|
||||||
|
ws.Cell(row, 1).Value = null;
|
||||||
|
ws.Cell(row, 2).Value = buildings2.list;
|
||||||
|
ws.Cell(row, 3).Value = null;
|
||||||
|
ws.Cell(row, 4).Value = null;
|
||||||
|
ws.Cell(row, 5).Value = null;
|
||||||
|
ws.Cell(row, 6).Value = null;
|
||||||
|
ws.Cell(row, 7).Value = null;
|
||||||
|
ws.Cell(row, 8).Value = null;
|
||||||
|
ws.Cell(row, 9).Value = null;
|
||||||
|
ws.Cell(row, 10).Value = null;
|
||||||
|
ws.Cell(row, 11).Value = buildings2.budget;
|
||||||
|
ws.Cell(row, 12).Value = buildings2.price_1;
|
||||||
|
ws.Cell(row, 13).Value = buildings2.price_2;
|
||||||
|
ws.Cell(row, 14).Value = buildings2.price_3;
|
||||||
|
ws.Cell(row, 15).Value = buildings2.price_4;
|
||||||
|
ws.Cell(row, 16).Value = buildings2.price_5;
|
||||||
|
ws.Cell(row, 17).Value = null;
|
||||||
|
ws.Cell(row, 18).Value = null;
|
||||||
|
ws.Cell(row, 19).Value = null;
|
||||||
|
ws.Cell(row, 1).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||||
|
ws.Cell(row, 2).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||||
|
ws.Cell(row, 3).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||||
|
ws.Cell(row, 4).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||||
|
ws.Cell(row, 5).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||||
|
ws.Cell(row, 6).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||||
|
ws.Cell(row, 7).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||||
|
ws.Cell(row, 8).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||||
|
ws.Cell(row, 9).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||||
|
ws.Cell(row, 10).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||||
|
ws.Cell(row, 11).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||||
|
ws.Cell(row, 12).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||||
|
ws.Cell(row, 13).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||||
|
ws.Cell(row, 14).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||||
|
ws.Cell(row, 15).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||||
|
ws.Cell(row, 16).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||||
|
ws.Cell(row, 17).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||||
|
ws.Cell(row, 18).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||||
|
ws.Cell(row, 19).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||||
|
ws.Range(ws.Cell(row, 1), ws.Cell(row, 19)).Style.Font.FontName =
|
||||||
|
"TH Sarabun New";
|
||||||
|
ws.Range(ws.Cell(row, 1), ws.Cell(row, 19)).Style.Font.FontSize = 11;
|
||||||
|
ws.Range(ws.Cell(row, 1), ws.Cell(row, 19)).Style.Alignment.WrapText = true;
|
||||||
|
ws.Range(ws.Cell(row, 1), ws.Cell(row, 19)).Style.Alignment.Vertical =
|
||||||
|
XLAlignmentVerticalValues.Center;
|
||||||
|
ws.Range(ws.Cell(row, 1), ws.Cell(row, 19)).Style.Fill.BackgroundColor =
|
||||||
|
XLColor.GrannySmithApple;
|
||||||
|
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, 6).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||||||
|
ws.Cell(row, 7).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left;
|
||||||
|
ws.Cell(row, 8).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||||||
|
ws.Cell(row, 9).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||||||
|
ws.Cell(row, 10).Style.Alignment.Horizontal =
|
||||||
|
XLAlignmentHorizontalValues.Center;
|
||||||
|
ws.Cell(row, 11).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
|
||||||
|
ws.Cell(row, 12).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
|
||||||
|
ws.Cell(row, 13).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
|
||||||
|
ws.Cell(row, 14).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
|
||||||
|
ws.Cell(row, 15).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
|
||||||
|
ws.Cell(row, 16).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
|
||||||
|
ws.Cell(row, 17).Style.Alignment.Horizontal =
|
||||||
|
XLAlignmentHorizontalValues.Center;
|
||||||
|
ws.Cell(row, 18).Style.Alignment.Horizontal =
|
||||||
|
XLAlignmentHorizontalValues.Center;
|
||||||
|
ws.Cell(row, 19).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left;
|
||||||
|
ws.Range(ws.Cell(row, 11), ws.Cell(row, 16)).Style.NumberFormat
|
||||||
|
.SetFormat("#,#");
|
||||||
|
row++;
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (var building3 in buildings2.data)
|
||||||
{
|
{
|
||||||
ws.Cell(row, 1).Value = no;
|
ws.Cell(row, 1).Value = no;
|
||||||
no++;
|
no++;
|
||||||
ws.Cell(row, 2).Value = building.list;
|
ws.Cell(row, 2).Value = building3.list;
|
||||||
ws.Cell(row, 3).Value = building.total;
|
ws.Cell(row, 3).Value = building3.total;
|
||||||
ws.Cell(row, 4).Value = building.lesser;
|
ws.Cell(row, 4).Value = building3.lesser;
|
||||||
ws.Cell(row, 5).Value = building.between;
|
ws.Cell(row, 5).Value = building3.between;
|
||||||
ws.Cell(row, 6).Value = building.over;
|
ws.Cell(row, 6).Value = building3.over;
|
||||||
ws.Cell(row, 7).Value = building.problem;
|
ws.Cell(row, 7).Value = building3.problem;
|
||||||
ws.Cell(row, 8).Value = building.type_1;
|
ws.Cell(row, 8).Value = building3.type_1;
|
||||||
ws.Cell(row, 9).Value = building.type_2;
|
ws.Cell(row, 9).Value = building3.type_2;
|
||||||
ws.Cell(row, 10).Value = building.renovated;
|
ws.Cell(row, 10).Value = building3.renovated;
|
||||||
ws.Cell(row, 11).Value = building.budget;
|
ws.Cell(row, 11).Value = building3.budget;
|
||||||
ws.Cell(row, 12).Value = building.price_1;
|
ws.Cell(row, 12).Value = building3.price_1;
|
||||||
ws.Cell(row, 13).Value = building.price_2;
|
ws.Cell(row, 13).Value = building3.price_2;
|
||||||
ws.Cell(row, 14).Value = building.price_3;
|
ws.Cell(row, 14).Value = building3.price_3;
|
||||||
ws.Cell(row, 15).Value = building.price_4;
|
ws.Cell(row, 15).Value = building3.price_4;
|
||||||
ws.Cell(row, 16).Value = building.price_5;
|
ws.Cell(row, 16).Value = building3.price_5;
|
||||||
ws.Cell(row, 17).Value = building.boq;
|
ws.Cell(row, 17).Value = building3.boq;
|
||||||
ws.Cell(row, 18).Value = building.image;
|
ws.Cell(row, 18).Value = building3.image;
|
||||||
ws.Cell(row, 19).Value = building.description;
|
ws.Cell(row, 19).Value = building3.description;
|
||||||
ws.Cell(row, 1).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
ws.Cell(row, 1).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||||
ws.Cell(row, 2).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
ws.Cell(row, 2).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||||
ws.Cell(row, 3).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
ws.Cell(row, 3).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||||
@@ -1379,19 +1415,24 @@ namespace rmutr_report.Controllers
|
|||||||
ws.Cell(row, 7).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left;
|
ws.Cell(row, 7).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left;
|
||||||
ws.Cell(row, 8).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
ws.Cell(row, 8).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||||||
ws.Cell(row, 9).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
ws.Cell(row, 9).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||||||
ws.Cell(row, 10).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
ws.Cell(row, 10).Style.Alignment.Horizontal =
|
||||||
|
XLAlignmentHorizontalValues.Center;
|
||||||
ws.Cell(row, 11).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
|
ws.Cell(row, 11).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
|
||||||
ws.Cell(row, 12).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
|
ws.Cell(row, 12).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
|
||||||
ws.Cell(row, 13).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
|
ws.Cell(row, 13).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
|
||||||
ws.Cell(row, 14).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
|
ws.Cell(row, 14).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
|
||||||
ws.Cell(row, 15).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
|
ws.Cell(row, 15).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
|
||||||
ws.Cell(row, 16).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
|
ws.Cell(row, 16).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
|
||||||
ws.Cell(row, 17).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
ws.Cell(row, 17).Style.Alignment.Horizontal =
|
||||||
ws.Cell(row, 18).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
XLAlignmentHorizontalValues.Center;
|
||||||
|
ws.Cell(row, 18).Style.Alignment.Horizontal =
|
||||||
|
XLAlignmentHorizontalValues.Center;
|
||||||
ws.Cell(row, 19).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left;
|
ws.Cell(row, 19).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left;
|
||||||
ws.Range(ws.Cell(row, 11), ws.Cell(row, 16)).Style.NumberFormat.SetFormat("#,#");
|
ws.Range(ws.Cell(row, 11), ws.Cell(row, 16)).Style.NumberFormat
|
||||||
|
.SetFormat("#,#");
|
||||||
row++;
|
row++;
|
||||||
}
|
}
|
||||||
|
}}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -25,11 +25,39 @@ namespace rmutr_report.Models
|
|||||||
public decimal? price_3 { get; set; }
|
public decimal? price_3 { get; set; }
|
||||||
public decimal? price_4 { get; set; }
|
public decimal? price_4 { get; set; }
|
||||||
public decimal? price_5 { get; set; }
|
public decimal? price_5 { get; set; }
|
||||||
public List<summary_building_construction_detail> data { get; set; }
|
public List<summary_building_construction_detail1> data { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class summary_building_construction_detail
|
public class summary_building_construction_detail1
|
||||||
|
{
|
||||||
|
public int? color { get; set; }
|
||||||
|
public string faculty_name { get; set; }
|
||||||
|
public decimal? budget { get; set; }
|
||||||
|
public decimal? price_1 { get; set; }
|
||||||
|
public decimal? price_2 { get; set; }
|
||||||
|
public decimal? price_3 { get; set; }
|
||||||
|
public decimal? price_4 { get; set; }
|
||||||
|
public decimal? price_5 { get; set; }
|
||||||
|
public List<summary_building_construction_detail2> data { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class summary_building_construction_detail2
|
||||||
|
{
|
||||||
|
public int? color { get; set; }
|
||||||
|
public string list { get; set; }
|
||||||
|
public decimal? budget { get; set; }
|
||||||
|
public decimal? price_1 { get; set; }
|
||||||
|
public decimal? price_2 { get; set; }
|
||||||
|
public decimal? price_3 { get; set; }
|
||||||
|
public decimal? price_4 { get; set; }
|
||||||
|
public decimal? price_5 { get; set; }
|
||||||
|
public List<summary_building_construction_detail3> data { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class summary_building_construction_detail3
|
||||||
{
|
{
|
||||||
//public int? no { get; set; }
|
//public int? no { get; set; }
|
||||||
public string list { get; set; }
|
public string list { get; set; }
|
||||||
|
|||||||
@@ -24,14 +24,38 @@ namespace rmutr_report.Models
|
|||||||
public decimal? price_3 { get; set; }
|
public decimal? price_3 { get; set; }
|
||||||
public decimal? price_4 { get; set; }
|
public decimal? price_4 { get; set; }
|
||||||
public decimal? price_5 { get; set; }
|
public decimal? price_5 { get; set; }
|
||||||
public List<summary_of_equipment_five_year_detail> data { get; set; }
|
public List<summary_of_equipment_five_year_detail1> data { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class summary_of_equipment_five_year_detail
|
public class summary_of_equipment_five_year_detail1
|
||||||
{
|
{
|
||||||
//public int? color { get; set; }
|
public int? color { get; set; }
|
||||||
|
public string faculty_name { get; set; }
|
||||||
|
public decimal? unit_price { get; set; }
|
||||||
|
public decimal? price_1 { get; set; }
|
||||||
|
public decimal? price_2 { get; set; }
|
||||||
|
public decimal? price_3 { get; set; }
|
||||||
|
public decimal? price_4 { get; set; }
|
||||||
|
public decimal? price_5 { get; set; }
|
||||||
|
public List<summary_of_equipment_five_year_detail2> data { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class summary_of_equipment_five_year_detail2
|
||||||
|
{
|
||||||
|
public int? color { get; set; }
|
||||||
public string list { get; set; }
|
public string list { get; set; }
|
||||||
|
public decimal? unit_price { get; set; }
|
||||||
|
public decimal? price_1 { get; set; }
|
||||||
|
public decimal? price_2 { get; set; }
|
||||||
|
public decimal? price_3 { get; set; }
|
||||||
|
public decimal? price_4 { get; set; }
|
||||||
|
public decimal? price_5 { get; set; }
|
||||||
|
public List<summary_of_equipment_five_year_detail3> data { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
public class summary_of_equipment_five_year_detail3
|
||||||
|
{ public string list { get; set; }
|
||||||
public string type_1 { get; set; }
|
public string type_1 { get; set; }
|
||||||
public string type_2 { get; set; }
|
public string type_2 { get; set; }
|
||||||
public string type_3 { get; set; }
|
public string type_3 { get; set; }
|
||||||
@@ -47,4 +71,5 @@ namespace rmutr_report.Models
|
|||||||
public string company { get; set; }
|
public string company { get; set; }
|
||||||
public string description { get; set; }
|
public string description { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user