diff --git a/BMA.EHR.Report.Service/Controllers/RetireReportController.cs b/BMA.EHR.Report.Service/Controllers/RetireReportController.cs index 327f2ac6..4e8ce7d1 100644 --- a/BMA.EHR.Report.Service/Controllers/RetireReportController.cs +++ b/BMA.EHR.Report.Service/Controllers/RetireReportController.cs @@ -71,8 +71,6 @@ namespace BMA.EHR.Report.Service.Controllers } break; case "EMPLOYEE": - //reportfile = $"32-ประกาศเกษียณลูกจ้างประจำ.trdp"; - //returnfile = $"ประกาศเกษียณลูกจ้าง.{exportType}"; if (string.IsNullOrEmpty(retire.GetType().GetProperty("TypeReport").GetValue(retire))) { reportfile = $"32-ประกาศเกษียณลูกจ้างประจำ-1.trdp"; @@ -104,32 +102,50 @@ namespace BMA.EHR.Report.Service.Controllers { report = (Telerik.Reporting.Report)reportPacker.UnpackageDocument(sourceStream); } - report.DataSource = retire; - ////Add Parameter - //report.ReportParameters["Year"].Value = retire.GetType().GetProperty("Year").GetValue(retire); - //report.ReportParameters["Total"].Value = retire.GetType().GetProperty("Total").GetValue(retire); report.ReportParameters["Type"].Value = returnfile != "ยกเลิกประกาศเกษียณข้าราชการ.pdf" && returnfile != "แก้ไขประกาศเกษียณข้าราชการ.pdf" && returnfile != "ยกเลิกประกาศเกษียณลูกจ้างประจำ.pdf" && returnfile != "แก้ไขประกาศเกษียณลูกจ้างประจำ.pdf" ? "1" : "0"; - var _profileList = new List(); - + var _count=0; + var tmpOc1 = string.Empty; foreach (var profile in retire.GetType().GetProperty("profile").GetValue(retire)) { + var tmpOc2 = profile.GetType().GetProperty("oc").GetValue(profile); + if (tmpOc1 != tmpOc2) + { + _count = 1; + tmpOc1 = tmpOc2; + } + else + { + _count++; + } string thaiOrder = profile.GetType().GetProperty("order").GetValue(profile).ToString(); thaiOrder = $"ลำดับที่ {thaiOrder.ToThaiNumber()}"; _profileList.Add(new { + count = $"{_count.ToString().ToThaiNumber()}.", no = $"{(_profileList.Count() + 1).ToString().ToThaiNumber()}.", order = thaiOrder, - fullName = profile.GetType().GetProperty("fullName").GetValue(profile).ToString(), - position = profile.GetType().GetProperty("position").GetValue(profile).ToString(), - posNo = profile.GetType().GetProperty("posNo").GetValue(profile).ToString(), - organizationOrganization = profile.GetType().GetProperty("organizationOrganization").GetValue(profile).ToString(), + oc = string.IsNullOrEmpty(profile.GetType().GetProperty("oc").GetValue(profile)) ? string.Empty : profile.GetType().GetProperty("oc").GetValue(profile), + fullName = string.IsNullOrEmpty(profile.GetType().GetProperty("fullName").GetValue(profile)) ? string.Empty : profile.GetType().GetProperty("fullName").GetValue(profile), + position = string.IsNullOrEmpty(profile.GetType().GetProperty("position").GetValue(profile)) ? string.Empty : profile.GetType().GetProperty("position").GetValue(profile), + posNo = string.IsNullOrEmpty(profile.GetType().GetProperty("posNo").GetValue(profile)) ? string.Empty : profile.GetType().GetProperty("posNo").GetValue(profile), + organizationOrganization = string.IsNullOrEmpty(profile.GetType().GetProperty("organizationOrganization").GetValue(profile)) ? string.Empty : profile.GetType().GetProperty("organizationOrganization").GetValue(profile), }); } - //Binding to Table - var tblProfile = (Telerik.Reporting.Table)report.Items["detailSection1"].Items["table1"]; - tblProfile.DataSource = _profileList; - + //Binding Data + if(report.ReportParameters["Type"].Value == "1") + { + report.ReportParameters["Year"].Value = string.IsNullOrEmpty(retire.GetType().GetProperty("Year").GetValue(retire)) ? string.Empty : retire.GetType().GetProperty("Year").GetValue(retire); + report.ReportParameters["Total"].Value = string.IsNullOrEmpty(retire.GetType().GetProperty("Total").GetValue(retire)) ? string.Empty : retire.GetType().GetProperty("Total").GetValue(retire); + report.ReportParameters["Detail"].Value = string.IsNullOrEmpty(retire.GetType().GetProperty("Detail").GetValue(retire)) ? string.Empty : retire.GetType().GetProperty("Detail").GetValue(retire); + report.DataSource = _profileList; + } + else + { + report.DataSource = retire; + var tblProfile = (Telerik.Reporting.Table)report.Items["detailSection1"].Items["table1"]; + tblProfile.DataSource = _profileList; + } System.Collections.Hashtable deviceInfo = new System.Collections.Hashtable(); InstanceReportSource instanceReportSource = new InstanceReportSource() { diff --git a/BMA.EHR.Report.Service/Reports/31-ประกาศเกษียณข้าราชการ-1.trdp b/BMA.EHR.Report.Service/Reports/31-ประกาศเกษียณข้าราชการ-1.trdp index d35970a9..6d1f4684 100644 Binary files a/BMA.EHR.Report.Service/Reports/31-ประกาศเกษียณข้าราชการ-1.trdp and b/BMA.EHR.Report.Service/Reports/31-ประกาศเกษียณข้าราชการ-1.trdp differ diff --git a/BMA.EHR.Report.Service/Reports/32-ประกาศเกษียณลูกจ้างประจำ-1.trdp b/BMA.EHR.Report.Service/Reports/32-ประกาศเกษียณลูกจ้างประจำ-1.trdp index d0cbb473..62462371 100644 Binary files a/BMA.EHR.Report.Service/Reports/32-ประกาศเกษียณลูกจ้างประจำ-1.trdp and b/BMA.EHR.Report.Service/Reports/32-ประกาศเกษียณลูกจ้างประจำ-1.trdp differ diff --git a/BMA.EHR.Report.Service/Reports/40-แบบ ขร2 บัญชีแสดงจำนวนชั้นตราเครื่องราชฯ ข้าราชการ ชั้นต่ำกว่าสายสะพาย.trdp b/BMA.EHR.Report.Service/Reports/40-แบบ ขร2 บัญชีแสดงจำนวนชั้นตราเครื่องราชฯ ข้าราชการ ชั้นต่ำกว่าสายสะพาย.trdp index 9562b094..c83e4c80 100644 Binary files a/BMA.EHR.Report.Service/Reports/40-แบบ ขร2 บัญชีแสดงจำนวนชั้นตราเครื่องราชฯ ข้าราชการ ชั้นต่ำกว่าสายสะพาย.trdp and b/BMA.EHR.Report.Service/Reports/40-แบบ ขร2 บัญชีแสดงจำนวนชั้นตราเครื่องราชฯ ข้าราชการ ชั้นต่ำกว่าสายสะพาย.trdp differ diff --git a/BMA.EHR.Report.Service/Reports/46-ประวัติสำหรับการเสนอขอพระราชทานเหรียญจักรพรรดิมาลา.trdp b/BMA.EHR.Report.Service/Reports/46-ประวัติสำหรับการเสนอขอพระราชทานเหรียญจักรพรรดิมาลา.trdp index 7a8231c9..bafebdb0 100644 Binary files a/BMA.EHR.Report.Service/Reports/46-ประวัติสำหรับการเสนอขอพระราชทานเหรียญจักรพรรดิมาลา.trdp and b/BMA.EHR.Report.Service/Reports/46-ประวัติสำหรับการเสนอขอพระราชทานเหรียญจักรพรรดิมาลา.trdp differ