bug fixed
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
kamonwan taengsuk
2023-12-13 14:30:49 +07:00
parent bb28a07de1
commit 5942f73550
15 changed files with 44 additions and 14 deletions

View File

@@ -1,6 +1,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq;
using ClosedXML.Excel; using ClosedXML.Excel;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using rmutr_report.Models; using rmutr_report.Models;
@@ -35,7 +36,7 @@ namespace rmutr_report.Controllers
ws.Cell("A1").Style.Font.FontSize = 16; ws.Cell("A1").Style.Font.FontSize = 16;
ws.Range("A1:J1").Style.Font.Bold = true; ws.Range("A1:J1").Style.Font.Bold = true;
ws.Range("A2:J2").Merge().Value = ws.Range("A2:J2").Merge().Value =
"ผลผลิต " + _study_material.product + " คณะ " + _study_material.faculty; "ผลผลิต " + _study_material.product +" " + _study_material.faculty;
ws.Range("A2:J2").Style.Alignment.WrapText = true; ws.Range("A2:J2").Style.Alignment.WrapText = true;
ws.Range("A2:J2").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; ws.Range("A2:J2").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
ws.Range("A2:J2").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; ws.Range("A2:J2").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
@@ -143,11 +144,13 @@ namespace rmutr_report.Controllers
var row1 = ws.Row(3); var row1 = ws.Row(3);
row1.Height = 20; row1.Height = 20;
int row = 6; int row = 6;
if (_study_material != null) if (_study_material != null)
{ {
foreach (var data in _study_material.data1) foreach (var data in _study_material.data1)
{ {
// ws.Cell(row, 1).Value = "ภาคการศึกษา " + data.academic_semester + "/" + data.academic_year; // ws.Cell(row, 1).Value = "ภาคการศึกษา " + data.academic_semester + "/" + data.academic_year;
// ws.Range(ws.Cell(row, 1), ws.Cell(row, 10)).Style.Font.FontName = // ws.Range(ws.Cell(row, 1), ws.Cell(row, 10)).Style.Font.FontName =
// "TH SarabunPSK"; // "TH SarabunPSK";
@@ -180,6 +183,8 @@ namespace rmutr_report.Controllers
// ws.Cell(row, 1).Value = "ภาคการศึกษา " + data.academic_semester + "/" + data.academic_year; // ws.Cell(row, 1).Value = "ภาคการศึกษา " + data.academic_semester + "/" + data.academic_year;
ws.Cell(row, 2).Value = ws.Cell(row, 2).Value =
"ชั้นปีที่ " + data2.year_class + " (รหัส " + data.academic_year + ")"; "ชั้นปีที่ " + data2.year_class + " (รหัส " + data.academic_year + ")";
ws.Cell(row, 9).Value = data2.total_cost_science;
ws.Cell(row, 10).Value = data2.total_cost_social;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 10)).Style.Font.FontName = ws.Range(ws.Cell(row, 1), ws.Cell(row, 10)).Style.Font.FontName =
"TH SarabunPSK"; "TH SarabunPSK";
ws.Range(ws.Cell(row, 1), ws.Cell(row, 10)).Style.Font.FontSize = 16; ws.Range(ws.Cell(row, 1), ws.Cell(row, 10)).Style.Font.FontSize = 16;
@@ -208,7 +213,7 @@ namespace rmutr_report.Controllers
row++; row++;
foreach (var data3 in data2.data3) foreach (var data3 in data2.data3)
{ {
//_study_material.text = " - สาขา ";
if (data3.academic_semester == "รวม" || if (data3.academic_semester == "รวม" ||
data3.academic_semester == "รวม 1 ปีภาคการศึกษา") data3.academic_semester == "รวม 1 ปีภาคการศึกษา")
{ {
@@ -291,12 +296,12 @@ namespace rmutr_report.Controllers
ws.Range(ws.Cell(row, 3), ws.Cell(row, 10)).Style.NumberFormat.SetFormat("#,#"); ws.Range(ws.Cell(row, 3), ws.Cell(row, 10)).Style.NumberFormat.SetFormat("#,#");
//row++; //row++;
} }
row++; row++;
} }
} }
// if (data.academic_semester != "รวม") // if (data.academic_semester != "รวม")
// { // {
// ws.Cell(row, 1).Value = data.academic_semester; // ws.Cell(row, 1).Value = data.academic_semester;
@@ -378,6 +383,31 @@ namespace rmutr_report.Controllers
// row++; // row++;
// } // }
} }
if (_study_material.total_cost_science !=null &&_study_material.total_cost_social !=null)
{
ws.Range(ws.Cell(row, 1), ws.Cell(row, 8)).Merge().Value = "รวมทั้งหมด";
ws.Cell(row, 9).Value = _study_material.total_cost_science;
ws.Cell(row, 10).Value = _study_material.total_cost_social;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 10)).Style.Font.FontName =
"TH SarabunPSK";
ws.Range(ws.Cell(row, 1), ws.Cell(row, 10)).Style.Font.FontSize = 16;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 10)).Style.Alignment.WrapText = true;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 10)).Style.Alignment.Vertical =
XLAlignmentVerticalValues.Center;
ws.Range(ws.Cell(row, 1), 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.Range(ws.Cell(row, 1), ws.Cell(row, 10)).Style.Font.Bold = true;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 10)).Style.Border.OutsideBorder =
XLBorderStyleValues.Thin;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 10)).Style.Border.RightBorder =
XLBorderStyleValues.Thin;
ws.Range(ws.Cell(row, 9), ws.Cell(row, 10)).SetDataType(XLDataType.Number);
ws.Range(ws.Cell(row, 9), ws.Cell(row, 10)).Style.NumberFormat.SetFormat("#,#");
}
} }
using (var stream = new MemoryStream()) using (var stream = new MemoryStream())

View File

@@ -8,7 +8,8 @@ namespace rmutr_report.Models
public string product { get; set; } public string product { get; set; }
public string faculty { get; set; } public string faculty { get; set; }
public List<study_material_detail1> data1 { get; set; } public List<study_material_detail1> data1 { get; set; }
//public string text { get; set; } public decimal? total_cost_science { get; set; }
public decimal? total_cost_social { get; set; }
} }
@@ -25,7 +26,8 @@ namespace rmutr_report.Models
{ {
public string year_class { get; set; } public string year_class { get; set; }
public string code { get; set; } public string code { get; set; }
public decimal? total_cost_science { get; set; }
public decimal? total_cost_social { get; set; }
public List<study_material_detail3> data3 { get; set; } public List<study_material_detail3> data3 { get; set; }
} }
@@ -33,8 +35,6 @@ namespace rmutr_report.Models
{ {
public string academic_semester { get; set; } public string academic_semester { get; set; }
public string student { get; set; } public string student { get; set; }
// public string code { get; set; }
// public string major { get; set; }
public decimal? salaya { get; set; } public decimal? salaya { get; set; }
public decimal? bophitphimuk { get; set; } public decimal? bophitphimuk { get; set; }
public decimal? pohchang { get; set; } public decimal? pohchang { get; set; }

Binary file not shown.

Binary file not shown.

View File

@@ -14,7 +14,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("rmutr_report")] [assembly: System.Reflection.AssemblyCompanyAttribute("rmutr_report")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")] [assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+bb28a07de16511483ded679e4bc48870a9fc097f")]
[assembly: System.Reflection.AssemblyProductAttribute("rmutr_report")] [assembly: System.Reflection.AssemblyProductAttribute("rmutr_report")]
[assembly: System.Reflection.AssemblyTitleAttribute("rmutr_report")] [assembly: System.Reflection.AssemblyTitleAttribute("rmutr_report")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]

View File

@@ -1 +1 @@
f5dfedcaccda50e61bd739707e09ac1f8f1f155f84f01a86842a0ff8ce71abef 8f5779e7467558ec5cd2c9bc43fb2ffc448a0a50afbcdf6ca1295bb1880e38c2

View File

@@ -1 +1 @@
e70085a502f543e6f865dcae5f1f26615f0a238b62a14648a1d38a607a23489d cb1b1e2688c6fd94813d4e16c2a00268702cbaa5fa86e9bffd6abee377f2b6a2

Binary file not shown.

Binary file not shown.

View File

@@ -14,7 +14,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("rmutr_report")] [assembly: System.Reflection.AssemblyCompanyAttribute("rmutr_report")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+ca12ecf690165da4200e0b4f724709e6a4358ec2")] [assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")]
[assembly: System.Reflection.AssemblyProductAttribute("rmutr_report")] [assembly: System.Reflection.AssemblyProductAttribute("rmutr_report")]
[assembly: System.Reflection.AssemblyTitleAttribute("rmutr_report")] [assembly: System.Reflection.AssemblyTitleAttribute("rmutr_report")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]

View File

@@ -1 +1 @@
5bcb0645a46d5b2ae84fd794dd3c603837c4839ee4e2cd7c21a7c994a5058a2d f5dfedcaccda50e61bd739707e09ac1f8f1f155f84f01a86842a0ff8ce71abef

View File

@@ -1 +1 @@
17019436011989991 17024426939418254