using System; using System.Collections; using System.Collections.Generic; using System.Data.Entity; using System.Data.Entity.Infrastructure; using System.Linq; using System.Net; using System.Web; using System.Web.Http; using System.Web.Http.Description; using iBemsDataService.Model; using iBemsDataService.Util; using DevExpress.XtraReports.UI; using System.Drawing; using System.Web.Script.Serialization; using iBemsDataService.Controllers; namespace iBemsDataService.Report { public partial class DailyReport : DevExpress.XtraReports.UI.XtraReport { private iBemsEntities db = new iBemsEntities(); List BusinessFieldlist = new List(); public int SiteId { get; set; } public String AddDate { get; set; } public String SiteName { get; set; } public int BusinessFieldId { get; set; } public String ApproverUserId { get; set; } public String ApproverUserId2 { get; set; } public String ApproverUserId3 { get; set; } public String ApproverUserId4 { get; set; } public String ApproverUserId5 { get; set; } public String ApproveDate { get; set; } public String ApproverUserIdTop = "결재자"; public String ApproverUserIdTop2 = "결재자"; public String ApproverUserIdTop3 = "결재자"; public String ApproverUserIdTop4 = "결재자"; public String ApproverUserIdTop5 = "결재자"; public DailyReport() { InitializeComponent(); } protected override void OnBeforePrint(System.Drawing.Printing.PrintEventArgs e) { base.OnBeforePrint(e); int year, month, day; String[] addDateArrayStr = AddDate.Split('-'); if (int.TryParse(addDateArrayStr[0], out year) == false || int.TryParse(addDateArrayStr[1], out month) == false || int.TryParse(addDateArrayStr[2], out day) == false) { throw new Exception(string.Format("addDate Parsing Error: {0}", AddDate)); } var CmSiteSource = db.CmSite .Where(a => a.SiteId == SiteId).FirstOrDefault(); SiteName = CmSiteSource.Name; var dailyReport = db.FmsDailyReport .Where(a => a.SiteId == SiteId && a.AddDate.Year == year && a.AddDate.Month == month && a.AddDate.Day == day && a.BusinessFieldId == BusinessFieldId) .FirstOrDefault(); if (dailyReport == null) { return; } var jsonSerialiser = new JavaScriptSerializer(); DailyReportDatas dailyReportDatas = jsonSerialiser.Deserialize(dailyReport.Datas); ////////////// if (dailyReportDatas.Approveseq != null) { string[] tempApproveseqplit = dailyReportDatas.Approveseq.Split(';'); int tempcnt = tempApproveseqplit.Length; if (tempcnt > 0) { string tempName1 = tempApproveseqplit[0]; var CmUser1 = db.CmUser .Where(a => a.SiteId == SiteId && a.IsUse == true && a.UserId == tempName1) .FirstOrDefault(); var CmUserGroup1 = db.CmUserGroup .Where(a => a.SiteId == SiteId && a.UserGroupId == CmUser1.UserGroupId) .FirstOrDefault(); ApproverUserIdTop = CmUserGroup1.Name; tempcnt--; if (tempcnt > 0) { string tempName2 = tempApproveseqplit[1]; var CmUser2 = db.CmUser .Where(a => a.SiteId == SiteId && a.IsUse == true && a.UserId == tempName2) .FirstOrDefault(); var CmUserGroup2 = db.CmUserGroup .Where(a => a.SiteId == SiteId && a.UserGroupId == CmUser2.UserGroupId) .FirstOrDefault(); ApproverUserIdTop2 = CmUserGroup2.Name; tempcnt--; if (tempcnt > 0) { string tempName3 = tempApproveseqplit[2]; var CmUser3 = db.CmUser .Where(a => a.SiteId == SiteId && a.IsUse == true && a.UserId == tempName3) .FirstOrDefault(); var CmUserGroup3 = db.CmUserGroup .Where(a => a.SiteId == SiteId && a.UserGroupId == CmUser3.UserGroupId) .FirstOrDefault(); ApproverUserIdTop3 = CmUserGroup3.Name; tempcnt--; if (tempcnt > 0) { string tempName4 = tempApproveseqplit[3]; var CmUser4 = db.CmUser .Where(a => a.SiteId == SiteId && a.IsUse == true && a.UserId == tempName4) .FirstOrDefault(); var CmUserGroup4 = db.CmUserGroup .Where(a => a.SiteId == SiteId && a.UserGroupId == CmUser4.UserGroupId) .FirstOrDefault(); ApproverUserIdTop4 = CmUserGroup4.Name; tempcnt--; if (tempcnt > 0) { string tempName5 = tempApproveseqplit[4]; var CmUser5 = db.CmUser .Where(a => a.SiteId == SiteId && a.IsUse == true && a.UserId == tempName5) .FirstOrDefault(); var CmUserGroup5 = db.CmUserGroup .Where(a => a.SiteId == SiteId && a.UserGroupId == CmUser5.UserGroupId) .FirstOrDefault(); ApproverUserIdTop5 = CmUserGroup5.Name; } } } } } } var CmBusinessFieldDataSource = db.CmBusinessField .Where(a => a.SiteId == SiteId && a.IsUse == true); if (dailyReportDatas.dataseq == null) { foreach (var deleteItem in CmBusinessFieldDataSource) { BusinessField BusinessFieldArray = new BusinessField(); BusinessFieldArray.BusinessFieldId = deleteItem.BusinessFieldId; BusinessFieldArray.BusinessFieldName = deleteItem.Name; BusinessFieldlist.Add(BusinessFieldArray); } } else { var tempseqsplit = dailyReportDatas.dataseq.Split(';'); for (var i = 0; i < tempseqsplit.Length; i++) { foreach (var deleteItem in CmBusinessFieldDataSource) { if (Convert.ToInt32(tempseqsplit[i]) == deleteItem.BusinessFieldId) { BusinessField BusinessFieldArray = new BusinessField(); BusinessFieldArray.BusinessFieldId = deleteItem.BusinessFieldId; BusinessFieldArray.BusinessFieldName = deleteItem.Name; BusinessFieldlist.Add(BusinessFieldArray); break; } } } } SetReport(dailyReport.ApproverUserId, dailyReport.ApproverUserId2, dailyReport.ApproverUserId3, dailyReport.ApproverUserId4, dailyReport.ApproverUserId5, dailyReport.Name, dailyReport.Contents, dailyReportDatas); } public string fn(string str) { string res = str.Replace("[^0-9]", ""); return res; } private void SetReport(string ApproverUserId, string ApproverUserId2, string ApproverUserId3, string ApproverUserId4, string ApproverUserId5, string Title, string Content, DailyReportDatas dailyReportDatas) { int checkcnt = 0; float[] WorkcolumnWidth = new float[] { 60f, 95f, 95f, 589f }; float[] WorkcolumnenergyWidth = new float[] { 167f, 167f, 167f, 167f, 171f }; String[] Workexceptions = new String[] { "WorkRequestId", "BusinessFieldId", "RequestDate" }; float[] MaterialcolumnWidth = new float[] { 84f, 84f, 84f, 84f, 121f, 121f, 121f, 80f, 60f }; String[] Materialexceptions = new String[] { "No", "FirstClassId", "SecondClassId", "ThirdClassId", "WorkerName" }; /* 결재자 */ if (dailyReportDatas.ApproveCnt == null) { int cnt = 0; if (ApproverUserId != null) { cnt++; if (ApproverUserId2 != null) { cnt++; if (ApproverUserId3 != null) { cnt++; if (ApproverUserId4 != null) { cnt++; if (ApproverUserId5 != null) { cnt++; } } } } } checkcnt = cnt; } else { checkcnt = Convert.ToInt32(dailyReportDatas.ApproveCnt); } switch (checkcnt) { case 0: checktop1.Visible = false; checkbottom1.Visible = false; checktop2.Visible = false; checkbottom2.Visible = false; checktop3.Visible = false; checkbottom3.Visible = false; checktop4.Visible = false; checkbottom4.Visible = false; checktop5.Visible = false; checkbottom5.Visible = false; break; case 1: checktop1.Visible = false; checkbottom1.Visible = false; checktop2.Visible = false; checkbottom2.Visible = false; checktop3.Visible = false; checkbottom3.Visible = false; checktop4.Visible = false; checkbottom4.Visible = false; checktop5.Text = ApproverUserIdTop; checkbottom5.Text = ApproverUserId; break; case 2: checktop1.Visible = false; checkbottom1.Visible = false; checktop2.Visible = false; checkbottom2.Visible = false; checktop3.Visible = false; checkbottom3.Visible = false; checktop4.Text = ApproverUserIdTop; checkbottom4.Text = ApproverUserId; checktop5.Text = ApproverUserIdTop2; checkbottom5.Text = ApproverUserId2; break; case 3: checktop1.Visible = false; checkbottom1.Visible = false; checktop2.Visible = false; checkbottom2.Visible = false; checktop3.Text = ApproverUserIdTop; checkbottom3.Text = ApproverUserId; checktop4.Text = ApproverUserIdTop2; checkbottom4.Text = ApproverUserId2; checktop5.Text = ApproverUserIdTop3; checkbottom5.Text = ApproverUserId3; break; case 4: checktop1.Visible = false; checkbottom1.Visible = false; checktop2.Text = ApproverUserIdTop; checkbottom2.Text = ApproverUserId; checktop3.Text = ApproverUserIdTop2; checkbottom3.Text = ApproverUserId2; checktop4.Text = ApproverUserIdTop3; checkbottom4.Text = ApproverUserId3; checktop5.Text = ApproverUserIdTop4; checkbottom5.Text = ApproverUserId4; break; case 5: checktop1.Text = ApproverUserIdTop; checkbottom1.Text = ApproverUserId; checktop2.Text = ApproverUserIdTop2; checkbottom2.Text = ApproverUserId2; checktop3.Text = ApproverUserIdTop3; checkbottom3.Text = ApproverUserId3; checktop4.Text = ApproverUserIdTop4; checkbottom4.Text = ApproverUserId4; checktop5.Text = ApproverUserIdTop5; checkbottom5.Text = ApproverUserId5; break; } /* 회사명 */ xrLabelSiteName.Text = SiteName; /* 기본정보 */ xrTableCellTitle.Text = Title; if (Content != null) { //var result = Content.Replace("\n", " "); xrTableCellContent.Text = Content; } xrTableCellAddDate.Text = AddDate; String[] addDateArrayStr = AddDate.Split('-'); DateTime tempday = new DateTime(Convert.ToInt32(addDateArrayStr[0]), Convert.ToInt32(addDateArrayStr[1]), Convert.ToInt32(addDateArrayStr[2])); var tempstringMMDD = tempday.ToString("MM월 dd일"); var tempstringMMDDbefore = tempday.AddDays(-1).ToString("MM월 dd일"); var tempstringMM = tempday.ToString("MM월"); today.Text = tempstringMMDD + "(금일)"; beforeday.Text = tempstringMMDDbefore + "(전일)"; todayusage.Text = tempstringMMDD + " 사용량"; monthusage.Text = tempstringMM + " 사용량"; /* 인원현황 */ xrTableCellHumanResourceTotal.Text = dailyReportDatas.HumanResourceTotal; xrTableCellHumanResourceVacancy.Text = dailyReportDatas.HumanResourceVacancy; xrTableCellHumanResourceOff.Text = dailyReportDatas.HumanResourceOff; xrTableCellHumanResourceVacation.Text = dailyReportDatas.HumanResourceVacation; xrTableCellHumanResourceClosed.Text = dailyReportDatas.HumanResourceClosed; xrTableCellHumanResourceTrain.Text = dailyReportDatas.HumanResourceTrain; xrTableCellHumanResourceCurrent.Text = dailyReportDatas.HumanResourceCurrent; xrTableCellHumanResourceOut.Text = dailyReportDatas.HumanResourceOut; xrTableCellHumanResourceEtc.Text = dailyReportDatas.HumanResourceEtc; /* 작업현황 */ xrTableCellWorkStatus1.Text = dailyReportDatas.WorkStatus.WorkStatusTypePeriodicInspection.ToString(); xrTableCellWorkStatus2.Text = dailyReportDatas.WorkStatus.WorkStatusTypeForensicExamination.ToString(); xrTableCellWorkStatus3.Text = dailyReportDatas.WorkStatus.WorkStatusTypeOccasional.ToString(); xrTableCellWorkStatus4.Text = dailyReportDatas.WorkStatus.WorkStatusTypeEtc.ToString(); xrTableCellWorkStatus5.Text = dailyReportDatas.WorkStatus.WorkStatusTypeTotal.ToString(); xrTableCellWorkStatus6.Text = dailyReportDatas.WorkStatus.WorkStatusPending.ToString(); xrTableCellWorkStatus7.Text = dailyReportDatas.WorkStatus.WorkStatusInProgress.ToString(); xrTableCellWorkStatus8.Text = dailyReportDatas.WorkStatus.WorkStatusDeferred.ToString(); xrTableCellWorkStatus9.Text = dailyReportDatas.WorkStatus.WorkStatusComplete.ToString(); xrTableCellWorkStatus10.Text = dailyReportDatas.WorkStatus.WorkStatusApproved.ToString(); xrTableCellWorkStatus11.Text = dailyReportDatas.WorkStatus.WorkStatusTotal.ToString(); /* 에너지 관리 */ //전기 var tempList = new List(); if (dailyReportDatas.resultEnergy1.Name != "") { tempList.Add(dailyReportDatas.resultEnergy1); } if (dailyReportDatas.resultEnergy2.Name != "") { tempList.Add(dailyReportDatas.resultEnergy2); } if (dailyReportDatas.resultEnergytotal1.Name != "") { tempList.Add(dailyReportDatas.resultEnergytotal1); } //가스 if (dailyReportDatas.resultEnergy3.Name != "") { tempList.Add(dailyReportDatas.resultEnergy3); } if (dailyReportDatas.resultEnergy4.Name != "") { tempList.Add(dailyReportDatas.resultEnergy4); } if (dailyReportDatas.resultEnergy5.Name != "") { tempList.Add(dailyReportDatas.resultEnergy5); } if (dailyReportDatas.resultEnergy6.Name != "") { tempList.Add(dailyReportDatas.resultEnergy6); } if (dailyReportDatas.resultEnergy7.Name != "") { tempList.Add(dailyReportDatas.resultEnergy7); } if (dailyReportDatas.resultEnergy8.Name != "") { tempList.Add(dailyReportDatas.resultEnergy8); } if (dailyReportDatas.resultEnergy9.Name != "") { tempList.Add(dailyReportDatas.resultEnergy9); } if (dailyReportDatas.resultEnergytotal2.Name != "") { tempList.Add(dailyReportDatas.resultEnergytotal2); } if (dailyReportDatas.resultEnergytotal3.Name != "") { tempList.Add(dailyReportDatas.resultEnergytotal3); } /* 에너지관리관리 */ XRTable tableEnergy = ReportTableHandler.CreateTableFromEnergyWithWidth(tempList, WorkcolumnenergyWidth); if (tableEnergy.Rows.Count > 0) { EnergyTable.Controls.Clear(); EnergyTable.Controls.Add(tableEnergy); } /* 작업관리 */ if (dailyReportDatas.resultWorkCommon != null && dailyReportDatas.resultWorkCommon.Count != 0) { XRTable tableCommon = ReportTableHandler.CreateTableFromListWithColumnWidth(dailyReportDatas.resultWorkCommon, WorkcolumnWidth, Workexceptions); for (var i = 0; i < BusinessFieldlist.Count(); i++) { if (BusinessFieldlist[i].BusinessFieldId == dailyReportDatas.resultWorkCommon[0].BusinessFieldId) { xrLabelcommon.Text = BusinessFieldlist[i].BusinessFieldName + " 작업관리"; break; } } if (tableCommon.Rows.Count > 0) { DetailCommon.Controls.Clear(); DetailCommon.Controls.Add(tableCommon); } } else { DetailReportCommon.Visible = false; } if (dailyReportDatas.resultWorkCommon1 != null && dailyReportDatas.resultWorkCommon1.Count != 0) { XRTable tableCommon1 = ReportTableHandler.CreateTableFromListWithColumnWidth(dailyReportDatas.resultWorkCommon1, WorkcolumnWidth, Workexceptions); for (var i = 0; i < BusinessFieldlist.Count(); i++) { if (BusinessFieldlist[i].BusinessFieldId == dailyReportDatas.resultWorkCommon1[0].BusinessFieldId) { xrLabelcommon1.Text = BusinessFieldlist[i].BusinessFieldName + " 작업관리"; break; } } if (tableCommon1.Rows.Count > 0) { DetailCommon1.Controls.Clear(); DetailCommon1.Controls.Add(tableCommon1); } } else { DetailReportCommon1.Visible = false; } if (dailyReportDatas.resultWorkCommon2 != null && dailyReportDatas.resultWorkCommon2.Count != 0) { XRTable tableCommon2 = ReportTableHandler.CreateTableFromListWithColumnWidth(dailyReportDatas.resultWorkCommon2, WorkcolumnWidth, Workexceptions); for (var i = 0; i < BusinessFieldlist.Count(); i++) { if (BusinessFieldlist[i].BusinessFieldId == dailyReportDatas.resultWorkCommon2[0].BusinessFieldId) { xrLabelcommon2.Text = BusinessFieldlist[i].BusinessFieldName + " 작업관리"; break; } } if (tableCommon2.Rows.Count > 0) { DetailCommon2.Controls.Clear(); DetailCommon2.Controls.Add(tableCommon2); } } else { DetailReportCommon2.Visible = false; } if (dailyReportDatas.resultWorkCommon3 != null && dailyReportDatas.resultWorkCommon3.Count != 0) { XRTable tableCommon3 = ReportTableHandler.CreateTableFromListWithColumnWidth(dailyReportDatas.resultWorkCommon3, WorkcolumnWidth, Workexceptions); for (var i = 0; i < BusinessFieldlist.Count(); i++) { if (BusinessFieldlist[i].BusinessFieldId == dailyReportDatas.resultWorkCommon3[0].BusinessFieldId) { xrLabelcommon3.Text = BusinessFieldlist[i].BusinessFieldName + " 작업관리"; break; } } if (tableCommon3.Rows.Count > 0) { DetailCommon3.Controls.Clear(); DetailCommon3.Controls.Add(tableCommon3); } } else { DetailReportCommon3.Visible = false; } if (dailyReportDatas.resultWorkCommon4 != null && dailyReportDatas.resultWorkCommon4.Count != 0) { XRTable tableCommon4 = ReportTableHandler.CreateTableFromListWithColumnWidth(dailyReportDatas.resultWorkCommon4, WorkcolumnWidth, Workexceptions); for (var i = 0; i < BusinessFieldlist.Count(); i++) { if (BusinessFieldlist[i].BusinessFieldId == dailyReportDatas.resultWorkCommon4[0].BusinessFieldId) { xrLabelcommon4.Text = BusinessFieldlist[i].BusinessFieldName + " 작업관리"; break; } } if (tableCommon4.Rows.Count > 0) { DetailCommon4.Controls.Clear(); DetailCommon4.Controls.Add(tableCommon4); } } else { DetailReportCommon4.Visible = false; } if (dailyReportDatas.resultWorkCommon5 != null && dailyReportDatas.resultWorkCommon5.Count != 0) { XRTable tableCommon5 = ReportTableHandler.CreateTableFromListWithColumnWidth(dailyReportDatas.resultWorkCommon5, WorkcolumnWidth, Workexceptions); for (var i = 0; i < BusinessFieldlist.Count(); i++) { if (BusinessFieldlist[i].BusinessFieldId == dailyReportDatas.resultWorkCommon5[0].BusinessFieldId) { xrLabelcommon5.Text = BusinessFieldlist[i].BusinessFieldName + " 작업관리"; break; } } if (tableCommon5.Rows.Count > 0) { DetailCommon5.Controls.Clear(); DetailCommon5.Controls.Add(tableCommon5); } } else { DetailReportCommon5.Visible = false; } if (dailyReportDatas.resultWorkCommon6 != null && dailyReportDatas.resultWorkCommon6.Count != 0) { XRTable tableCommon6 = ReportTableHandler.CreateTableFromListWithColumnWidth(dailyReportDatas.resultWorkCommon6, WorkcolumnWidth, Workexceptions); for (var i = 0; i < BusinessFieldlist.Count(); i++) { if (BusinessFieldlist[i].BusinessFieldId == dailyReportDatas.resultWorkCommon6[0].BusinessFieldId) { xrLabelcommon6.Text = BusinessFieldlist[i].BusinessFieldName + " 작업관리"; break; } } if (tableCommon6.Rows.Count > 0) { DetailCommon6.Controls.Clear(); DetailCommon6.Controls.Add(tableCommon6); } } else { DetailReportCommon6.Visible = false; } if (dailyReportDatas.resultWorkCommon7 != null && dailyReportDatas.resultWorkCommon7.Count != 0) { XRTable tableCommon7 = ReportTableHandler.CreateTableFromListWithColumnWidth(dailyReportDatas.resultWorkCommon7, WorkcolumnWidth, Workexceptions); for (var i = 0; i < BusinessFieldlist.Count(); i++) { if (BusinessFieldlist[i].BusinessFieldId == dailyReportDatas.resultWorkCommon7[0].BusinessFieldId) { xrLabelcommon7.Text = BusinessFieldlist[i].BusinessFieldName + " 작업관리"; break; } } if (tableCommon7.Rows.Count > 0) { DetailCommon7.Controls.Clear(); DetailCommon7.Controls.Add(tableCommon7); } } else { DetailReportCommon7.Visible = false; } if (dailyReportDatas.resultWorkCommon8 != null && dailyReportDatas.resultWorkCommon8.Count != 0) { XRTable tableCommon8 = ReportTableHandler.CreateTableFromListWithColumnWidth(dailyReportDatas.resultWorkCommon8, WorkcolumnWidth, Workexceptions); for (var i = 0; i < BusinessFieldlist.Count(); i++) { if (BusinessFieldlist[i].BusinessFieldId == dailyReportDatas.resultWorkCommon8[0].BusinessFieldId) { xrLabelcommon8.Text = BusinessFieldlist[i].BusinessFieldName + " 작업관리"; break; } } if (tableCommon8.Rows.Count > 0) { DetailCommon8.Controls.Clear(); DetailCommon8.Controls.Add(tableCommon8); } } else { DetailReportCommon8.Visible = false; } /* 자재사용내역 */ if (dailyReportDatas.resultFmsMaterial != null && dailyReportDatas.resultFmsMaterial.Count() != 0) { XRTable tableFmsMaterial = ReportTableHandler.CreateTableFromListWithColumnWidthMaterial(dailyReportDatas.resultFmsMaterial, MaterialcolumnWidth, Materialexceptions); for (var i = 0; i < BusinessFieldlist.Count(); i++) { if (BusinessFieldlist[i].BusinessFieldId == dailyReportDatas.resultWorkCommon[0].BusinessFieldId) { xrLabelMaterial.Text = BusinessFieldlist[i].BusinessFieldName + " 자재사용내역"; break; } } if (tableFmsMaterial.Rows.Count > 0) { DetailFmsMaterial.Controls.Clear(); DetailFmsMaterial.Controls.Add(tableFmsMaterial); } } else { DetailMaterial.Visible = false; } if (dailyReportDatas.resultFmsMaterial1 != null && dailyReportDatas.resultFmsMaterial1.Count() != 0) { XRTable tableFmsMaterial1 = ReportTableHandler.CreateTableFromListWithColumnWidthMaterial(dailyReportDatas.resultFmsMaterial1, MaterialcolumnWidth, Materialexceptions); for (var i = 0; i < BusinessFieldlist.Count(); i++) { if (BusinessFieldlist[i].BusinessFieldId == dailyReportDatas.resultWorkCommon1[0].BusinessFieldId) { xrLabelMaterial1.Text = BusinessFieldlist[i].BusinessFieldName + " 자재사용내역"; break; } } if (tableFmsMaterial1.Rows.Count > 0) { DetailFmsMaterial1.Controls.Clear(); DetailFmsMaterial1.Controls.Add(tableFmsMaterial1); } } else { DetailMaterial1.Visible = false; } if (dailyReportDatas.resultFmsMaterial2 != null && dailyReportDatas.resultFmsMaterial2.Count() != 0) { XRTable tableFmsMaterial2 = ReportTableHandler.CreateTableFromListWithColumnWidthMaterial(dailyReportDatas.resultFmsMaterial2, MaterialcolumnWidth, Materialexceptions); for (var i = 0; i < BusinessFieldlist.Count(); i++) { if (BusinessFieldlist[i].BusinessFieldId == dailyReportDatas.resultWorkCommon2[0].BusinessFieldId) { xrLabelMaterial2.Text = BusinessFieldlist[i].BusinessFieldName + " 자재사용내역"; break; } } if (tableFmsMaterial2.Rows.Count > 0) { DetailFmsMaterial2.Controls.Clear(); DetailFmsMaterial2.Controls.Add(tableFmsMaterial2); } } else { DetailMaterial2.Visible = false; } if (dailyReportDatas.resultFmsMaterial3 != null && dailyReportDatas.resultFmsMaterial3.Count() != 0) { XRTable tableFmsMaterial3 = ReportTableHandler.CreateTableFromListWithColumnWidthMaterial(dailyReportDatas.resultFmsMaterial3, MaterialcolumnWidth, Materialexceptions); for (var i = 0; i < BusinessFieldlist.Count(); i++) { if (BusinessFieldlist[i].BusinessFieldId == dailyReportDatas.resultWorkCommon3[0].BusinessFieldId) { xrLabelMaterial3.Text = BusinessFieldlist[i].BusinessFieldName + " 자재사용내역"; break; } } if (tableFmsMaterial3.Rows.Count > 0) { DetailFmsMaterial3.Controls.Clear(); DetailFmsMaterial3.Controls.Add(tableFmsMaterial3); } } else { DetailMaterial3.Visible = false; } if (dailyReportDatas.resultFmsMaterial4 != null && dailyReportDatas.resultFmsMaterial4.Count() != 0) { XRTable tableFmsMaterial4 = ReportTableHandler.CreateTableFromListWithColumnWidthMaterial(dailyReportDatas.resultFmsMaterial4, MaterialcolumnWidth, Materialexceptions); for (var i = 0; i < BusinessFieldlist.Count(); i++) { if (BusinessFieldlist[i].BusinessFieldId == dailyReportDatas.resultWorkCommon4[0].BusinessFieldId) { xrLabelMaterial4.Text = BusinessFieldlist[i].BusinessFieldName + " 자재사용내역"; break; } } if (tableFmsMaterial4.Rows.Count > 0) { DetailFmsMaterial4.Controls.Clear(); DetailFmsMaterial4.Controls.Add(tableFmsMaterial4); } } else { DetailMaterial4.Visible = false; } if (dailyReportDatas.resultFmsMaterial5 != null && dailyReportDatas.resultFmsMaterial5.Count() != 0) { XRTable tableFmsMaterial5 = ReportTableHandler.CreateTableFromListWithColumnWidthMaterial(dailyReportDatas.resultFmsMaterial5, MaterialcolumnWidth, Materialexceptions); for (var i = 0; i < BusinessFieldlist.Count(); i++) { if (BusinessFieldlist[i].BusinessFieldId == dailyReportDatas.resultWorkCommon5[0].BusinessFieldId) { xrLabelMaterial5.Text = BusinessFieldlist[i].BusinessFieldName + " 자재사용내역"; break; } } if (tableFmsMaterial5.Rows.Count > 0) { DetailFmsMaterial5.Controls.Clear(); DetailFmsMaterial5.Controls.Add(tableFmsMaterial5); } } else { DetailMaterial5.Visible = false; } if (dailyReportDatas.resultFmsMaterial6 != null && dailyReportDatas.resultFmsMaterial6.Count() != 0) { XRTable tableFmsMaterial6 = ReportTableHandler.CreateTableFromListWithColumnWidthMaterial(dailyReportDatas.resultFmsMaterial6, MaterialcolumnWidth, Materialexceptions); for (var i = 0; i < BusinessFieldlist.Count(); i++) { if (BusinessFieldlist[i].BusinessFieldId == dailyReportDatas.resultWorkCommon6[0].BusinessFieldId) { xrLabelMaterial6.Text = BusinessFieldlist[i].BusinessFieldName + " 자재사용내역"; break; } } if (tableFmsMaterial6.Rows.Count > 0) { DetailFmsMaterial6.Controls.Clear(); DetailFmsMaterial6.Controls.Add(tableFmsMaterial6); } } else { DetailMaterial6.Visible = false; } if (dailyReportDatas.resultFmsMaterial7 != null && dailyReportDatas.resultFmsMaterial7.Count() != 0) { XRTable tableFmsMaterial7 = ReportTableHandler.CreateTableFromListWithColumnWidthMaterial(dailyReportDatas.resultFmsMaterial7, MaterialcolumnWidth, Materialexceptions); for (var i = 0; i < BusinessFieldlist.Count(); i++) { if (BusinessFieldlist[i].BusinessFieldId == dailyReportDatas.resultWorkCommon7[0].BusinessFieldId) { xrLabelMaterial7.Text = BusinessFieldlist[i].BusinessFieldName + " 자재사용내역"; break; } } if (tableFmsMaterial7.Rows.Count > 0) { DetailFmsMaterial7.Controls.Clear(); DetailFmsMaterial7.Controls.Add(tableFmsMaterial7); } } else { DetailMaterial7.Visible = false; } if (dailyReportDatas.resultFmsMaterial8 != null && dailyReportDatas.resultFmsMaterial8.Count() != 0) { XRTable tableFmsMaterial8 = ReportTableHandler.CreateTableFromListWithColumnWidthMaterial(dailyReportDatas.resultFmsMaterial8, MaterialcolumnWidth, Materialexceptions); for (var i = 0; i < BusinessFieldlist.Count(); i++) { if (BusinessFieldlist[i].BusinessFieldId == dailyReportDatas.resultWorkCommon8[0].BusinessFieldId) { xrLabelMaterial8.Text = BusinessFieldlist[i].BusinessFieldName + " 자재사용내역"; break; } } if (tableFmsMaterial8.Rows.Count > 0) { DetailFmsMaterial8.Controls.Clear(); DetailFmsMaterial8.Controls.Add(tableFmsMaterial8); } } else { DetailMaterial8.Visible = false; } } public class BusinessField { public int BusinessFieldId { get; set; } public string BusinessFieldName { get; set; } } public class DailyReportDatas { public String HumanResourceTotal { get; set; } public String HumanResourceVacancy { get; set; } public String HumanResourceOff { get; set; } public String HumanResourceVacation { get; set; } public String HumanResourceCurrent { get; set; } public String HumanResourceTrain { get; set; } public String HumanResourceClosed { get; set; } public String HumanResourceOut { get; set; } public String HumanResourceEtc { get; set; } public String dataseq { get; set; } public String Approveseq { get; set; } public String ApproveCnt { get; set; } public WorkStatus WorkStatus { get; set; } public FmsEnergyDailyReport resultEnergy1 { get; set; } public FmsEnergyDailyReport resultEnergy2 { get; set; } public FmsEnergyDailyReport resultEnergy3 { get; set; } public FmsEnergyDailyReport resultEnergy4 { get; set; } public FmsEnergyDailyReport resultEnergy5 { get; set; } public FmsEnergyDailyReport resultEnergy6 { get; set; } public FmsEnergyDailyReport resultEnergy7 { get; set; } public FmsEnergyDailyReport resultEnergy8 { get; set; } public FmsEnergyDailyReport resultEnergy9 { get; set; } public FmsEnergyDailyReport resultEnergytotal1 { get; set; } public FmsEnergyDailyReport resultEnergytotal2 { get; set; } public FmsEnergyDailyReport resultEnergytotal3 { get; set; } public List resultWorkCommon { get; set; } public List resultFmsMaterial { get; set; } public List resultWorkCommon1 { get; set; } public List resultFmsMaterial1 { get; set; } public List resultWorkCommon2 { get; set; } public List resultFmsMaterial2 { get; set; } public List resultWorkCommon3 { get; set; } public List resultFmsMaterial3 { get; set; } public List resultWorkCommon4 { get; set; } public List resultFmsMaterial4 { get; set; } public List resultWorkCommon5 { get; set; } public List resultFmsMaterial5 { get; set; } public List resultWorkCommon6 { get; set; } public List resultFmsMaterial6 { get; set; } public List resultWorkCommon7 { get; set; } public List resultFmsMaterial7 { get; set; } public List resultWorkCommon8 { get; set; } public List resultFmsMaterial8 { get; set; } public int FileUpload { get; set; } } } }