123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873 |
- 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<BusinessField> BusinessFieldlist = new List<BusinessField>();
- 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<DailyReportDatas>(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<FmsEnergyDailyReport>();
- 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<FmsWorkRequestForDailyReport> resultWorkCommon { get; set; }
- public List<FmsMaterialForDailyReport> resultFmsMaterial { get; set; }
- public List<FmsWorkRequestForDailyReport> resultWorkCommon1 { get; set; }
- public List<FmsMaterialForDailyReport> resultFmsMaterial1 { get; set; }
- public List<FmsWorkRequestForDailyReport> resultWorkCommon2 { get; set; }
- public List<FmsMaterialForDailyReport> resultFmsMaterial2 { get; set; }
- public List<FmsWorkRequestForDailyReport> resultWorkCommon3 { get; set; }
- public List<FmsMaterialForDailyReport> resultFmsMaterial3 { get; set; }
- public List<FmsWorkRequestForDailyReport> resultWorkCommon4 { get; set; }
- public List<FmsMaterialForDailyReport> resultFmsMaterial4 { get; set; }
- public List<FmsWorkRequestForDailyReport> resultWorkCommon5 { get; set; }
- public List<FmsMaterialForDailyReport> resultFmsMaterial5 { get; set; }
- public List<FmsWorkRequestForDailyReport> resultWorkCommon6 { get; set; }
- public List<FmsMaterialForDailyReport> resultFmsMaterial6 { get; set; }
- public List<FmsWorkRequestForDailyReport> resultWorkCommon7 { get; set; }
- public List<FmsMaterialForDailyReport> resultFmsMaterial7 { get; set; }
- public List<FmsWorkRequestForDailyReport> resultWorkCommon8 { get; set; }
- public List<FmsMaterialForDailyReport> resultFmsMaterial8 { get; set; }
- public int FileUpload { get; set; }
- }
- }
- }
|