1659 lines
104 KiB
C#
1659 lines
104 KiB
C#
using System;
|
||
using System.Collections.Generic;
|
||
using System.Globalization;
|
||
using System.IO;
|
||
using System.Linq;
|
||
using ClosedXML.Excel;
|
||
using FastReport;
|
||
using FastReport.Export.Csv;
|
||
using FastReport.Export.Mht;
|
||
using FastReport.Export.OoXML;
|
||
using FastReport.Export.Pdf;
|
||
using Microsoft.AspNetCore.Mvc;
|
||
using rmutr_report.Models;
|
||
using rmutr_report.Models.Hr;
|
||
using rmutr_report.Models.Personnel;
|
||
using Swashbuckle.AspNetCore.Annotations;
|
||
|
||
namespace rmutr_report.Controllers
|
||
{
|
||
[SwaggerTag("สำหรับรายงาน HR")]
|
||
public class PersonnelController : Controller
|
||
{
|
||
readonly Setting _setting;
|
||
|
||
public PersonnelController(Setting setting)
|
||
{
|
||
this._setting = setting;
|
||
}
|
||
|
||
[HttpPost, Route("reports/personnel_summary/{type}")]
|
||
[ApiExplorerSettings(GroupName = "reports")]
|
||
public IActionResult GetHrReport([FromRoute] string type, [FromBody] personnel_summary personnel_summarys)
|
||
{
|
||
foreach (var v in personnel_summarys.personnel_types)
|
||
{
|
||
if (v.count != null)
|
||
{
|
||
var total = personnel_summarys.personnel_types.Select(r => r.count).Sum(t => t.Value);
|
||
personnel_summarys.total_pertype = total;
|
||
}
|
||
else
|
||
{
|
||
return null;
|
||
}
|
||
}
|
||
|
||
var personnel_summaryss = new List<personnel_summary>() { personnel_summarys };
|
||
|
||
Report report = new Report();
|
||
report.Load(_setting.report_path + "personnel_summary.frx");
|
||
report.RegisterData(personnel_summaryss, "personnel_summary");
|
||
report.Prepare();
|
||
|
||
MemoryStream stream = new MemoryStream();
|
||
switch (type)
|
||
{
|
||
case "pdf":
|
||
PDFExport pdf = new PDFExport();
|
||
report.Export(pdf, stream);
|
||
stream.Seek(0, SeekOrigin.Begin);
|
||
return File(stream, "application/pdf");
|
||
|
||
case "xls":
|
||
case "xlsx":
|
||
Excel2007Export excel = new Excel2007Export();
|
||
report.Export(excel, stream);
|
||
stream.Seek(0, SeekOrigin.Begin);
|
||
return File(stream, "application/vnd.ms-excel");
|
||
break;
|
||
case "mht":
|
||
MHTExport mht = new MHTExport();
|
||
report.Export(mht, stream);
|
||
stream.Seek(0, SeekOrigin.Begin);
|
||
return File(stream, "multipart/related");
|
||
break;
|
||
case "csv":
|
||
CSVExport csv = new CSVExport();
|
||
report.Export(csv, stream);
|
||
stream.Seek(0, SeekOrigin.Begin);
|
||
return File(stream, "text/csv");
|
||
break;
|
||
}
|
||
|
||
return Ok();
|
||
}
|
||
|
||
[HttpPost, Route("reports/man_power/{type}")]
|
||
[ApiExplorerSettings(GroupName = "reports")]
|
||
public IActionResult GetManReport([FromRoute] string type, [FromBody] List<man_power> man_powers)
|
||
{
|
||
//var personnel_summaryss = new List<personnel_summary>() { personnel_summarys };
|
||
|
||
Report report = new Report();
|
||
report.Load(_setting.report_path + "man_power.frx");
|
||
report.RegisterData(man_powers, "man_power");
|
||
report.Prepare();
|
||
|
||
MemoryStream stream = new MemoryStream();
|
||
switch (type)
|
||
{
|
||
case "pdf":
|
||
PDFExport pdf = new PDFExport();
|
||
report.Export(pdf, stream);
|
||
stream.Seek(0, SeekOrigin.Begin);
|
||
return File(stream, "application/pdf");
|
||
|
||
case "xls":
|
||
case "xlsx":
|
||
Excel2007Export excel = new Excel2007Export();
|
||
report.Export(excel, stream);
|
||
stream.Seek(0, SeekOrigin.Begin);
|
||
return File(stream, "application/vnd.ms-excel");
|
||
break;
|
||
case "mht":
|
||
MHTExport mht = new MHTExport();
|
||
report.Export(mht, stream);
|
||
stream.Seek(0, SeekOrigin.Begin);
|
||
return File(stream, "multipart/related");
|
||
break;
|
||
case "csv":
|
||
CSVExport csv = new CSVExport();
|
||
report.Export(csv, stream);
|
||
stream.Seek(0, SeekOrigin.Begin);
|
||
return File(stream, "text/csv");
|
||
break;
|
||
}
|
||
|
||
return Ok();
|
||
}
|
||
|
||
[HttpPost, Route("reports/data_line_support/{type}")]
|
||
[ApiExplorerSettings(GroupName = "reports")]
|
||
public IActionResult GetDataLineReport([FromRoute] string type, [FromBody] data_line_support data_line_supports)
|
||
{
|
||
var data_line_supportss = new List<data_line_support>() { data_line_supports };
|
||
|
||
Report report = new Report();
|
||
report.Load(_setting.report_path + "data_line_support.frx");
|
||
report.RegisterData(data_line_supportss, "data_line_support");
|
||
report.Prepare();
|
||
|
||
MemoryStream stream = new MemoryStream();
|
||
switch (type)
|
||
{
|
||
case "pdf":
|
||
PDFExport pdf = new PDFExport();
|
||
report.Export(pdf, stream);
|
||
stream.Seek(0, SeekOrigin.Begin);
|
||
return File(stream, "application/pdf");
|
||
|
||
case "xls":
|
||
case "xlsx":
|
||
Excel2007Export excel = new Excel2007Export();
|
||
report.Export(excel, stream);
|
||
stream.Seek(0, SeekOrigin.Begin);
|
||
return File(stream, "application/vnd.ms-excel");
|
||
break;
|
||
case "mht":
|
||
MHTExport mht = new MHTExport();
|
||
report.Export(mht, stream);
|
||
stream.Seek(0, SeekOrigin.Begin);
|
||
return File(stream, "multipart/related");
|
||
break;
|
||
case "csv":
|
||
CSVExport csv = new CSVExport();
|
||
report.Export(csv, stream);
|
||
stream.Seek(0, SeekOrigin.Begin);
|
||
return File(stream, "text/csv");
|
||
break;
|
||
}
|
||
|
||
return Ok();
|
||
}
|
||
|
||
[HttpPost, Route("reports/data_line_academic/{type}")]
|
||
[ApiExplorerSettings(GroupName = "reports")]
|
||
public IActionResult GetDataLineAcaReport([FromRoute] string type,
|
||
[FromBody] data_line_academic data_line_academicss)
|
||
{
|
||
var _data_line_academics = new List<data_line_academic>() { data_line_academicss };
|
||
|
||
Report report = new Report();
|
||
report.Load(_setting.report_path + "data_line_academic.frx");
|
||
report.RegisterData(_data_line_academics, "data_line_academic");
|
||
report.Prepare();
|
||
|
||
MemoryStream stream = new MemoryStream();
|
||
switch (type)
|
||
{
|
||
case "pdf":
|
||
PDFExport pdf = new PDFExport();
|
||
report.Export(pdf, stream);
|
||
stream.Seek(0, SeekOrigin.Begin);
|
||
return File(stream, "application/pdf");
|
||
|
||
case "xls":
|
||
case "xlsx":
|
||
Excel2007Export excel = new Excel2007Export();
|
||
report.Export(excel, stream);
|
||
stream.Seek(0, SeekOrigin.Begin);
|
||
return File(stream, "application/vnd.ms-excel");
|
||
break;
|
||
case "mht":
|
||
MHTExport mht = new MHTExport();
|
||
report.Export(mht, stream);
|
||
stream.Seek(0, SeekOrigin.Begin);
|
||
return File(stream, "multipart/related");
|
||
break;
|
||
case "csv":
|
||
CSVExport csv = new CSVExport();
|
||
report.Export(csv, stream);
|
||
stream.Seek(0, SeekOrigin.Begin);
|
||
return File(stream, "text/csv");
|
||
break;
|
||
}
|
||
|
||
return Ok();
|
||
}
|
||
|
||
[HttpPost, Route("reports/qualifications_teacher/{type}")]
|
||
[ApiExplorerSettings(GroupName = "reports")]
|
||
public IActionResult GetQualificationsTeacherReport([FromRoute] string type,
|
||
[FromBody] qualifications_teacher qualifications_teachers)
|
||
{
|
||
var qualifications_teacherss = new List<qualifications_teacher>() { qualifications_teachers };
|
||
|
||
Report report = new Report();
|
||
report.Load(_setting.report_path + "qualifications_teacher.frx");
|
||
report.RegisterData(qualifications_teacherss, "qualifications_teacher");
|
||
report.Prepare();
|
||
|
||
MemoryStream stream = new MemoryStream();
|
||
switch (type)
|
||
{
|
||
case "pdf":
|
||
PDFExport pdf = new PDFExport();
|
||
report.Export(pdf, stream);
|
||
stream.Seek(0, SeekOrigin.Begin);
|
||
return File(stream, "application/pdf");
|
||
|
||
case "xls":
|
||
case "xlsx":
|
||
Excel2007Export excel = new Excel2007Export();
|
||
report.Export(excel, stream);
|
||
stream.Seek(0, SeekOrigin.Begin);
|
||
return File(stream, "application/vnd.ms-excel");
|
||
break;
|
||
case "mht":
|
||
MHTExport mht = new MHTExport();
|
||
report.Export(mht, stream);
|
||
stream.Seek(0, SeekOrigin.Begin);
|
||
return File(stream, "multipart/related");
|
||
break;
|
||
case "csv":
|
||
CSVExport csv = new CSVExport();
|
||
report.Export(csv, stream);
|
||
stream.Seek(0, SeekOrigin.Begin);
|
||
return File(stream, "text/csv");
|
||
break;
|
||
}
|
||
|
||
return Ok();
|
||
}
|
||
|
||
[HttpPost, Route("reports/academic_position/{type}")]
|
||
[ApiExplorerSettings(GroupName = "reports")]
|
||
public IActionResult GetAcademicPositionReport([FromRoute] string type,
|
||
[FromBody] academic_position _academic_position)
|
||
{
|
||
var academic_positions = new List<academic_position>() { _academic_position };
|
||
|
||
Report report = new Report();
|
||
report.Load(_setting.report_path + "academic_position.frx");
|
||
report.RegisterData(academic_positions, "academic_position");
|
||
report.Prepare();
|
||
|
||
MemoryStream stream = new MemoryStream();
|
||
switch (type)
|
||
{
|
||
case "pdf":
|
||
PDFExport pdf = new PDFExport();
|
||
report.Export(pdf, stream);
|
||
stream.Seek(0, SeekOrigin.Begin);
|
||
return File(stream, "application/pdf");
|
||
|
||
case "xls":
|
||
case "xlsx":
|
||
Excel2007Export excel = new Excel2007Export();
|
||
report.Export(excel, stream);
|
||
stream.Seek(0, SeekOrigin.Begin);
|
||
return File(stream, "application/vnd.ms-excel");
|
||
break;
|
||
case "mht":
|
||
MHTExport mht = new MHTExport();
|
||
report.Export(mht, stream);
|
||
stream.Seek(0, SeekOrigin.Begin);
|
||
return File(stream, "multipart/related");
|
||
break;
|
||
case "csv":
|
||
CSVExport csv = new CSVExport();
|
||
report.Export(csv, stream);
|
||
stream.Seek(0, SeekOrigin.Begin);
|
||
return File(stream, "text/csv");
|
||
break;
|
||
}
|
||
|
||
return Ok();
|
||
}
|
||
|
||
[HttpPost, Route("reports/postponement_compensation/{type}")]
|
||
[ApiExplorerSettings(GroupName = "reports")]
|
||
public IActionResult GetPostponementCompensationReport([FromRoute] string type,
|
||
[FromBody] postponement_compensation postponement_compensations)
|
||
{
|
||
if (postponement_compensations.get_promoted == true)
|
||
{
|
||
postponement_compensations.check_get_promoted = "/";
|
||
postponement_compensations.reason = "";
|
||
}
|
||
|
||
if (postponement_compensations.get_promoted == false)
|
||
{
|
||
postponement_compensations.check_get_promoted = "";
|
||
}
|
||
|
||
if (postponement_compensations.not_get_promoted == true)
|
||
{
|
||
postponement_compensations.check_not_get_promoted = "/";
|
||
}
|
||
|
||
if (postponement_compensations.not_get_promoted == false)
|
||
{
|
||
postponement_compensations.check_not_get_promoted = "";
|
||
}
|
||
|
||
string NumberText1 = postponement_compensations.data_date;
|
||
var str1 =
|
||
NumberText1.Replace('0', '๐').Replace('1', '๑').Replace('2', '๒').Replace('3', '๓')
|
||
.Replace('4', '๔').Replace('5', '๕').Replace('6', '๖').Replace('7', '๗').Replace('8', '๘')
|
||
.Replace('9', '๙');
|
||
postponement_compensations.data_date = str1;
|
||
string NumberText2 = postponement_compensations.start_date;
|
||
var str2 =
|
||
NumberText2.Replace('0', '๐').Replace('1', '๑').Replace('2', '๒').Replace('3', '๓')
|
||
.Replace('4', '๔').Replace('5', '๕').Replace('6', '๖').Replace('7', '๗').Replace('8', '๘')
|
||
.Replace('9', '๙');
|
||
postponement_compensations.start_date = str2;
|
||
string NumberText3 = postponement_compensations.end_date;
|
||
var str3 =
|
||
NumberText3.Replace('0', '๐').Replace('1', '๑').Replace('2', '๒').Replace('3', '๓')
|
||
.Replace('4', '๔').Replace('5', '๕').Replace('6', '๖').Replace('7', '๗').Replace('8', '๘')
|
||
.Replace('9', '๙');
|
||
postponement_compensations.end_date = str3;
|
||
string NumberText4 = postponement_compensations.base_calculation_date;
|
||
var str4 =
|
||
NumberText4.Replace('0', '๐').Replace('1', '๑').Replace('2', '๒').Replace('3', '๓')
|
||
.Replace('4', '๔').Replace('5', '๕').Replace('6', '๖').Replace('7', '๗').Replace('8', '๘')
|
||
.Replace('9', '๙');
|
||
postponement_compensations.base_calculation_date = str4;
|
||
string NumberText5 = postponement_compensations.director_date;
|
||
var str5 =
|
||
NumberText5.Replace('0', '๐').Replace('1', '๑').Replace('2', '๒').Replace('3', '๓')
|
||
.Replace('4', '๔').Replace('5', '๕').Replace('6', '๖').Replace('7', '๗').Replace('8', '๘')
|
||
.Replace('9', '๙');
|
||
postponement_compensations.director_date = str5;
|
||
foreach (var data in postponement_compensations.data)
|
||
{
|
||
if (data.base_calculation != null)
|
||
{
|
||
string NumberText = data.base_calculation.ToString();
|
||
var str =
|
||
NumberText.Replace('0', '๐').Replace('1', '๑').Replace('2', '๒').Replace('3', '๓')
|
||
.Replace('4', '๔').Replace('5', '๕').Replace('6', '๖').Replace('7', '๗').Replace('8', '๘')
|
||
.Replace('9', '๙');
|
||
if (str.Length == 4)
|
||
{
|
||
for (int i = 1; i <= str.Length - 1; i += 4)
|
||
{
|
||
postponement_compensations.money1 = str.Insert(i, ",");
|
||
}
|
||
}
|
||
else if (str.Length == 5)
|
||
{
|
||
for (int i = 2; i <= str.Length - 1; i += 5)
|
||
{
|
||
postponement_compensations.money1 = str.Insert(i, ",");
|
||
}
|
||
}
|
||
else
|
||
{
|
||
postponement_compensations.money1 = str;
|
||
}
|
||
}
|
||
|
||
if (data.compensation_slide != null)
|
||
{
|
||
string NumberText = data.compensation_slide.ToString();
|
||
var str =
|
||
NumberText.Replace('0', '๐').Replace('1', '๑').Replace('2', '๒').Replace('3', '๓')
|
||
.Replace('4', '๔').Replace('5', '๕').Replace('6', '๖').Replace('7', '๗').Replace('8', '๘')
|
||
.Replace('9', '๙');
|
||
if (str.Length == 4)
|
||
{
|
||
for (int i = 1; i <= str.Length - 1; i += 4)
|
||
{
|
||
postponement_compensations.money2 = str.Insert(i, ",");
|
||
}
|
||
}
|
||
else if (str.Length == 5)
|
||
{
|
||
for (int i = 2; i <= str.Length - 1; i += 5)
|
||
{
|
||
postponement_compensations.money2 = str.Insert(i, ",");
|
||
}
|
||
}
|
||
else
|
||
{
|
||
postponement_compensations.money2 = str;
|
||
}
|
||
}
|
||
|
||
if (data.compensation_receive != null)
|
||
{
|
||
string NumberText = data.compensation_receive.ToString();
|
||
var str =
|
||
NumberText.Replace('0', '๐').Replace('1', '๑').Replace('2', '๒').Replace('3', '๓')
|
||
.Replace('4', '๔').Replace('5', '๕').Replace('6', '๖').Replace('7', '๗').Replace('8', '๘')
|
||
.Replace('9', '๙');
|
||
if (str.Length == 4)
|
||
{
|
||
for (int i = 1; i <= str.Length - 1; i += 4)
|
||
{
|
||
postponement_compensations.money3 = str.Insert(i, ",");
|
||
}
|
||
}
|
||
else if (str.Length == 5)
|
||
{
|
||
for (int i = 2; i <= str.Length - 1; i += 5)
|
||
{
|
||
postponement_compensations.money3 = str.Insert(i, ",");
|
||
}
|
||
}
|
||
else
|
||
{
|
||
postponement_compensations.money3 = str;
|
||
}
|
||
}
|
||
|
||
string NumberText6 = data.percentage.ToString();
|
||
var str6 =
|
||
NumberText6.Replace('0', '๐').Replace('1', '๑').Replace('2', '๒').Replace('3', '๓')
|
||
.Replace('4', '๔').Replace('5', '๕').Replace('6', '๖').Replace('7', '๗').Replace('8', '๘')
|
||
.Replace('9', '๙');
|
||
postponement_compensations.percentage = str6;
|
||
}
|
||
|
||
var _postponement_compensations = new List<postponement_compensation>() { postponement_compensations };
|
||
|
||
Report report = new Report();
|
||
report.Load(_setting.report_path + "postponement_compensation.frx");
|
||
report.RegisterData(_postponement_compensations, "postponement_compensation");
|
||
report.Prepare();
|
||
|
||
MemoryStream stream = new MemoryStream();
|
||
switch (type)
|
||
{
|
||
case "pdf":
|
||
PDFExport pdf = new PDFExport();
|
||
report.Export(pdf, stream);
|
||
stream.Seek(0, SeekOrigin.Begin);
|
||
return File(stream, "application/pdf");
|
||
|
||
case "xls":
|
||
case "xlsx":
|
||
Excel2007Export excel = new Excel2007Export();
|
||
report.Export(excel, stream);
|
||
stream.Seek(0, SeekOrigin.Begin);
|
||
return File(stream, "application/vnd.ms-excel");
|
||
break;
|
||
case "mht":
|
||
MHTExport mht = new MHTExport();
|
||
report.Export(mht, stream);
|
||
stream.Seek(0, SeekOrigin.Begin);
|
||
return File(stream, "multipart/related");
|
||
break;
|
||
case "csv":
|
||
CSVExport csv = new CSVExport();
|
||
report.Export(csv, stream);
|
||
stream.Seek(0, SeekOrigin.Begin);
|
||
return File(stream, "text/csv");
|
||
break;
|
||
}
|
||
|
||
return Ok();
|
||
}
|
||
|
||
[HttpPost, Route("reports/personnel_salary_permanent/{type}")]
|
||
[ApiExplorerSettings(GroupName = "reports")]
|
||
public IActionResult GetPersonSalaryReport([FromRoute] string type,
|
||
[FromBody] personnel_salary_permanent_root _personnel)
|
||
{
|
||
var workbook = new XLWorkbook();
|
||
var ws = workbook.Worksheets.Add("พนักงานราชการ");
|
||
if (_personnel.year == "2567")
|
||
{
|
||
_personnel.year = "2566";
|
||
}
|
||
ws.Range("A1:T1").Merge().Value = "รายละเอียดเงินเดือนและส่วนควบของพนักงานราชการ ประจำปีงบประมาณ พ.ศ. " +
|
||
_personnel.year;
|
||
ws.Cell("A1").Style.Alignment.WrapText = true;
|
||
ws.Range("A1:T1").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||
ws.Range("A1:T1").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||
ws.Range("A1:T1").Style.Font.FontName = "TH SarabunPSK";
|
||
ws.Range("A1:T1").Style.Font.SetBold().Font.FontSize = 16;
|
||
ws.Range("A2:T2").Merge().Value = "มหาวิทยาลัยเทคโนโลยีราชมงคลรัตนโกสินทร์";
|
||
ws.Cell("A2").Style.Alignment.WrapText = true;
|
||
ws.Range("A2:T2").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||
ws.Range("A2:T2").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||
ws.Range("A2:T2").Style.Font.FontName = "TH SarabunPSK";
|
||
ws.Range("A2:T2").Style.Font.SetBold().Font.FontSize = 16;
|
||
ws.Range("A3:T3").Merge().Value = "หน่วย : บาท";
|
||
ws.Cell("A3").Style.Alignment.WrapText = true;
|
||
ws.Range("A3:T3").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
|
||
ws.Range("A3:T3").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||
ws.Range("A3:T3").Style.Font.FontName = "TH SarabunPSK";
|
||
ws.Range("A3:T3").Style.Font.FontSize = 16;
|
||
ws.Range("A4:A7").Merge().Value = "ลำดับที่";
|
||
ws.Cell("A4").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||
ws.Cell("A4").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||
ws.Range("A4:A7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||
ws.Cell("A4").Style.Font.FontName = "TH SarabunPSK";
|
||
ws.Cell("A4").Style.Font.SetBold().Font.FontSize = 16;
|
||
|
||
ws.Range("B4:B7").Merge().Value = "เลขที่ตำแหน่ง";
|
||
ws.Cell("B4").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||
ws.Cell("B4").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||
ws.Range("B4:B7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||
ws.Cell("B4").Style.Font.FontName = "TH SarabunPSK";
|
||
ws.Cell("B4").Style.Font.SetBold().Font.FontSize = 16;
|
||
|
||
ws.Range("C4:D7").Merge().Value = "ชื่อ- สกุล";
|
||
ws.Cell("C4").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||
ws.Cell("C4").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||
ws.Range("C4:D7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||
ws.Cell("C4").Style.Font.FontName = "TH SarabunPSK";
|
||
ws.Cell("C4").Style.Font.SetBold().Font.FontSize = 16;
|
||
|
||
ws.Range("E4:E7").Merge().Value = "ชื่อตำแหน่ง";
|
||
ws.Cell("E4").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||
ws.Cell("E4").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||
ws.Range("E4:E7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||
ws.Cell("E4").Style.Font.FontName = "TH SarabunPSK";
|
||
ws.Cell("E4").Style.Font.SetBold().Font.FontSize = 16;
|
||
|
||
ws.Range("F4:G7").Merge().Value = "สังกัด/พื้นที่";
|
||
ws.Cell("F4").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||
ws.Cell("F4").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||
ws.Range("F4:G7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||
ws.Cell("F4").Style.Font.FontName = "TH SarabunPSK";
|
||
ws.Cell("F4").Style.Font.SetBold().Font.FontSize = 16;
|
||
|
||
ws.Range("H4:H7").Merge().Value = "เงินเดือน ณ 1 ต.ค. 64 - 30 ก.ย. 65";
|
||
ws.Cell("H4").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||
ws.Cell("H4").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||
ws.Range("H4:H7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||
ws.Cell("H4").Style.Font.FontName = "TH SarabunPSK";
|
||
ws.Cell("H4").Style.Font.SetBold().Font.FontSize = 16;
|
||
|
||
ws.Range("I4:I6").Merge().Value = "ประมาณการเงินเดือน 1 ต.ค. 65- 30 ก.ย. 66";
|
||
ws.Cell("I4").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||
ws.Cell("I4").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||
ws.Range("I4:I6").Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||
ws.Cell("I4").Style.Font.FontName = "TH SarabunPSK";
|
||
ws.Cell("I4").Style.Font.SetBold().Font.FontSize = 16;
|
||
|
||
ws.Range("J4:J6").Merge().Value = "เลื่อนขั้น 4% 1 ต.ค. 66- 30 ก.ย. 67";
|
||
ws.Cell("J4").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||
ws.Cell("J4").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||
ws.Range("J4:J6").Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||
ws.Cell("J4").Style.Font.FontName = "TH SarabunPSK";
|
||
ws.Cell("J4").Style.Font.SetBold().Font.FontSize = 16;
|
||
|
||
ws.Range("K4:K6").Merge().Value = "รวม";
|
||
ws.Cell("K4").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||
ws.Cell("K4").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||
ws.Range("K4:K6").Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||
ws.Cell("K4").Style.Font.FontName = "TH SarabunPSK";
|
||
ws.Cell("K4").Style.Font.SetBold().Font.FontSize = 16;
|
||
ws.Range("L4:L6").Merge().Value = "เงินเดือน*12";
|
||
ws.Cell("L4").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||
ws.Cell("L4").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||
ws.Range("L4:L6").Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||
ws.Cell("L4").Style.Font.FontName = "TH SarabunPSK";
|
||
ws.Cell("L4").Style.Font.SetBold().Font.FontSize = 16;
|
||
ws.Range("L4:L6").Merge().Value = "เงินเดือน*12";
|
||
ws.Cell("L4").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||
ws.Cell("L4").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||
ws.Range("L4:L6").Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||
ws.Cell("L4").Style.Font.FontName = "TH SarabunPSK";
|
||
ws.Cell("L4").Style.Font.SetBold().Font.FontSize = 16;
|
||
|
||
ws.Range("M4:S4").Merge().Value = "ส่วนควบงบดำเนินงาน";
|
||
ws.Cell("M4").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||
ws.Cell("M4").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||
ws.Range("M4:S4").Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||
ws.Cell("M4").Style.Font.FontName = "TH SarabunPSK";
|
||
ws.Cell("M4").Style.Font.SetBold().Font.FontSize = 16;
|
||
|
||
ws.Range("M5:N6").Merge().Value = "เงินสมทบกองทุนประกันสังคม";
|
||
ws.Cell("M5").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||
ws.Cell("M5").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||
ws.Range("M5:N6").Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||
ws.Cell("M5").Style.Font.FontName = "TH SarabunPSK";
|
||
ws.Cell("M5").Style.Font.SetBold().Font.FontSize = 16;
|
||
ws.Range("O5:P6").Merge().Value = "เงินสมทบกองทุนเงินทดแทน";
|
||
ws.Cell("O5").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||
ws.Cell("O5").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||
ws.Range("O5:P6").Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||
ws.Cell("O5").Style.Font.FontName = "TH SarabunPSK";
|
||
ws.Cell("O5").Style.Font.SetBold().Font.FontSize = 16;
|
||
ws.Range("Q5:R5").Merge().Value = "อื่น ๆ";
|
||
ws.Cell("Q5").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||
ws.Cell("Q5").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||
ws.Range("Q5:R5").Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||
ws.Cell("Q5").Style.Font.FontName = "TH SarabunPSK";
|
||
ws.Cell("Q5").Style.Font.SetBold().Font.FontSize = 16;
|
||
ws.Cell("Q6").Value = "ระบุรายการ";
|
||
ws.Cell("Q6").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||
ws.Cell("Q6").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||
ws.Cell("Q6").Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||
ws.Cell("Q6").Style.Font.FontName = "TH SarabunPSK";
|
||
ws.Cell("Q6").Style.Font.SetBold().Font.FontSize = 16;
|
||
ws.Cell("R6").Value = "จำนวนเงิน";
|
||
ws.Cell("R6").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||
ws.Cell("R6").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||
ws.Cell("R6").Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||
ws.Cell("R6").Style.Font.FontName = "TH SarabunPSK";
|
||
ws.Cell("R6").Style.Font.SetBold().Font.FontSize = 16;
|
||
ws.Range("S5:S6").Merge().Value = "รวม";
|
||
ws.Cell("S5").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||
ws.Cell("S5").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||
ws.Range("S5:S6").Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||
ws.Cell("S5").Style.Font.FontName = "TH SarabunPSK";
|
||
ws.Cell("S5").Style.Font.SetBold().Font.FontSize = 16;
|
||
ws.Range("T4:T6").Merge().Value = "รวมเงินเดือนและส่วนควบ";
|
||
ws.Cell("T4").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||
ws.Cell("T4").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||
ws.Range("T4:T6").Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||
ws.Cell("T4").Style.Font.FontName = "TH SarabunPSK";
|
||
ws.Cell("T4").Style.Font.SetBold().Font.FontSize = 16;
|
||
ws.Range("U4:U6").Merge().Value = "รวมเงินเดือนและส่วนควบ*12เดือน";
|
||
ws.Cell("U4").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||
ws.Cell("U4").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||
ws.Range("U4:U6").Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||
ws.Cell("U4").Style.Font.FontName = "TH SarabunPSK";
|
||
ws.Cell("U4").Style.Font.SetBold().Font.FontSize = 16;
|
||
ws.Cell("I7").Value = "-1";
|
||
ws.Cell("I7").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||
ws.Cell("I7").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||
ws.Cell("I7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||
ws.Cell("I7").Style.Font.FontName = "TH SarabunPSK";
|
||
ws.Cell("I7").Style.Font.SetBold().Font.FontSize = 12;
|
||
ws.Cell("J7").Value = "-(2)";
|
||
ws.Cell("J7").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||
ws.Cell("J7").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||
ws.Cell("J7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||
ws.Cell("J7").Style.Font.FontName = "TH SarabunPSK";
|
||
ws.Cell("J7").Style.Font.SetBold().Font.FontSize = 12;
|
||
ws.Cell("K7").Value = "(3) = (1) + (2)";
|
||
ws.Cell("K7").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||
ws.Cell("K7").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||
ws.Cell("K7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||
ws.Cell("K7").Style.Font.FontName = "TH SarabunPSK";
|
||
ws.Cell("K7").Style.Font.SetBold().Font.FontSize = 12;
|
||
ws.Cell("L7").Value = "(3)*12";
|
||
ws.Cell("L7").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||
ws.Cell("L7").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||
ws.Cell("L7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||
ws.Cell("L7").Style.Font.FontName = "TH SarabunPSK";
|
||
ws.Cell("L7").Style.Font.SetBold().Font.FontSize = 12;
|
||
ws.Cell("M7").Value = "(4)";
|
||
ws.Cell("M7").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||
ws.Cell("M7").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||
ws.Cell("M7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||
ws.Cell("M7").Style.Font.FontName = "TH SarabunPSK";
|
||
ws.Cell("M7").Style.Font.SetBold().Font.FontSize = 12;
|
||
ws.Cell("N7").Value = "(4)*12";
|
||
ws.Cell("N7").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||
ws.Cell("N7").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||
ws.Cell("N7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||
ws.Cell("N7").Style.Font.FontName = "TH SarabunPSK";
|
||
ws.Cell("N7").Style.Font.SetBold().Font.FontSize = 12;
|
||
ws.Cell("O7").Value = "(5)";
|
||
ws.Cell("O7").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||
ws.Cell("O7").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||
ws.Cell("O7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||
ws.Cell("O7").Style.Font.FontName = "TH SarabunPSK";
|
||
ws.Cell("O7").Style.Font.SetBold().Font.FontSize = 12;
|
||
ws.Cell("P7").Value = "(5)*12";
|
||
ws.Cell("P7").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||
ws.Cell("P7").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||
ws.Cell("P7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||
ws.Cell("P7").Style.Font.FontName = "TH SarabunPSK";
|
||
ws.Cell("P7").Style.Font.SetBold().Font.FontSize = 12;
|
||
ws.Cell("R7").Value = "(6)";
|
||
ws.Cell("R7").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||
ws.Cell("R7").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||
ws.Cell("R7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||
ws.Cell("R7").Style.Font.FontName = "TH SarabunPSK";
|
||
ws.Cell("R7").Style.Font.SetBold().Font.FontSize = 12;
|
||
ws.Cell("S7").Value = "(7) = (4) ถึง (6)";
|
||
ws.Cell("S7").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||
ws.Cell("S7").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||
ws.Cell("S7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||
ws.Cell("S7").Style.Font.FontName = "TH SarabunPSK";
|
||
ws.Cell("S7").Style.Font.SetBold().Font.FontSize = 12;
|
||
ws.Cell("T7").Value = "(8) = (3) + (7)";
|
||
ws.Cell("T7").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||
ws.Cell("T7").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||
ws.Cell("T7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||
ws.Cell("T7").Style.Font.FontName = "TH SarabunPSK";
|
||
ws.Cell("T7").Style.Font.SetBold().Font.FontSize = 12;
|
||
ws.Cell("U7").Value = "(8)*12";
|
||
ws.Cell("U7").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||
ws.Cell("U7").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||
ws.Cell("U7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||
ws.Cell("Q7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||
ws.Cell("U7").Style.Font.FontName = "TH SarabunPSK";
|
||
ws.Cell("U7").Style.Font.SetBold().Font.FontSize = 12;
|
||
|
||
ws.Range("A4:U7").Style.Alignment.WrapText = true;
|
||
ws.Row(4).Height = 25;
|
||
ws.Row(5).Height = 25;
|
||
ws.Row(6).Height = 25;
|
||
ws.Column(1).Width = 10;
|
||
ws.Column(2).Width = 10;
|
||
ws.Column(3).Width = 20;
|
||
ws.Column(4).Width = 15;
|
||
ws.Column(5).Width = 15;
|
||
ws.Column(6).Width = 15;
|
||
ws.Column(7).Width = 15;
|
||
ws.Column(8).Width = 15;
|
||
ws.Column(9).Width = 15;
|
||
ws.Column(10).Width = 15;
|
||
ws.Column(11).Width = 15;
|
||
ws.Column(12).Width = 15;
|
||
ws.Column(13).Width = 15;
|
||
ws.Column(14).Width = 15;
|
||
ws.Column(15).Width = 15;
|
||
ws.Column(16).Width = 15;
|
||
ws.Column(17).Width = 15;
|
||
ws.Column(18).Width = 15;
|
||
ws.Column(19).Width = 15;
|
||
ws.Column(20).Width = 15;
|
||
ws.Column(21).Width = 15;
|
||
int row = 8;
|
||
int no = 1;
|
||
|
||
if (_personnel != null)
|
||
{
|
||
ws.Range(ws.Cell(row, 3), ws.Cell(row, 5)).Merge().Value = "รวมงบประมาณทั้งสิ้น";
|
||
ws.Cell(row, 8).Value = _personnel.salary;
|
||
ws.Cell(row, 9).Value = _personnel.estimate_promote_1;
|
||
ws.Cell(row, 10).Value = _personnel.estimate_promote_2;
|
||
ws.Cell(row, 11).Value = _personnel.estimate_promote_3;
|
||
ws.Cell(row, 12).Value = _personnel.estimate_promote_4;
|
||
ws.Cell(row, 13).Value = _personnel.salary_next_year_12;
|
||
ws.Cell(row, 14).Value = _personnel.retiree;
|
||
ws.Cell(row, 15).Value = _personnel.salary_per_month;
|
||
ws.Cell(row, 16).Value = _personnel.salary_per_month_12;
|
||
ws.Cell(row, 17).Value = _personnel.retirement_salary_per_year;
|
||
ws.Cell(row, 18).Value = _personnel.special_compensation;
|
||
ws.Cell(row, 19).Value = _personnel.special_compensation_12;
|
||
ws.Cell(row, 20).Value = _personnel.full_salary;
|
||
ws.Cell(row, 21).Value = _personnel.special_compensation_1;
|
||
// ws.Cell(row, 22).Value = detail.special_compensation_2;
|
||
// ws.Cell(row, 23).Value = detail.special_compensation_3;
|
||
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.Cell(row, 20).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||
ws.Cell(row, 21).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||
|
||
ws.Range(ws.Cell(row, 1), ws.Cell(row, 21)).Style.Font.FontName =
|
||
"TH SarabunPSK";
|
||
ws.Range(ws.Cell(row, 1), ws.Cell(row, 21)).Style.Font.SetBold().Font.FontSize = 16;
|
||
ws.Range(ws.Cell(row, 1), ws.Cell(row, 21)).Style.Alignment.WrapText = true;
|
||
ws.Range(ws.Cell(row, 1), ws.Cell(row, 21)).Style.Alignment.Vertical =
|
||
XLAlignmentVerticalValues.Center;
|
||
ws.Range(ws.Cell(row, 1), ws.Cell(row, 21)).Style.Alignment.Horizontal =
|
||
XLAlignmentHorizontalValues.Center;
|
||
ws.Range(ws.Cell(row, 8), ws.Cell(row, 21)).SetDataType(XLDataType.Number);
|
||
ws.Range(ws.Cell(row, 8), ws.Cell(row, 21)).Style.NumberFormat.SetFormat("#,#");
|
||
row++;
|
||
foreach (var detail in _personnel.personnel_salary_permanent)
|
||
{
|
||
ws.Range(ws.Cell(row, 2), ws.Cell(row, 6)).Merge().Value = detail.agency_category_name;
|
||
ws.Cell(row, 8).Value = detail.salary;
|
||
ws.Cell(row, 9).Value = detail.estimate_promote_1;
|
||
ws.Cell(row, 10).Value = detail.estimate_promote_2;
|
||
ws.Cell(row, 11).Value = detail.estimate_promote_3;
|
||
ws.Cell(row, 12).Value = detail.estimate_promote_4;
|
||
ws.Cell(row, 13).Value = detail.salary_next_year_12;
|
||
ws.Cell(row, 14).Value = detail.retiree;
|
||
ws.Cell(row, 15).Value = detail.salary_per_month;
|
||
ws.Cell(row, 16).Value = detail.salary_per_month_12;
|
||
ws.Cell(row, 17).Value = detail.retirement_salary_per_year;
|
||
ws.Cell(row, 18).Value = detail.special_compensation;
|
||
ws.Cell(row, 19).Value = detail.special_compensation_12;
|
||
ws.Cell(row, 20).Value = detail.full_salary;
|
||
ws.Cell(row, 21).Value = detail.special_compensation_1;
|
||
// ws.Cell(row, 22).Value = detail.special_compensation_2;
|
||
// ws.Cell(row, 23).Value = detail.special_compensation_3;
|
||
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.Cell(row, 20).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||
ws.Cell(row, 21).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||
ws.Range(ws.Cell(row, 1), ws.Cell(row, 21)).Style.Fill.BackgroundColor = XLColor.LightYellow;
|
||
|
||
ws.Range(ws.Cell(row, 1), ws.Cell(row, 21)).Style.Font.FontName =
|
||
"TH SarabunPSK";
|
||
ws.Range(ws.Cell(row, 1), ws.Cell(row, 21)).Style.Font.FontSize = 16;
|
||
ws.Range(ws.Cell(row, 1), ws.Cell(row, 21)).Style.Alignment.WrapText = true;
|
||
ws.Range(ws.Cell(row, 1), ws.Cell(row, 21)).Style.Alignment.Vertical =
|
||
XLAlignmentVerticalValues.Center;
|
||
ws.Range(ws.Cell(row, 1), ws.Cell(row, 21)).Style.Alignment.Horizontal =
|
||
XLAlignmentHorizontalValues.Center;
|
||
ws.Range(ws.Cell(row, 8), ws.Cell(row, 21)).SetDataType(XLDataType.Number);
|
||
ws.Range(ws.Cell(row, 8), ws.Cell(row, 21)).Style.NumberFormat.SetFormat("#,#");
|
||
row++;
|
||
foreach (var deltail2 in detail.personnel_salary_deltails)
|
||
{
|
||
if (deltail2.full_name != "รวม")
|
||
{
|
||
ws.Cell(row, 1).Value = no;
|
||
no++;
|
||
ws.Cell(row, 2).Value = deltail2.manpower;
|
||
ws.Cell(row, 3).Value = deltail2.first_name_th;
|
||
ws.Cell(row, 4).Value = deltail2.last_name_th;
|
||
//ws.Range(ws.Cell(row, 3), ws.Cell(row, 4)).Merge().Value = deltail2.full_name;
|
||
ws.Cell(row, 5).Value = deltail2.position;
|
||
ws.Cell(row, 6).Value = deltail2.parent_agency_name;
|
||
ws.Cell(row, 7).Value = deltail2.area;
|
||
ws.Cell(row, 8).Value = deltail2.salary;
|
||
ws.Cell(row, 9).Value = deltail2.estimate_promote_1;
|
||
ws.Cell(row, 10).Value = deltail2.estimate_promote_2;
|
||
ws.Cell(row, 11).Value = deltail2.estimate_promote_3;
|
||
ws.Cell(row, 12).Value = deltail2.estimate_promote_4;
|
||
ws.Cell(row, 13).Value = deltail2.salary_next_year_12;
|
||
ws.Cell(row, 14).Value = deltail2.retiree;
|
||
ws.Cell(row, 15).Value = deltail2.salary_per_month;
|
||
ws.Cell(row, 16).Value = deltail2.salary_per_month_12;
|
||
ws.Cell(row, 17).Value = deltail2.retirement_salary_per_year;
|
||
ws.Cell(row, 18).Value = deltail2.special_compensation;
|
||
ws.Cell(row, 19).Value = deltail2.special_compensation_12;
|
||
ws.Cell(row, 20).Value = deltail2.full_salary;
|
||
ws.Cell(row, 21).Value = deltail2.special_compensation_1;
|
||
ws.Cell(row, 1).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||
ws.Cell(row, 2).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||
ws.Cell(row, 3).Style.Border.LeftBorder = XLBorderStyleValues.Thin;
|
||
ws.Cell(row, 3).Style.Border.RightBorder = XLBorderStyleValues.None;
|
||
ws.Cell(row, 3).Style.Border.BottomBorder = XLBorderStyleValues.Thin;
|
||
ws.Cell(row, 4).Style.Border.LeftBorder = XLBorderStyleValues.None;
|
||
ws.Cell(row, 4).Style.Border.RightBorder = XLBorderStyleValues.Thin;
|
||
ws.Cell(row, 4).Style.Border.BottomBorder = 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.Cell(row, 20).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||
ws.Cell(row, 21).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||
ws.Range(ws.Cell(row, 1), ws.Cell(row, 21)).Style.Font.FontName =
|
||
"TH SarabunPSK";
|
||
ws.Range(ws.Cell(row, 1), ws.Cell(row, 21)).Style.Font.FontSize = 16;
|
||
ws.Range(ws.Cell(row, 1), ws.Cell(row, 21)).Style.Alignment.WrapText = true;
|
||
ws.Range(ws.Cell(row, 1), ws.Cell(row, 21)).Style.Alignment.Vertical =
|
||
XLAlignmentVerticalValues.Center;
|
||
ws.Range(ws.Cell(row, 1), ws.Cell(row, 21)).Style.Alignment.Horizontal =
|
||
XLAlignmentHorizontalValues.Center;
|
||
ws.Range(ws.Cell(row, 8), ws.Cell(row, 21)).SetDataType(XLDataType.Number);
|
||
ws.Range(ws.Cell(row, 8), ws.Cell(row, 21)).Style.NumberFormat.SetFormat("#,#");
|
||
row++;
|
||
}
|
||
|
||
if (deltail2.full_name == "รวม")
|
||
{
|
||
ws.Range(ws.Cell(row, 1), ws.Cell(row, 4)).Merge().Value = deltail2.full_name;
|
||
ws.Cell(row, 5).Value = deltail2.position;
|
||
ws.Cell(row, 6).Value = deltail2.parent_agency_name;
|
||
ws.Cell(row, 7).Value = deltail2.area;
|
||
ws.Cell(row, 8).Value = deltail2.salary;
|
||
ws.Cell(row, 9).Value = deltail2.estimate_promote_1;
|
||
ws.Cell(row, 10).Value = deltail2.estimate_promote_2;
|
||
ws.Cell(row, 11).Value = deltail2.estimate_promote_3;
|
||
ws.Cell(row, 12).Value = deltail2.estimate_promote_4;
|
||
ws.Cell(row, 13).Value = deltail2.salary_next_year_12;
|
||
ws.Cell(row, 14).Value = deltail2.retiree;
|
||
ws.Cell(row, 15).Value = deltail2.salary_per_month;
|
||
ws.Cell(row, 16).Value = deltail2.salary_per_month_12;
|
||
ws.Cell(row, 17).Value = deltail2.retirement_salary_per_year;
|
||
ws.Cell(row, 18).Value = deltail2.special_compensation;
|
||
ws.Cell(row, 19).Value = deltail2.special_compensation_12;
|
||
ws.Cell(row, 20).Value = deltail2.full_salary;
|
||
ws.Cell(row, 21).Value = deltail2.special_compensation_1;
|
||
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.Cell(row, 20).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||
ws.Cell(row, 21).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||
ws.Range(ws.Cell(row, 1), ws.Cell(row, 21)).Style.Border.TopBorder = XLBorderStyleValues.Double;
|
||
ws.Range(ws.Cell(row, 1), ws.Cell(row, 21)).Style.Font.FontName =
|
||
"TH SarabunPSK";
|
||
ws.Range(ws.Cell(row, 1), ws.Cell(row, 21)).Style.Font.SetBold().Font.FontSize = 16;
|
||
ws.Range(ws.Cell(row, 1), ws.Cell(row, 21)).Style.Alignment.WrapText = true;
|
||
ws.Range(ws.Cell(row, 1), ws.Cell(row, 21)).Style.Alignment.Vertical =
|
||
XLAlignmentVerticalValues.Center;
|
||
ws.Range(ws.Cell(row, 1), ws.Cell(row, 21)).Style.Alignment.Horizontal =
|
||
XLAlignmentHorizontalValues.Center;
|
||
ws.Range(ws.Cell(row, 8), ws.Cell(row, 21)).SetDataType(XLDataType.Number);
|
||
ws.Range(ws.Cell(row, 8), ws.Cell(row, 21)).Style.NumberFormat.SetFormat("#,#");
|
||
}
|
||
}
|
||
}
|
||
|
||
}
|
||
var richText = ws.PageSetup.Footer.Left.AddText("หมายเหตุ : ในกรณีที่เงินเดือนตุลาคม 2564 ยังไม่เลื่อนขั้นเงินเดือน ให้กรอกเงินเลื่อนขั้น 4% ในช่อง (2)", XLHFOccurrence.FirstPage);
|
||
richText.FontSize = 16;
|
||
richText.FontName = "TH SarabunPSK";
|
||
|
||
using (var stream1 = new MemoryStream())
|
||
{
|
||
workbook.SaveAs(stream1);
|
||
var content = stream1.ToArray();
|
||
string date = DateTime.Now.ToString("yyyyMMddHHmmss");
|
||
return File(
|
||
content,
|
||
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
||
"personnel_permanent_" + date + ".xlsx");
|
||
}
|
||
}
|
||
|
||
[HttpPost, Route("reports/set_personnel_budget/{type}")]
|
||
[ApiExplorerSettings(GroupName = "reports")]
|
||
public IActionResult GetSetPersonBudgetReport([FromRoute] string type,
|
||
[FromBody] set_personnel_budget personnel)
|
||
{
|
||
var workbook = new XLWorkbook();
|
||
var ws = workbook.Worksheets.Add("6.1ค่าตอบแทนพนักงานราชการ");
|
||
|
||
ws.Range("A1:S1").Merge().Value = "การตั้งงบประมาณค่าใช้จ่ายบุคลากร ของพนักงานราชการ ปีงบประมาณ พ.ศ. " +
|
||
personnel.academic_year_name_th;
|
||
ws.Cell("A1").Style.Alignment.WrapText = true;
|
||
ws.Range("A1:S1").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||
ws.Range("A1:S1").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||
ws.Cell("A1").Style.Font.FontName = "TH SarabunPSK";
|
||
ws.Cell("A1").Style.Font.FontSize = 16;
|
||
ws.Cell("A1").Style.Font.Bold = true;
|
||
ws.Cell("A4").Value = "กระทรวง : ";
|
||
ws.Cell("A4").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
|
||
ws.Cell("A4").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||
ws.Cell("A4").Style.Font.FontName = "TH SarabunPSK";
|
||
ws.Cell("A4").Style.Font.FontSize = 16;
|
||
ws.Cell("A4").Style.Font.Bold = true;
|
||
ws.Range("B4:F4").Merge().Value = personnel.ministry_name_th;
|
||
ws.Range("B4:F4").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left;
|
||
ws.Range("B4:F4").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||
ws.Cell("B4").Style.Font.FontName = "TH SarabunPSK";
|
||
ws.Cell("B4").Style.Font.FontSize = 16;
|
||
ws.Range("B4:F4").Style.Border.BottomBorder = XLBorderStyleValues.Dotted;
|
||
|
||
ws.Cell("A5").Value = "หน่วยงาน : ";
|
||
ws.Cell("A5").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
|
||
ws.Cell("A5").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||
ws.Cell("A5").Style.Font.FontName = "TH SarabunPSK";
|
||
ws.Cell("A5").Style.Font.FontSize = 16;
|
||
ws.Cell("A5").Style.Font.Bold = true;
|
||
|
||
ws.Range("B5:F5").Merge().Value = personnel.agency_name_th;
|
||
ws.Range("B5:F5").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left;
|
||
ws.Range("B5:F5").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||
ws.Cell("B5").Style.Font.FontName = "TH SarabunPSK";
|
||
ws.Cell("B5").Style.Font.FontSize = 16;
|
||
ws.Range("B5:F5").Style.Border.BottomBorder = XLBorderStyleValues.Dotted;
|
||
|
||
ws.Cell("A8").Value = "สรุป เสนอตั้งงบประมาณ";
|
||
ws.Cell("A8").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left;
|
||
ws.Cell("A8").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||
ws.Cell("A8").Style.Font.FontName = "TH SarabunPSK";
|
||
ws.Cell("A8").Style.Font.FontSize = 16;
|
||
ws.Cell("A8").Style.Font.Bold = true;
|
||
ws.Cell("A8").Style.Font.Underline = XLFontUnderlineValues.Single;
|
||
ws.Cell("D8").Value = "จำนวน";
|
||
ws.Cell("D8").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
|
||
ws.Cell("D8").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||
ws.Cell("D8").Style.Font.FontName = "TH SarabunPSK";
|
||
ws.Cell("D8").Style.Font.FontSize = 16;
|
||
ws.Cell("D8").Style.Font.Bold = true;
|
||
ws.Range("E8:F8").Merge().Value = personnel.total_propose_budget1;
|
||
ws.Range("E8:F8").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
|
||
ws.Range("E8:F8").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||
ws.Range("E8:F8").Style.Font.FontName = "TH SarabunPSK";
|
||
ws.Range("E8:F8").Style.Font.FontSize = 16;
|
||
ws.Range("E8:F8").Style.Border.BottomBorder = XLBorderStyleValues.Dotted;
|
||
ws.Cell("H8").Value = "งบประมาณ";
|
||
ws.Cell("H8").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
|
||
ws.Cell("H8").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||
ws.Cell("H8").Style.Font.FontName = "TH SarabunPSK";
|
||
ws.Cell("H8").Style.Font.FontSize = 16;
|
||
ws.Cell("H8").Style.Font.Bold = true;
|
||
ws.Range("I8:J8").Merge().Value = personnel.budget1;
|
||
ws.Range("I8:J8").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
|
||
ws.Range("I8:J8").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||
ws.Range("I8:J8").Style.Font.FontName = "TH SarabunPSK";
|
||
ws.Range("I8:J8").Style.Font.FontSize = 16;
|
||
ws.Range("I8:J8").Style.Border.BottomBorder = XLBorderStyleValues.Dotted;
|
||
ws.Cell("K8").Value = "ล้านบาท (รวมส่วนควบและค่าใช้จ่ายตามสิทธิ)";
|
||
ws.Cell("K8").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left;
|
||
ws.Cell("K8").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||
ws.Cell("K8").Style.Font.FontName = "TH SarabunPSK";
|
||
ws.Cell("K8").Style.Font.FontSize = 16;
|
||
ws.Cell("K8").Style.Font.Bold = true;
|
||
ws.Cell("A9").Value = "ประกอบด้วย";
|
||
ws.Cell("A9").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left;
|
||
ws.Cell("A9").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||
ws.Cell("A9").Style.Font.FontName = "TH SarabunPSK";
|
||
ws.Cell("A9").Style.Font.FontSize = 16;
|
||
ws.Cell("A9").Style.Font.Bold = true;
|
||
// ws.Cell("A10").Value = "ส่วนที่ 1";
|
||
// ws.Cell("A10").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left;
|
||
// ws.Cell("A10").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||
// ws.Cell("A10").Style.Font.FontName = "TH SarabunPSK";
|
||
// ws.Cell("A10").Style.Font.FontSize = 16;
|
||
// ws.Cell("A10").Style.Font.Underline = XLFontUnderlineValues.Single;
|
||
ws.Range("A10:C10").Merge().Value = "ส่วนที่ 1 แบบคำนวณค่าตอบแทนพนักงานราชการ";
|
||
ws.Range("A10:C10").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left;
|
||
ws.Range("A10:C10").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||
ws.Range("A10:C10").Style.Font.FontName = "TH SarabunPSK";
|
||
ws.Range("A10:C10").Style.Font.SetBold().Font.FontSize = 16;
|
||
ws.Range("A10:C10").Style.Font.Underline = XLFontUnderlineValues.Single;
|
||
|
||
ws.Cell("D10").Value = "จำนวน";
|
||
ws.Cell("D10").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
|
||
ws.Cell("D10").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||
ws.Cell("D10").Style.Font.FontName = "TH SarabunPSK";
|
||
ws.Cell("D10").Style.Font.FontSize = 16;
|
||
ws.Cell("D10").Style.Font.Bold = true;
|
||
ws.Range("E10:F10").Merge().Value = personnel.total_propose_budget2;
|
||
ws.Range("E10:F10").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
|
||
ws.Range("E10:F10").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||
ws.Range("E10:F10").Style.Font.FontName = "TH SarabunPSK";
|
||
ws.Range("E10:F10").Style.Font.FontSize = 16;
|
||
ws.Range("E10:F10").Style.Border.BottomBorder = XLBorderStyleValues.Dotted;
|
||
ws.Cell("H8").Value = "งบประมาณ";
|
||
ws.Cell("H8").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
|
||
ws.Cell("H8").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||
ws.Cell("H8").Style.Font.FontName = "TH SarabunPSK";
|
||
ws.Cell("H8").Style.Font.FontSize = 16;
|
||
ws.Cell("H8").Style.Font.Bold = true;
|
||
ws.Range("I10:J10").Merge().Value = personnel.budget2;
|
||
ws.Range("I10:J10").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
|
||
ws.Range("I10:J10").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||
ws.Range("I10:J10").Style.Font.FontName = "TH SarabunPSK";
|
||
ws.Range("I10:J10").Style.Font.FontSize = 16;
|
||
ws.Range("I10:J10").Style.Border.BottomBorder = XLBorderStyleValues.Dotted;
|
||
ws.Cell("K10").Value = "ล้านบาท (ไม่รวมส่วนควบ)";
|
||
ws.Cell("K10").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left;
|
||
ws.Cell("K10").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||
ws.Cell("K10").Style.Font.FontName = "TH SarabunPSK";
|
||
ws.Cell("K10").Style.Font.FontSize = 16;
|
||
ws.Cell("K10").Style.Font.Bold = true;
|
||
ws.Cell("A12").Value = "พรบ.ปี " + personnel.year1;
|
||
ws.Cell("A12").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
|
||
ws.Cell("A12").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||
ws.Cell("A12").Style.Font.FontName = "TH SarabunPSK";
|
||
ws.Cell("A12").Style.Font.FontSize = 16;
|
||
ws.Cell("A12").Style.Font.Bold = true;
|
||
ws.Cell("B12").Value = personnel.act_old1;
|
||
ws.Cell("B12").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
|
||
ws.Cell("B12").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||
ws.Cell("B12").Style.Font.FontName = "TH SarabunPSK";
|
||
ws.Cell("B12").Style.Font.FontSize = 16;
|
||
ws.Cell("B12").Style.Font.Bold = true;
|
||
ws.Cell("C12").Value = "ลบ.";
|
||
ws.Cell("C12").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left;
|
||
ws.Cell("C12").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||
ws.Cell("C12").Style.Font.FontName = "TH SarabunPSK";
|
||
ws.Cell("C12").Style.Font.FontSize = 16;
|
||
ws.Cell("C12").Style.Font.Bold = true;
|
||
ws.Cell("D12").Value = "เบิกจ่ายปี งปม." + personnel.year1.Substring(2, 2);
|
||
ws.Cell("D12").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left;
|
||
ws.Cell("D12").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||
ws.Cell("D12").Style.Font.FontName = "TH SarabunPSK";
|
||
ws.Cell("D12").Style.Font.FontSize = 16;
|
||
ws.Cell("D12").Style.Font.Bold = true;
|
||
ws.Cell("F12").Value = personnel.disbursement_year_act_old1;
|
||
ws.Cell("F12").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
|
||
ws.Cell("F12").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||
ws.Cell("F12").Style.Font.FontName = "TH SarabunPSK";
|
||
ws.Cell("F12").Style.Font.FontSize = 16;
|
||
ws.Cell("F12").Style.Font.Bold = true;
|
||
ws.Cell("G12").Value = "ลบ.";
|
||
ws.Cell("G12").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left;
|
||
ws.Cell("G12").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||
ws.Cell("G12").Style.Font.FontName = "TH SarabunPSK";
|
||
ws.Cell("G12").Style.Font.FontSize = 16;
|
||
ws.Cell("G12").Style.Font.Bold = true;
|
||
ws.Cell("H12").Value = "คิดเป็นร้อยละ";
|
||
ws.Cell("H12").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
|
||
ws.Cell("H12").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||
ws.Cell("H12").Style.Font.FontName = "TH SarabunPSK";
|
||
ws.Cell("H12").Style.Font.FontSize = 16;
|
||
ws.Cell("H12").Style.Font.Bold = true;
|
||
ws.Cell("I12").Value = personnel.disbursement_year_act_old1_percent;
|
||
ws.Cell("I12").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left;
|
||
ws.Cell("I12").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||
ws.Cell("I12").Style.Font.FontName = "TH SarabunPSK";
|
||
ws.Cell("I12").Style.Font.FontSize = 16;
|
||
ws.Cell("I12").Style.Font.Bold = true;
|
||
ws.Cell("J12").Value = "คงเหลือ";
|
||
ws.Cell("J12").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
|
||
ws.Cell("J12").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||
ws.Cell("J12").Style.Font.FontName = "TH SarabunPSK";
|
||
ws.Cell("J12").Style.Font.FontSize = 16;
|
||
ws.Cell("J12").Style.Font.Bold = true;
|
||
ws.Cell("K12").Value = personnel.remaining_act_old1;
|
||
ws.Cell("K12").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
|
||
ws.Cell("K12").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||
ws.Cell("K12").Style.Font.FontName = "TH SarabunPSK";
|
||
ws.Cell("K12").Style.Font.FontSize = 16;
|
||
ws.Cell("K12").Style.Font.Bold = true;
|
||
ws.Cell("L12").Value = "ลบ.";
|
||
ws.Cell("L12").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left;
|
||
ws.Cell("L12").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||
ws.Cell("L12").Style.Font.FontName = "TH SarabunPSK";
|
||
ws.Cell("L12").Style.Font.FontSize = 16;
|
||
ws.Cell("L12").Style.Font.Bold = true;
|
||
ws.Cell("M12").Value = "คิดเป็นร้อยละ";
|
||
ws.Cell("M12").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left;
|
||
ws.Cell("M12").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||
ws.Cell("M12").Style.Font.FontName = "TH SarabunPSK";
|
||
ws.Cell("M12").Style.Font.FontSize = 16;
|
||
ws.Cell("M12").Style.Font.Bold = true;
|
||
ws.Cell("N12").Value = personnel.remaining_act_old1_percent;
|
||
ws.Cell("N12").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left;
|
||
ws.Cell("N12").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||
ws.Cell("N12").Style.Font.FontName = "TH SarabunPSK";
|
||
ws.Cell("N12").Style.Font.FontSize = 16;
|
||
ws.Cell("N12").Style.Font.Bold = true;
|
||
ws.Cell("A13").Value = "พรบ.ปี " + personnel.year2;
|
||
ws.Cell("A13").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
|
||
ws.Cell("A13").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||
ws.Cell("A13").Style.Font.FontName = "TH SarabunPSK";
|
||
ws.Cell("A13").Style.Font.FontSize = 16;
|
||
ws.Cell("A13").Style.Font.Bold = true;
|
||
ws.Cell("B13").Value = personnel.act_old2;
|
||
ws.Cell("B13").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
|
||
ws.Cell("B13").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||
ws.Cell("B13").Style.Font.FontName = "TH SarabunPSK";
|
||
ws.Cell("B13").Style.Font.FontSize = 16;
|
||
ws.Cell("B13").Style.Font.Bold = true;
|
||
ws.Cell("C13").Value = "ลบ.";
|
||
ws.Cell("C13").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left;
|
||
ws.Cell("C13").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||
ws.Cell("C13").Style.Font.FontName = "TH SarabunPSK";
|
||
ws.Cell("C13").Style.Font.FontSize = 16;
|
||
ws.Cell("C13").Style.Font.Bold = true;
|
||
ws.Cell("D13").Value = "จ่ายจริง " + personnel.actually_paid_month;
|
||
ws.Cell("D13").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left;
|
||
ws.Cell("D13").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||
ws.Cell("D13").Style.Font.FontName = "TH SarabunPSK";
|
||
ws.Cell("D13").Style.Font.FontSize = 16;
|
||
ws.Cell("D13").Style.Font.Bold = true;
|
||
ws.Cell("F13").Value = personnel.actually_paid;
|
||
ws.Cell("F13").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
|
||
ws.Cell("F13").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||
ws.Cell("F13").Style.Font.FontName = "TH SarabunPSK";
|
||
ws.Cell("F13").Style.Font.FontSize = 16;
|
||
ws.Cell("F13").Style.Font.Bold = true;
|
||
ws.Cell("G13").Value = "ลบ.";
|
||
ws.Cell("G13").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left;
|
||
ws.Cell("G13").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||
ws.Cell("G13").Style.Font.FontName = "TH SarabunPSK";
|
||
ws.Cell("G13").Style.Font.FontSize = 16;
|
||
ws.Cell("G13").Style.Font.Bold = true;
|
||
ws.Cell("H13").Value = "คิดเป็นร้อยละ";
|
||
ws.Cell("H13").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
|
||
ws.Cell("H13").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||
ws.Cell("H13").Style.Font.FontName = "TH SarabunPSK";
|
||
ws.Cell("H13").Style.Font.FontSize = 16;
|
||
ws.Cell("H13").Style.Font.Bold = true;
|
||
ws.Cell("I13").Value = personnel.actually_paid_percent;
|
||
ws.Cell("I13").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left;
|
||
ws.Cell("I13").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||
ws.Cell("I13").Style.Font.FontName = "TH SarabunPSK";
|
||
ws.Cell("I13").Style.Font.FontSize = 16;
|
||
ws.Cell("I13").Style.Font.Bold = true;
|
||
ws.Cell("J13").Value = "คงเหลือ";
|
||
ws.Cell("J13").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
|
||
ws.Cell("J13").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||
ws.Cell("J13").Style.Font.FontName = "TH SarabunPSK";
|
||
ws.Cell("J13").Style.Font.FontSize = 16;
|
||
ws.Cell("J13").Style.Font.Bold = true;
|
||
ws.Cell("K13").Value = personnel.remaining_act_old2;
|
||
ws.Cell("K13").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
|
||
ws.Cell("K13").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||
ws.Cell("K13").Style.Font.FontName = "TH SarabunPSK";
|
||
ws.Cell("K13").Style.Font.FontSize = 16;
|
||
ws.Cell("K13").Style.Font.Bold = true;
|
||
ws.Cell("L13").Value = "ลบ.";
|
||
ws.Cell("L13").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left;
|
||
ws.Cell("L13").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||
ws.Cell("L13").Style.Font.FontName = "TH SarabunPSK";
|
||
ws.Cell("L13").Style.Font.FontSize = 16;
|
||
ws.Cell("L13").Style.Font.Bold = true;
|
||
ws.Cell("M13").Value = "คิดเป็นร้อยละ";
|
||
ws.Cell("M13").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left;
|
||
ws.Cell("M13").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||
ws.Cell("M13").Style.Font.FontName = "TH SarabunPSK";
|
||
ws.Cell("M13").Style.Font.FontSize = 16;
|
||
ws.Cell("M13").Style.Font.Bold = true;
|
||
ws.Cell("N13").Value = personnel.remaining_act_old2_percent;
|
||
ws.Cell("N13").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left;
|
||
ws.Cell("N13").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||
ws.Cell("N13").Style.Font.FontName = "TH SarabunPSK";
|
||
ws.Cell("N13").Style.Font.FontSize = 16;
|
||
ws.Cell("N13").Style.Font.Bold = true;
|
||
|
||
ws.Cell("A14").Value = "(ไม่รวมส่วนควบเงินเดือน)";
|
||
ws.Cell("A14").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left;
|
||
ws.Cell("A14").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||
ws.Cell("A14").Style.Font.FontName = "TH SarabunPSK";
|
||
ws.Cell("A14").Style.Font.FontSize = 16;
|
||
ws.Cell("B14").Value = personnel.not_include_salary1;
|
||
ws.Cell("B14").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
|
||
ws.Cell("B14").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||
ws.Cell("B14").Style.Font.FontName = "TH SarabunPSK";
|
||
ws.Cell("B14").Style.Font.FontSize = 16;
|
||
ws.Cell("C14").Value = "ลบ.";
|
||
ws.Cell("C14").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left;
|
||
ws.Cell("C14").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||
ws.Cell("C14").Style.Font.FontName = "TH SarabunPSK";
|
||
ws.Cell("C14").Style.Font.FontSize = 16;
|
||
ws.Cell("D14").Value = "(ไม่รวมส่วนควบเงินเดือน)";
|
||
ws.Cell("D14").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left;
|
||
ws.Cell("D14").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||
ws.Cell("D14").Style.Font.FontName = "TH SarabunPSK";
|
||
ws.Cell("D14").Style.Font.FontSize = 16;
|
||
ws.Cell("F14").Value = personnel.not_include_salary2;
|
||
ws.Cell("F14").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
|
||
ws.Cell("F14").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||
ws.Cell("F14").Style.Font.FontName = "TH SarabunPSK";
|
||
ws.Cell("F14").Style.Font.FontSize = 16;
|
||
ws.Cell("G14").Value = "ลบ.";
|
||
ws.Cell("G14").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left;
|
||
ws.Cell("G14").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||
ws.Cell("G14").Style.Font.FontName = "TH SarabunPSK";
|
||
ws.Cell("G14").Style.Font.FontSize = 16;
|
||
ws.Cell("S14").Value = "หน่วย : ล้านบาท (ทศนิยม 4 ตำแหน่ง)";
|
||
ws.Cell("S14").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
|
||
ws.Cell("S14").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||
ws.Cell("S14").Style.Font.FontName = "TH SarabunPSK";
|
||
ws.Cell("S14").Style.Font.SetBold().Font.FontSize = 16;
|
||
//ws.Range("N4:N6").Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||
// ws.Row(4).Height = 30;
|
||
// ws.Row(5).Height = 30;
|
||
// ws.Row(6).Height = 30;
|
||
ws.Column(1).Width = 30;
|
||
ws.Column(2).Width = 12;
|
||
ws.Column(3).Width = 12;
|
||
ws.Column(4).Width = 12;
|
||
ws.Column(5).Width = 12;
|
||
ws.Column(6).Width = 12;
|
||
ws.Column(7).Width = 12;
|
||
ws.Column(8).Width = 12;
|
||
ws.Column(9).Width = 12;
|
||
ws.Column(10).Width = 12;
|
||
ws.Column(11).Width = 12;
|
||
ws.Column(12).Width = 12;
|
||
ws.Column(13).Width = 12;
|
||
ws.Column(14).Width = 12;
|
||
ws.Column(15).Width = 12;
|
||
ws.Column(16).Width = 12;
|
||
ws.Column(17).Width = 40;
|
||
int row = 18;
|
||
//int no = 1;
|
||
|
||
if (personnel != null)
|
||
{
|
||
ws.Range("A15:D17").Merge().Value = "รายการ";
|
||
ws.Range("A15:D17").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||
ws.Range("A15:D17").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||
ws.Range("A15:D17").Style.Font.FontName = "TH SarabunPSK";
|
||
ws.Range("A15:D17").Style.Font.SetBold().Font.FontSize = 16;
|
||
ws.Range("A15:D17").Style.Fill.BackgroundColor = XLColor.Orange;
|
||
ws.Range("A15:D17").Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||
ws.Range("E15:F15").Merge().Value = "งปม. " + personnel.year_table1;
|
||
ws.Range("E15:F15").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||
ws.Range("E15:F15").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||
ws.Range("E15:F15").Style.Font.FontName = "TH SarabunPSK";
|
||
ws.Range("E15:F15").Style.Font.SetBold().Font.FontSize = 16;
|
||
ws.Range("E15:F15").Style.Fill.BackgroundColor = XLColor.LightGreen;
|
||
ws.Range("E15:F15").Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||
ws.Range("E16:F16").Merge().Value = "พ.ร.บ.";
|
||
ws.Range("E16:F16").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||
ws.Range("E16:F16").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||
ws.Range("E16:F16").Style.Font.FontName = "TH SarabunPSK";
|
||
ws.Range("E16:F16").Style.Font.SetBold().Font.FontSize = 16;
|
||
ws.Range("E16:F16").Style.Fill.BackgroundColor = XLColor.LightGreen;
|
||
ws.Range("E16:F16").Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||
ws.Cell("E17").Value = "อัตรา";
|
||
ws.Cell("E17").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||
ws.Cell("E17").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||
ws.Cell("E17").Style.Font.FontName = "TH SarabunPSK";
|
||
ws.Cell("E17").Style.Font.SetBold().Font.FontSize = 16;
|
||
ws.Cell("E17").Style.Fill.BackgroundColor = XLColor.LightGreen;
|
||
ws.Cell("E17").Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||
|
||
ws.Cell("F17").Value = "งบประมาณ";
|
||
ws.Cell("F17").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||
ws.Cell("F17").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||
ws.Cell("F17").Style.Font.FontName = "TH SarabunPSK";
|
||
ws.Cell("F17").Style.Font.SetBold().Font.FontSize = 16;
|
||
ws.Cell("F17").Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||
ws.Cell("F17").Style.Fill.BackgroundColor = XLColor.LightGreen;
|
||
ws.Range("G15:J15").Merge().Value = "งปม. " + personnel.year_table2 + "(จ่ายจริง " +
|
||
personnel.actually_paid_month + ")";
|
||
ws.Range("G15:J15").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||
ws.Range("G15:J15").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||
ws.Range("G15:J15").Style.Font.FontName = "TH SarabunPSK";
|
||
ws.Range("G15:J15").Style.Font.SetBold().Font.FontSize = 16;
|
||
ws.Range("G15:J15").Style.Fill.BackgroundColor = XLColor.LightBlue;
|
||
ws.Range("G15:J15").Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||
ws.Range("G16:H16").Merge().Value = "คำขอ";
|
||
ws.Range("G16:H16").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||
ws.Range("G16:H16").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||
ws.Range("G16:H16").Style.Font.FontName = "TH SarabunPSK";
|
||
ws.Range("G16:H16").Style.Font.SetBold().Font.FontSize = 16;
|
||
ws.Range("G16:H16").Style.Fill.BackgroundColor = XLColor.LightBlue;
|
||
ws.Range("G16:H16").Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||
ws.Range("I16:J16").Merge().Value = "ข้อเสนอ";
|
||
ws.Range("I16:J16").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||
ws.Range("I16:J16").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||
ws.Range("I16:J16").Style.Font.FontName = "TH SarabunPSK";
|
||
ws.Range("I16:J16").Style.Font.SetBold().Font.FontSize = 16;
|
||
ws.Range("I16:J16").Style.Fill.BackgroundColor = XLColor.LightBlue;
|
||
ws.Range("I16:J16").Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||
ws.Cell("G17").Value = "อัตรา";
|
||
ws.Cell("G17").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||
ws.Cell("G17").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||
ws.Cell("G17").Style.Font.FontName = "TH SarabunPSK";
|
||
ws.Cell("G17").Style.Font.SetBold().Font.FontSize = 16;
|
||
ws.Cell("G17").Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||
ws.Cell("G17").Style.Fill.BackgroundColor = XLColor.LightBlue;
|
||
ws.Cell("H17").Value = "งบประมาณ";
|
||
ws.Cell("H17").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||
ws.Cell("H17").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||
ws.Cell("H17").Style.Font.FontName = "TH SarabunPSK";
|
||
ws.Cell("H17").Style.Font.SetBold().Font.FontSize = 16;
|
||
ws.Cell("H17").Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||
ws.Cell("H17").Style.Fill.BackgroundColor = XLColor.LightBlue;
|
||
ws.Cell("I17").Value = "อัตรา";
|
||
ws.Cell("I17").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||
ws.Cell("I17").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||
ws.Cell("I17").Style.Font.FontName = "TH SarabunPSK";
|
||
ws.Cell("I17").Style.Font.SetBold().Font.FontSize = 16;
|
||
ws.Cell("I17").Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||
ws.Cell("I17").Style.Fill.BackgroundColor = XLColor.LightBlue;
|
||
ws.Cell("J17").Value = "งบประมาณ";
|
||
ws.Cell("J17").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||
ws.Cell("J17").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||
ws.Cell("J17").Style.Font.FontName = "TH SarabunPSK";
|
||
ws.Cell("J17").Style.Font.SetBold().Font.FontSize = 16;
|
||
ws.Cell("J17").Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||
ws.Cell("J17").Style.Fill.BackgroundColor = XLColor.LightBlue;
|
||
ws.Range("K15:P15").Merge().Value = "MTEF";
|
||
ws.Range("K15:P15").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||
ws.Range("K15:P15").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||
ws.Range("K15:P15").Style.Font.FontName = "TH SarabunPSK";
|
||
ws.Range("K15:P15").Style.Font.SetBold().Font.FontSize = 16;
|
||
ws.Range("K15:P15").Style.Fill.BackgroundColor = XLColor.LightYellow;
|
||
ws.Range("K15:P15").Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||
ws.Range("K16:L16").Merge().Value = personnel.year_table3;
|
||
ws.Range("K16:L16").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||
ws.Range("K16:L16").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||
ws.Range("K16:L16").Style.Font.FontName = "TH SarabunPSK";
|
||
ws.Range("K16:L16").Style.Font.SetBold().Font.FontSize = 16;
|
||
ws.Range("K16:L16").Style.Fill.BackgroundColor = XLColor.LightYellow;
|
||
ws.Range("K16:L16").Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||
ws.Range("M16:N16").Merge().Value = personnel.year_table4;
|
||
ws.Range("M16:N16").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||
ws.Range("M16:N16").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||
ws.Range("M16:N16").Style.Font.FontName = "TH SarabunPSK";
|
||
ws.Range("M16:N16").Style.Font.SetBold().Font.FontSize = 16;
|
||
ws.Range("M16:N16").Style.Fill.BackgroundColor = XLColor.LightYellow;
|
||
ws.Range("M16:N16").Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||
ws.Range("O16:P16").Merge().Value = personnel.year_table5;
|
||
ws.Range("O16:P16").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||
ws.Range("O16:P16").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||
ws.Range("O16:P16").Style.Font.FontName = "TH SarabunPSK";
|
||
ws.Range("O16:P16").Style.Font.SetBold().Font.FontSize = 16;
|
||
ws.Range("O16:P16").Style.Fill.BackgroundColor = XLColor.LightYellow;
|
||
ws.Range("O16:P16").Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||
ws.Cell("K17").Value = "อัตรา";
|
||
ws.Cell("K17").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||
ws.Cell("K17").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||
ws.Cell("K17").Style.Font.FontName = "TH SarabunPSK";
|
||
ws.Cell("K17").Style.Font.SetBold().Font.FontSize = 16;
|
||
ws.Cell("K17").Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||
ws.Cell("K17").Style.Fill.BackgroundColor = XLColor.LightYellow;
|
||
ws.Cell("L17").Value = "งบประมาณ";
|
||
ws.Cell("L17").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||
ws.Cell("L17").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||
ws.Cell("L17").Style.Font.FontName = "TH SarabunPSK";
|
||
ws.Cell("L17").Style.Font.SetBold().Font.FontSize = 16;
|
||
ws.Cell("L17").Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||
ws.Cell("L17").Style.Fill.BackgroundColor = XLColor.LightYellow;
|
||
ws.Cell("M17").Value = "อัตรา";
|
||
ws.Cell("M17").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||
ws.Cell("M17").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||
ws.Cell("M17").Style.Font.FontName = "TH SarabunPSK";
|
||
ws.Cell("M17").Style.Font.SetBold().Font.FontSize = 16;
|
||
ws.Cell("M17").Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||
ws.Cell("M17").Style.Fill.BackgroundColor = XLColor.LightYellow;
|
||
ws.Cell("N17").Value = "งบประมาณ";
|
||
ws.Cell("N17").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||
ws.Cell("N17").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||
ws.Cell("N17").Style.Font.FontName = "TH SarabunPSK";
|
||
ws.Cell("N17").Style.Font.SetBold().Font.FontSize = 16;
|
||
ws.Cell("N17").Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||
ws.Cell("N17").Style.Fill.BackgroundColor = XLColor.LightYellow;
|
||
ws.Cell("O17").Value = "อัตรา";
|
||
ws.Cell("O17").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||
ws.Cell("O17").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||
ws.Cell("O17").Style.Font.FontName = "TH SarabunPSK";
|
||
ws.Cell("O17").Style.Font.SetBold().Font.FontSize = 16;
|
||
ws.Cell("O17").Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||
ws.Cell("O17").Style.Fill.BackgroundColor = XLColor.LightYellow;
|
||
ws.Cell("P17").Value = "งบประมาณ";
|
||
ws.Cell("P17").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||
ws.Cell("P17").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||
ws.Cell("P17").Style.Font.FontName = "TH SarabunPSK";
|
||
ws.Cell("P17").Style.Font.SetBold().Font.FontSize = 16;
|
||
ws.Cell("P17").Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||
ws.Cell("P17").Style.Fill.BackgroundColor = XLColor.LightYellow;
|
||
ws.Range("Q15:S17").Merge().Value = "คำชี้แจง";
|
||
ws.Range("Q15:S17").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||
ws.Range("Q15:S17").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||
ws.Range("Q15:S17").Style.Font.FontName = "TH SarabunPSK";
|
||
ws.Range("Q15:S17").Style.Font.SetBold().Font.FontSize = 16;
|
||
ws.Range("Q15:S17").Style.Fill.BackgroundColor = XLColor.Orange;
|
||
ws.Range("Q15:S17").Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||
|
||
foreach (var detail in personnel.set_personnel_budget_details)
|
||
{
|
||
if (detail.is_bold == true)
|
||
{
|
||
ws.Range(ws.Cell(row, 1), ws.Cell(row, 4)).Merge().Value = detail.topic;
|
||
ws.Cell(row, 5).Value = detail.act_rate;
|
||
ws.Cell(row, 6).Value = detail.act_budget;
|
||
ws.Cell(row, 7).Value = detail.request_rate;
|
||
ws.Cell(row, 8).Value = detail.request_budget;
|
||
ws.Cell(row, 9).Value = detail.offer_rate;
|
||
ws.Cell(row, 10).Value = detail.offer_budget;
|
||
ws.Cell(row, 11).Value = detail.year1_rate;
|
||
ws.Cell(row, 12).Value = detail.year1_budget;
|
||
ws.Cell(row, 13).Value = detail.year2_rate;
|
||
ws.Cell(row, 14).Value = detail.year2_budget;
|
||
ws.Cell(row, 15).Value = detail.year3_rate;
|
||
ws.Cell(row, 16).Value = detail.year3_budget;
|
||
ws.Range(ws.Cell(row, 17), ws.Cell(row, 19)).Merge().Value = detail.remark;
|
||
|
||
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, 17)).Style.Font.FontName =
|
||
"TH SarabunPSK";
|
||
ws.Range(ws.Cell(row, 1), ws.Cell(row, 17)).Style.Font.SetBold().Font.FontSize = 16;
|
||
ws.Range(ws.Cell(row, 1), ws.Cell(row, 17)).Style.Alignment.WrapText = true;
|
||
ws.Range(ws.Cell(row, 1), ws.Cell(row, 17)).Style.Alignment.Vertical =
|
||
XLAlignmentVerticalValues.Center;
|
||
ws.Cell(row, 1).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left;
|
||
ws.Cell(row, 2).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
|
||
ws.Cell(row, 3).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
|
||
ws.Cell(row, 4).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
|
||
ws.Cell(row, 5).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
|
||
ws.Cell(row, 6).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
|
||
ws.Cell(row, 7).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
|
||
ws.Cell(row, 8).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
|
||
ws.Cell(row, 9).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
|
||
ws.Cell(row, 10).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, 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.Left;
|
||
|
||
row++;
|
||
}
|
||
|
||
if (detail.is_bold == false)
|
||
{
|
||
ws.Range(ws.Cell(row, 1), ws.Cell(row, 4)).Merge().Value = detail.topic;
|
||
ws.Cell(row, 5).Value = detail.act_rate;
|
||
ws.Cell(row, 6).Value = detail.act_budget;
|
||
ws.Cell(row, 7).Value = detail.request_rate;
|
||
ws.Cell(row, 8).Value = detail.request_budget;
|
||
ws.Cell(row, 9).Value = detail.offer_rate;
|
||
ws.Cell(row, 10).Value = detail.offer_budget;
|
||
ws.Cell(row, 11).Value = detail.year1_rate;
|
||
ws.Cell(row, 12).Value = detail.year1_budget;
|
||
ws.Cell(row, 13).Value = detail.year2_rate;
|
||
ws.Cell(row, 14).Value = detail.year2_budget;
|
||
ws.Cell(row, 15).Value = detail.year3_rate;
|
||
ws.Cell(row, 16).Value = detail.year3_budget;
|
||
ws.Range(ws.Cell(row, 17), ws.Cell(row, 19)).Merge().Value = detail.remark;
|
||
|
||
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, 17)).Style.Font.FontName =
|
||
"TH SarabunPSK";
|
||
ws.Cell(row, 1).Style.Font.FontSize = 16;
|
||
|
||
ws.Range(ws.Cell(row, 5), ws.Cell(row, 17)).Style.Font.SetBold().Font.FontSize = 16;
|
||
ws.Range(ws.Cell(row, 1), ws.Cell(row, 17)).Style.Alignment.WrapText = true;
|
||
ws.Range(ws.Cell(row, 1), ws.Cell(row, 17)).Style.Alignment.Vertical =
|
||
XLAlignmentVerticalValues.Center;
|
||
ws.Cell(row, 1).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left;
|
||
ws.Cell(row, 2).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
|
||
ws.Cell(row, 3).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
|
||
ws.Cell(row, 4).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
|
||
ws.Cell(row, 5).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
|
||
ws.Cell(row, 6).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
|
||
ws.Cell(row, 7).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
|
||
ws.Cell(row, 8).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
|
||
ws.Cell(row, 9).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
|
||
ws.Cell(row, 10).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, 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.Left;
|
||
|
||
row++;
|
||
}
|
||
}
|
||
}
|
||
|
||
using (var stream1 = new MemoryStream())
|
||
{
|
||
workbook.SaveAs(stream1);
|
||
var content = stream1.ToArray();
|
||
string date = DateTime.Now.ToString("yyyyMMddHHmmss");
|
||
return File(
|
||
content,
|
||
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
||
"personnel_" + date + ".xlsx");
|
||
}
|
||
}
|
||
}
|
||
} |