Merge branch 'develop' into working
This commit is contained in:
commit
81a2331821
9 changed files with 50 additions and 29 deletions
|
|
@ -893,7 +893,7 @@ namespace BMA.EHR.Application.Repositories.Reports
|
||||||
DateTh = r.Date == null ? "-" : r.Date.Value.ToThaiShortDate().ToString().ToThaiNumber(),
|
DateTh = r.Date == null ? "-" : r.Date.Value.ToThaiShortDate().ToString().ToThaiNumber(),
|
||||||
Position = p == null ? "-" : p.Name,
|
Position = p == null ? "-" : p.Name,
|
||||||
OCName = o == null || o.Parent == null ? "-" : (o.Parent.OrganizationOrganization == null ? "-" : o.Parent.OrganizationOrganization.Name),
|
OCName = o == null || o.Parent == null ? "-" : (o.Parent.OrganizationOrganization == null ? "-" : o.Parent.OrganizationOrganization.Name),
|
||||||
Age = r.Date == null ? "-" : r.Date.Value.CalculateBetweenDateV2(DateTime.Now).ToThaiNumber(),
|
Age = r.Date == null ? "-" : (r.Date.Value.Year - r.Profile.BirthDate.Year).ToNumericText().ToThaiNumber(),
|
||||||
Amount = r.Amount == null ? null : r.Amount.Value.ToNumericText().ToThaiNumber(),
|
Amount = r.Amount == null ? null : r.Amount.Value.ToNumericText().ToThaiNumber(),
|
||||||
Date = r.Date,
|
Date = r.Date,
|
||||||
Remark = "",
|
Remark = "",
|
||||||
|
|
|
||||||
|
|
@ -136,17 +136,17 @@ namespace BMA.EHR.Application.Repositories.Reports
|
||||||
remove = x.Remove,
|
remove = x.Remove,
|
||||||
profileId = x.Profile.Id,
|
profileId = x.Profile.Id,
|
||||||
citizenId = x.Profile.CitizenId,
|
citizenId = x.Profile.CitizenId,
|
||||||
prefix = x.Profile.Prefix == null ? string.Empty : x.Profile.Prefix.Name,
|
prefix = x.Profile.Prefix == null ? "" : x.Profile.Prefix.Name,
|
||||||
fullName = $"{(x.Profile.Prefix == null ? null : x.Profile.Prefix.Name)}{x.Profile.FirstName} {x.Profile.LastName}",
|
fullName = $"{(x.Profile.Prefix == null ? null : x.Profile.Prefix.Name)}{x.Profile.FirstName} {x.Profile.LastName}",
|
||||||
organizationOrganization = x.Profile.OrganizationOrganization,
|
organizationOrganization = x.Profile.OrganizationOrganization,
|
||||||
ocId = x.Profile.OcId,
|
ocId = x.Profile.OcId,
|
||||||
position = x.Profile.Position == null ? string.Empty : x.Profile.Position.Name,
|
position = x.Profile.Position == null ? "-" : x.Profile.Position.Name,
|
||||||
positionType = x.Profile.PositionType == null ? string.Empty : x.Profile.PositionType.Name,
|
positionType = x.Profile.PositionType == null ? "-" : x.Profile.PositionType.Name,
|
||||||
positionExecutive = x.Profile.PositionExecutive,
|
positionExecutive = x.Profile.PositionExecutive,
|
||||||
posNo = x.Profile.PosNo == null ? string.Empty : x.Profile.PosNo.Name,
|
posNo = x.Profile.PosNo == null ? "-" : x.Profile.PosNo.Name,
|
||||||
positionEmployeePosition = x.Profile.PositionEmployeePosition == null ? null : x.Profile.PositionEmployeePosition.Name,
|
positionEmployeePosition = x.Profile.PositionEmployeePosition == null ? "-" : x.Profile.PositionEmployeePosition.Name,
|
||||||
positionEmployeeLevel = x.Profile.PositionEmployeeLevel == null ? null : x.Profile.PositionEmployeeLevel.Name,
|
positionEmployeeLevel = x.Profile.PositionEmployeeLevel == null ? "-" : x.Profile.PositionEmployeeLevel.Name,
|
||||||
positionEmployeeGroup = x.Profile.PositionEmployeeGroup == null ? null : x.Profile.PositionEmployeeGroup.Name,
|
positionEmployeeGroup = x.Profile.PositionEmployeeGroup == null ? "-" : x.Profile.PositionEmployeeGroup.Name,
|
||||||
posNoEmployee = x.Profile.PosNoEmployee,
|
posNoEmployee = x.Profile.PosNoEmployee,
|
||||||
})
|
})
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
|
|
|
||||||
|
|
@ -124,7 +124,8 @@ namespace BMA.EHR.Insignia.Service.Controllers
|
||||||
ret = oc + "/" + ret;
|
ret = oc + "/" + ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = ret.Substring(0, ret.Length - 1);
|
if (ret.Length > 2)
|
||||||
|
ret = ret.Substring(0, ret.Length - 1);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
@ -1462,6 +1463,9 @@ namespace BMA.EHR.Insignia.Service.Controllers
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
profileInsignia.DatePayment = req.DatePayment;
|
||||||
|
profileInsignia.TypePayment = req.TypePayment;
|
||||||
|
profileInsignia.Address = req.Address;
|
||||||
if (profileInsignia.Status != "DONE")
|
if (profileInsignia.Status != "DONE")
|
||||||
{
|
{
|
||||||
profileInsignia.Issue = req.Issue;
|
profileInsignia.Issue = req.Issue;
|
||||||
|
|
@ -1472,9 +1476,9 @@ namespace BMA.EHR.Insignia.Service.Controllers
|
||||||
profileInsignia.Section = req.Section;
|
profileInsignia.Section = req.Section;
|
||||||
profileInsignia.Page = req.Page;
|
profileInsignia.Page = req.Page;
|
||||||
profileInsignia.No = req.No;
|
profileInsignia.No = req.No;
|
||||||
profileInsignia.DatePayment = req.DatePayment;
|
// profileInsignia.DatePayment = req.DatePayment;
|
||||||
profileInsignia.TypePayment = req.TypePayment;
|
// profileInsignia.TypePayment = req.TypePayment;
|
||||||
profileInsignia.Address = req.Address;
|
// profileInsignia.Address = req.Address;
|
||||||
profileInsignia.RequestInsignia = insignia;
|
profileInsignia.RequestInsignia = insignia;
|
||||||
profileInsignia.LastUpdateFullName = FullName ?? "System Administrator";
|
profileInsignia.LastUpdateFullName = FullName ?? "System Administrator";
|
||||||
profileInsignia.LastUpdateUserId = UserId ?? "";
|
profileInsignia.LastUpdateUserId = UserId ?? "";
|
||||||
|
|
|
||||||
|
|
@ -71,8 +71,6 @@ namespace BMA.EHR.Report.Service.Controllers
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "EMPLOYEE":
|
case "EMPLOYEE":
|
||||||
//reportfile = $"32-ประกาศเกษียณลูกจ้างประจำ.trdp";
|
|
||||||
//returnfile = $"ประกาศเกษียณลูกจ้าง.{exportType}";
|
|
||||||
if (string.IsNullOrEmpty(retire.GetType().GetProperty("TypeReport").GetValue(retire)))
|
if (string.IsNullOrEmpty(retire.GetType().GetProperty("TypeReport").GetValue(retire)))
|
||||||
{
|
{
|
||||||
reportfile = $"32-ประกาศเกษียณลูกจ้างประจำ-1.trdp";
|
reportfile = $"32-ประกาศเกษียณลูกจ้างประจำ-1.trdp";
|
||||||
|
|
@ -104,32 +102,50 @@ namespace BMA.EHR.Report.Service.Controllers
|
||||||
{
|
{
|
||||||
report = (Telerik.Reporting.Report)reportPacker.UnpackageDocument(sourceStream);
|
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";
|
report.ReportParameters["Type"].Value = returnfile != "ยกเลิกประกาศเกษียณข้าราชการ.pdf" && returnfile != "แก้ไขประกาศเกษียณข้าราชการ.pdf" && returnfile != "ยกเลิกประกาศเกษียณลูกจ้างประจำ.pdf" && returnfile != "แก้ไขประกาศเกษียณลูกจ้างประจำ.pdf" ? "1" : "0";
|
||||||
|
|
||||||
var _profileList = new List<dynamic>();
|
var _profileList = new List<dynamic>();
|
||||||
|
var _count=0;
|
||||||
|
var tmpOc1 = string.Empty;
|
||||||
foreach (var profile in retire.GetType().GetProperty("profile").GetValue(retire))
|
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();
|
string thaiOrder = profile.GetType().GetProperty("order").GetValue(profile).ToString();
|
||||||
thaiOrder = $"ลำดับที่ {thaiOrder.ToThaiNumber()}";
|
thaiOrder = $"ลำดับที่ {thaiOrder.ToThaiNumber()}";
|
||||||
_profileList.Add(new
|
_profileList.Add(new
|
||||||
{
|
{
|
||||||
|
count = $"{_count.ToString().ToThaiNumber()}.",
|
||||||
no = $"{(_profileList.Count() + 1).ToString().ToThaiNumber()}.",
|
no = $"{(_profileList.Count() + 1).ToString().ToThaiNumber()}.",
|
||||||
order = thaiOrder,
|
order = thaiOrder,
|
||||||
fullName = profile.GetType().GetProperty("fullName").GetValue(profile).ToString(),
|
oc = string.IsNullOrEmpty(profile.GetType().GetProperty("oc").GetValue(profile)) ? string.Empty : profile.GetType().GetProperty("oc").GetValue(profile),
|
||||||
position = profile.GetType().GetProperty("position").GetValue(profile).ToString(),
|
fullName = string.IsNullOrEmpty(profile.GetType().GetProperty("fullName").GetValue(profile)) ? string.Empty : profile.GetType().GetProperty("fullName").GetValue(profile),
|
||||||
posNo = profile.GetType().GetProperty("posNo").GetValue(profile).ToString(),
|
position = string.IsNullOrEmpty(profile.GetType().GetProperty("position").GetValue(profile)) ? string.Empty : profile.GetType().GetProperty("position").GetValue(profile),
|
||||||
organizationOrganization = profile.GetType().GetProperty("organizationOrganization").GetValue(profile).ToString(),
|
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
|
//Binding Data
|
||||||
var tblProfile = (Telerik.Reporting.Table)report.Items["detailSection1"].Items["table1"];
|
if(report.ReportParameters["Type"].Value == "1")
|
||||||
tblProfile.DataSource = _profileList;
|
{
|
||||||
|
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();
|
System.Collections.Hashtable deviceInfo = new System.Collections.Hashtable();
|
||||||
InstanceReportSource instanceReportSource = new InstanceReportSource()
|
InstanceReportSource instanceReportSource = new InstanceReportSource()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -95,7 +95,8 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
||||||
ret = oc + "/" + ret;
|
ret = oc + "/" + ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = ret.Substring(0, ret.Length - 1);
|
if (ret.Length > 2)
|
||||||
|
ret = ret.Substring(0, ret.Length - 1);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue