bug fixed

This commit is contained in:
kamonwan taengsuk
2023-02-19 13:08:23 +07:00
parent 60836ddc96
commit 6b10902a30
4 changed files with 135 additions and 23 deletions

View File

@@ -63,6 +63,7 @@ namespace rmutr_report.Controllers
ws.Range("G2:G3").Merge().Value = "แผนปี "+_kpi.plan_year.Substring(2, 2)+" มหาวิทยาลัย";
ws.Range("G2:G3").Style.Font.Bold = true;
ws.Range("G2:G3").Style.Border.RightBorder = XLBorderStyleValues.Thin;
ws.Range("G2:G3").Style.Alignment.WrapText = true;
// ws.Range("H2:W2").Merge().Value = "แผนปี "+_kpi.plan_year.Substring(2, 2)+" หน่วยงาน";
// ws.Range("H2:W2").Style.Font.Bold = true;
// ws.Range("H2:H3").Style.Border.RightBorder = XLBorderStyleValues.Thin;
@@ -328,7 +329,7 @@ namespace rmutr_report.Controllers
ws.Cell("A1").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
ws.Cell("A1").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; }
if (a==10)
if (a==11)
{
ws.Range("H2:R2").Merge().Value = "แผนปี "+_kpi.plan_year.Substring(2, 2)+" หน่วยงาน";
ws.Cell("H2").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
@@ -343,7 +344,7 @@ namespace rmutr_report.Controllers
ws.Cell("A1").Style.Font.SetBold().Font.FontSize = 16;
ws.Cell("A1").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
ws.Cell("A1").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; }
if (a==11)
if (a==12)
{
ws.Range("H2:S2").Merge().Value = "แผนปี "+_kpi.plan_year.Substring(2, 2)+" หน่วยงาน";
ws.Cell("H2").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
@@ -358,7 +359,7 @@ namespace rmutr_report.Controllers
ws.Cell("A1").Style.Font.SetBold().Font.FontSize = 16;
ws.Cell("A1").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
ws.Cell("A1").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; }
if (a==12)
if (a==13)
{
ws.Range("H2:T2").Merge().Value = "แผนปี "+_kpi.plan_year.Substring(2, 2)+" หน่วยงาน";
ws.Cell("H2").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
@@ -373,7 +374,7 @@ namespace rmutr_report.Controllers
ws.Cell("A1").Style.Font.SetBold().Font.FontSize = 16;
ws.Cell("A1").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
ws.Cell("A1").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; }
if (a==13)
if (a==14)
{
ws.Range("H2:U2").Merge().Value = "แผนปี "+_kpi.plan_year.Substring(2, 2)+" หน่วยงาน";
ws.Cell("H2").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
@@ -388,7 +389,7 @@ namespace rmutr_report.Controllers
ws.Cell("A1").Style.Font.SetBold().Font.FontSize = 16;
ws.Cell("A1").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
ws.Cell("A1").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; }
if (a==14)
if (a==15)
{
ws.Range("H2:V2").Merge().Value = "แผนปี "+_kpi.plan_year.Substring(2, 2)+" หน่วยงาน";
ws.Cell("H2").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
@@ -403,7 +404,7 @@ namespace rmutr_report.Controllers
ws.Cell("A1").Style.Font.SetBold().Font.FontSize = 16;
ws.Cell("A1").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
ws.Cell("A1").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; }
if (a==15)
if (a==16)
{
ws.Range("H2:W2").Merge().Value = "แผนปี "+_kpi.plan_year.Substring(2, 2)+" หน่วยงาน";
ws.Cell("H2").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
@@ -418,8 +419,75 @@ namespace rmutr_report.Controllers
ws.Cell("A1").Style.Font.SetBold().Font.FontSize = 16;
ws.Cell("A1").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
ws.Cell("A1").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; }
if (a==17)
{
ws.Range("H2:X2").Merge().Value = "แผนปี "+_kpi.plan_year.Substring(2, 2)+" หน่วยงาน";
ws.Cell("H2").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
ws.Cell("H2").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
ws.Cell("H2").Style.Font.FontName = "TH Sarabun New";
ws.Cell("H2").Style.Font.SetBold().Font.FontSize = 16;
ws.Cell("X2").Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
ws.Cell("X2").Style.Border.RightBorder = XLBorderStyleValues.Thin;
ws.Cell("X4").Style.Border.RightBorder = XLBorderStyleValues.Thin;
ws.Range("H2:X2").Style.Border.TopBorder = XLBorderStyleValues.Thin;
ws.Range("A1:X1").Merge().Value = "แจ้งรายละเอียดตัวชี้วัดแผนกลยุทธ์ทางการเงิน พ.ศ. " + _kpi.year_range+" มหาวิทยาลัยเทคโนโลยีราชมงคลรัตนโกสินทร์ ประจำปีงบประมาณ พ.ศ. "+_kpi.budget_year;
ws.Cell("A1").Style.Font.SetBold().Font.FontSize = 16;
ws.Cell("A1").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
ws.Cell("A1").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
}
if (a==18)
{
ws.Range("H2:Y2").Merge().Value = "แผนปี "+_kpi.plan_year.Substring(2, 2)+" หน่วยงาน";
ws.Cell("H2").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
ws.Cell("H2").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
ws.Cell("H2").Style.Font.FontName = "TH Sarabun New";
ws.Cell("H2").Style.Font.SetBold().Font.FontSize = 16;
ws.Cell("Y2").Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
ws.Cell("Y2").Style.Border.RightBorder = XLBorderStyleValues.Thin;
ws.Cell("Y4").Style.Border.RightBorder = XLBorderStyleValues.Thin;
ws.Range("H2:Y2").Style.Border.TopBorder = XLBorderStyleValues.Thin;
ws.Range("A1:Y1").Merge().Value = "แจ้งรายละเอียดตัวชี้วัดแผนกลยุทธ์ทางการเงิน พ.ศ. " + _kpi.year_range+" มหาวิทยาลัยเทคโนโลยีราชมงคลรัตนโกสินทร์ ประจำปีงบประมาณ พ.ศ. "+_kpi.budget_year;
ws.Cell("A1").Style.Font.SetBold().Font.FontSize = 16;
ws.Cell("A1").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
ws.Cell("A1").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
}
if (a==19)
{
ws.Range("H2:Z2").Merge().Value = "แผนปี "+_kpi.plan_year.Substring(2, 2)+" หน่วยงาน";
ws.Cell("H2").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
ws.Cell("H2").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
ws.Cell("H2").Style.Font.FontName = "TH Sarabun New";
ws.Cell("H2").Style.Font.SetBold().Font.FontSize = 16;
ws.Cell("Z2").Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
ws.Cell("Z2").Style.Border.RightBorder = XLBorderStyleValues.Thin;
ws.Cell("Z4").Style.Border.RightBorder = XLBorderStyleValues.Thin;
ws.Range("H2:Z2").Style.Border.TopBorder = XLBorderStyleValues.Thin;
ws.Range("A1:Z1").Merge().Value = "แจ้งรายละเอียดตัวชี้วัดแผนกลยุทธ์ทางการเงิน พ.ศ. " + _kpi.year_range+" มหาวิทยาลัยเทคโนโลยีราชมงคลรัตนโกสินทร์ ประจำปีงบประมาณ พ.ศ. "+_kpi.budget_year;
ws.Cell("A1").Style.Font.SetBold().Font.FontSize = 16;
ws.Cell("A1").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
ws.Cell("A1").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
}
if (a==20)
{
ws.Range("H2:AA2").Merge().Value = "แผนปี "+_kpi.plan_year.Substring(2, 2)+" หน่วยงาน";
ws.Cell("H2").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
ws.Cell("H2").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
ws.Cell("H2").Style.Font.FontName = "TH Sarabun New";
ws.Cell("H2").Style.Font.SetBold().Font.FontSize = 16;
ws.Cell("AA2").Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
ws.Cell("AA2").Style.Border.RightBorder = XLBorderStyleValues.Thin;
ws.Cell("AA4").Style.Border.RightBorder = XLBorderStyleValues.Thin;
ws.Range("H2:AA2").Style.Border.TopBorder = XLBorderStyleValues.Thin;
ws.Range("A1:AA1").Merge().Value = "แจ้งรายละเอียดตัวชี้วัดแผนกลยุทธ์ทางการเงิน พ.ศ. " + _kpi.year_range+" มหาวิทยาลัยเทคโนโลยีราชมงคลรัตนโกสินทร์ ประจำปีงบประมาณ พ.ศ. "+_kpi.budget_year;
ws.Cell("A1").Style.Font.SetBold().Font.FontSize = 16;
ws.Cell("A1").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
ws.Cell("A1").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
}
}
foreach (var header in _kpi.header_data)
{
var a = _kpi.agencys.Count;
@@ -609,9 +677,53 @@ namespace rmutr_report.Controllers
ws.Range(ws.Cell(row, 1), ws.Cell(row, 22)).Merge().Style.Fill.BackgroundColor =
XLColor.Bisque;
}
if (a==17)
{
string kpiname = "ประเด็นยุทธ์ศาสตร์ที่ " + no + " " + header.strategic_issues;
no++;
ws.Cell(row, 1).SetValue(kpiname).Style.Font.Bold = true;
ws.Cell(row, 1).Style.Border.OutsideBorder =
XLBorderStyleValues.None;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 23)).Merge().Style.Fill.BackgroundColor =
XLColor.Bisque;
}
if (a==18)
{
string kpiname = "ประเด็นยุทธ์ศาสตร์ที่ " + no + " " + header.strategic_issues;
no++;
ws.Cell(row, 1).SetValue(kpiname).Style.Font.Bold = true;
ws.Cell(row, 1).Style.Border.OutsideBorder =
XLBorderStyleValues.None;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 24)).Merge().Style.Fill.BackgroundColor =
XLColor.Bisque;
}
if (a==19)
{
string kpiname = "ประเด็นยุทธ์ศาสตร์ที่ " + no + " " + header.strategic_issues;
no++;
ws.Cell(row, 1).SetValue(kpiname).Style.Font.Bold = true;
ws.Cell(row, 1).Style.Border.OutsideBorder =
XLBorderStyleValues.None;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 25)).Merge().Style.Fill.BackgroundColor =
XLColor.Bisque;
}
if (a==20)
{
string kpiname = "ประเด็นยุทธ์ศาสตร์ที่ " + no + " " + header.strategic_issues;
no++;
ws.Cell(row, 1).SetValue(kpiname).Style.Font.Bold = true;
ws.Cell(row, 1).Style.Border.OutsideBorder =
XLBorderStyleValues.None;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 26)).Merge().Style.Fill.BackgroundColor =
XLColor.Bisque;
}
ws.Cell(row, 1).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
ws.Cell(row, 1).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
ws.Cell(row,23).Style.Border.RightBorder = XLBorderStyleValues.Thin;
ws.Cell(row,26).Style.Border.RightBorder = XLBorderStyleValues.Thin;
row++;
foreach (var data1 in header.data)
{
@@ -633,9 +745,9 @@ namespace rmutr_report.Controllers
ws.Cell(row,col2).Style.Font.FontSize = 16;
col2++;
}
ws.Range(ws.Cell(row, 1),ws.Cell(row,23)).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
ws.Range(ws.Cell(row, 1),ws.Cell(row,23)).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
ws.Range(ws.Cell(row,8),ws.Cell(row,23)).Style.Alignment.SetTextRotation(90);
ws.Range(ws.Cell(row, 1),ws.Cell(row,26)).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
ws.Range(ws.Cell(row, 1),ws.Cell(row,26)).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
ws.Range(ws.Cell(row,8),ws.Cell(row,26)).Style.Alignment.SetTextRotation(90);
ws.Cell(row, 1).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
ws.Cell(row, 1).Style.Border.LeftBorder = XLBorderStyleValues.Thin;
@@ -662,10 +774,10 @@ namespace rmutr_report.Controllers
// ws.Cell(row, 21).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
// ws.Cell(row, 22).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
// ws.Cell(row, 23).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
ws.Range(ws.Cell(row, 1),ws.Cell(row,23)).Style.Alignment.WrapText = true;
ws.Range(ws.Cell(row, 1),ws.Cell(row,26)).Style.Alignment.WrapText = true;
ws.Range(ws.Cell(row, 1),ws.Cell(row,23)).Style.Font.FontName = "TH Sarabun New";
ws.Range(ws.Cell(row, 1),ws.Cell(row,23)).Style.Font.FontSize = 16;
ws.Range(ws.Cell(row, 1),ws.Cell(row,26)).Style.Font.FontName = "TH Sarabun New";
ws.Range(ws.Cell(row, 1),ws.Cell(row,26)).Style.Font.FontSize = 16;
row++;
rowno++;
col++;

View File

@@ -326,7 +326,7 @@ namespace rmutr_report.Controllers
ws.Range("A1:Q1").Style.Fill.BackgroundColor = XLColor.Yellow;
}
if (a==10)
if (a==11)
{
ws.Range("H2:R2").Merge().Value = "แผนปี "+_kpi.plan_year.Substring(2, 2)+" หน่วยงาน";
ws.Cell("H2").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
@@ -340,7 +340,7 @@ namespace rmutr_report.Controllers
ws.Cell("A1").Style.Font.SetBold().Font.FontSize = 16;
ws.Range("A1:R1").Style.Fill.BackgroundColor = XLColor.Yellow;
}
if (a==11)
if (a==12)
{
ws.Range("H2:S2").Merge().Value = "แผนปี "+_kpi.plan_year.Substring(2, 2)+" หน่วยงาน";
ws.Cell("H2").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
@@ -354,7 +354,7 @@ namespace rmutr_report.Controllers
ws.Cell("A1").Style.Font.SetBold().Font.FontSize = 16;
ws.Range("A1:S1").Style.Fill.BackgroundColor = XLColor.Yellow;
}
if (a==12)
if (a==13)
{
ws.Range("H2:T2").Merge().Value = "แผนปี "+_kpi.plan_year.Substring(2, 2)+" หน่วยงาน";
ws.Cell("H2").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
@@ -368,7 +368,7 @@ namespace rmutr_report.Controllers
ws.Cell("A1").Style.Font.SetBold().Font.FontSize = 16;
ws.Range("A1:T1").Style.Fill.BackgroundColor = XLColor.Yellow;
}
if (a==13)
if (a==14)
{
ws.Range("H2:U2").Merge().Value = "แผนปี "+_kpi.plan_year.Substring(2, 2)+" หน่วยงาน";
ws.Cell("H2").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
@@ -382,7 +382,7 @@ namespace rmutr_report.Controllers
ws.Cell("A1").Style.Font.SetBold().Font.FontSize = 16;
ws.Range("A1:U1").Style.Fill.BackgroundColor = XLColor.Yellow;
}
if (a==14)
if (a==15)
{
ws.Range("H2:V2").Merge().Value = "แผนปี "+_kpi.plan_year.Substring(2, 2)+" หน่วยงาน";
ws.Cell("H2").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
@@ -396,7 +396,7 @@ namespace rmutr_report.Controllers
ws.Cell("A1").Style.Font.SetBold().Font.FontSize = 16;
ws.Range("A1:V1").Style.Fill.BackgroundColor = XLColor.Yellow;
}
if (a==15)
if (a==16)
{
ws.Range("H2:W2").Merge().Value = "แผนปี "+_kpi.plan_year.Substring(2, 2)+" หน่วยงาน";
ws.Cell("H2").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;

View File

@@ -145,7 +145,7 @@ namespace rmutr_report.Controllers
ws.Cell(row, 4).Value = data1.director;
ws.Cell(row, 5).Value = data1.responsible_person;
ws.Cell(row, 6).Value = data1.compiler_reporter;
ws.Cell(row, 7).Value = data1.value;
ws.Cell(row, 7).Value = data1.plan_value;
ws.Cell(row, 8).Value = data1.result;
ws.Cell(row, 9).Value = data1.achieve;
ws.Cell(row, 10).Value = data1.note;

View File

@@ -22,7 +22,7 @@ namespace rmutr_report.Models
public string director { get; set; }
public string responsible_person { get; set; }
public string compiler_reporter { get; set; }
public decimal? value { get; set; }
public decimal? plan_value { get; set; }
public decimal? result { get; set; }
public string achieve { get; set; }
public string note { get; set; }