e17f2fb37c726e1353da34a5b56b48bdc1464206.svn-base 40 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using System.Data.Entity;
  5. using System.Data.Entity.Infrastructure;
  6. using System.Linq;
  7. using System.Net;
  8. using System.Web;
  9. using System.Web.Http;
  10. using System.Web.Http.Description;
  11. using iBemsDataService.Model;
  12. using iBemsDataService.Util;
  13. using DevExpress.XtraReports.UI;
  14. using System.Drawing;
  15. using System.Web.Script.Serialization;
  16. using iBemsDataService.Controllers;
  17. namespace iBemsDataService.Report
  18. {
  19. public partial class DailyReport : DevExpress.XtraReports.UI.XtraReport
  20. {
  21. private iBemsEntities db = new iBemsEntities();
  22. List<BusinessField> BusinessFieldlist = new List<BusinessField>();
  23. public int SiteId { get; set; }
  24. public String AddDate { get; set; }
  25. public String SiteName { get; set; }
  26. public int BusinessFieldId { get; set; }
  27. public String ApproverUserId { get; set; }
  28. public String ApproverUserId2 { get; set; }
  29. public String ApproverUserId3 { get; set; }
  30. public String ApproverUserId4 { get; set; }
  31. public String ApproverUserId5 { get; set; }
  32. public String ApproveDate { get; set; }
  33. public String ApproverUserIdTop = "결재자";
  34. public String ApproverUserIdTop2 = "결재자";
  35. public String ApproverUserIdTop3 = "결재자";
  36. public String ApproverUserIdTop4 = "결재자";
  37. public String ApproverUserIdTop5 = "결재자";
  38. public DailyReport()
  39. {
  40. InitializeComponent();
  41. }
  42. protected override void OnBeforePrint(System.Drawing.Printing.PrintEventArgs e)
  43. {
  44. base.OnBeforePrint(e);
  45. int year, month, day;
  46. String[] addDateArrayStr = AddDate.Split('-');
  47. if (int.TryParse(addDateArrayStr[0], out year) == false ||
  48. int.TryParse(addDateArrayStr[1], out month) == false ||
  49. int.TryParse(addDateArrayStr[2], out day) == false)
  50. {
  51. throw new Exception(string.Format("addDate Parsing Error: {0}", AddDate));
  52. }
  53. var CmSiteSource = db.CmSite
  54. .Where(a => a.SiteId == SiteId).FirstOrDefault();
  55. SiteName = CmSiteSource.Name;
  56. var dailyReport = db.FmsDailyReport
  57. .Where(a => a.SiteId == SiteId &&
  58. a.AddDate.Year == year &&
  59. a.AddDate.Month == month &&
  60. a.AddDate.Day == day &&
  61. a.BusinessFieldId == BusinessFieldId)
  62. .FirstOrDefault();
  63. if (dailyReport == null) { return; }
  64. var jsonSerialiser = new JavaScriptSerializer();
  65. DailyReportDatas dailyReportDatas = jsonSerialiser.Deserialize<DailyReportDatas>(dailyReport.Datas);
  66. //////////////
  67. if (dailyReportDatas.Approveseq != null)
  68. {
  69. string[] tempApproveseqplit = dailyReportDatas.Approveseq.Split(';');
  70. int tempcnt = tempApproveseqplit.Length;
  71. if (tempcnt > 0)
  72. {
  73. string tempName1 = tempApproveseqplit[0];
  74. var CmUser1 = db.CmUser
  75. .Where(a => a.SiteId == SiteId &&
  76. a.IsUse == true &&
  77. a.UserId == tempName1)
  78. .FirstOrDefault();
  79. var CmUserGroup1 = db.CmUserGroup
  80. .Where(a => a.SiteId == SiteId &&
  81. a.UserGroupId == CmUser1.UserGroupId)
  82. .FirstOrDefault();
  83. ApproverUserIdTop = CmUserGroup1.Name;
  84. tempcnt--;
  85. if (tempcnt > 0)
  86. {
  87. string tempName2 = tempApproveseqplit[1];
  88. var CmUser2 = db.CmUser
  89. .Where(a => a.SiteId == SiteId &&
  90. a.IsUse == true &&
  91. a.UserId == tempName2)
  92. .FirstOrDefault();
  93. var CmUserGroup2 = db.CmUserGroup
  94. .Where(a => a.SiteId == SiteId &&
  95. a.UserGroupId == CmUser2.UserGroupId)
  96. .FirstOrDefault();
  97. ApproverUserIdTop2 = CmUserGroup2.Name;
  98. tempcnt--;
  99. if (tempcnt > 0)
  100. {
  101. string tempName3 = tempApproveseqplit[2];
  102. var CmUser3 = db.CmUser
  103. .Where(a => a.SiteId == SiteId &&
  104. a.IsUse == true &&
  105. a.UserId == tempName3)
  106. .FirstOrDefault();
  107. var CmUserGroup3 = db.CmUserGroup
  108. .Where(a => a.SiteId == SiteId &&
  109. a.UserGroupId == CmUser3.UserGroupId)
  110. .FirstOrDefault();
  111. ApproverUserIdTop3 = CmUserGroup3.Name;
  112. tempcnt--;
  113. if (tempcnt > 0)
  114. {
  115. string tempName4 = tempApproveseqplit[3];
  116. var CmUser4 = db.CmUser
  117. .Where(a => a.SiteId == SiteId &&
  118. a.IsUse == true &&
  119. a.UserId == tempName4)
  120. .FirstOrDefault();
  121. var CmUserGroup4 = db.CmUserGroup
  122. .Where(a => a.SiteId == SiteId &&
  123. a.UserGroupId == CmUser4.UserGroupId)
  124. .FirstOrDefault();
  125. ApproverUserIdTop4 = CmUserGroup4.Name;
  126. tempcnt--;
  127. if (tempcnt > 0)
  128. {
  129. string tempName5 = tempApproveseqplit[4];
  130. var CmUser5 = db.CmUser
  131. .Where(a => a.SiteId == SiteId &&
  132. a.IsUse == true &&
  133. a.UserId == tempName5)
  134. .FirstOrDefault();
  135. var CmUserGroup5 = db.CmUserGroup
  136. .Where(a => a.SiteId == SiteId &&
  137. a.UserGroupId == CmUser5.UserGroupId)
  138. .FirstOrDefault();
  139. ApproverUserIdTop5 = CmUserGroup5.Name;
  140. }
  141. }
  142. }
  143. }
  144. }
  145. }
  146. var CmBusinessFieldDataSource = db.CmBusinessField
  147. .Where(a => a.SiteId == SiteId &&
  148. a.IsUse == true);
  149. if (dailyReportDatas.dataseq == null)
  150. {
  151. foreach (var deleteItem in CmBusinessFieldDataSource)
  152. {
  153. BusinessField BusinessFieldArray = new BusinessField();
  154. BusinessFieldArray.BusinessFieldId = deleteItem.BusinessFieldId;
  155. BusinessFieldArray.BusinessFieldName = deleteItem.Name;
  156. BusinessFieldlist.Add(BusinessFieldArray);
  157. }
  158. }
  159. else
  160. {
  161. var tempseqsplit = dailyReportDatas.dataseq.Split(';');
  162. for (var i = 0; i < tempseqsplit.Length; i++)
  163. {
  164. foreach (var deleteItem in CmBusinessFieldDataSource)
  165. {
  166. if (Convert.ToInt32(tempseqsplit[i]) == deleteItem.BusinessFieldId)
  167. {
  168. BusinessField BusinessFieldArray = new BusinessField();
  169. BusinessFieldArray.BusinessFieldId = deleteItem.BusinessFieldId;
  170. BusinessFieldArray.BusinessFieldName = deleteItem.Name;
  171. BusinessFieldlist.Add(BusinessFieldArray);
  172. break;
  173. }
  174. }
  175. }
  176. }
  177. SetReport(dailyReport.ApproverUserId, dailyReport.ApproverUserId2, dailyReport.ApproverUserId3, dailyReport.ApproverUserId4, dailyReport.ApproverUserId5, dailyReport.Name, dailyReport.Contents, dailyReportDatas);
  178. }
  179. public string fn(string str)
  180. {
  181. string res = str.Replace("[^0-9]", "");
  182. return res;
  183. }
  184. private void SetReport(string ApproverUserId, string ApproverUserId2, string ApproverUserId3, string ApproverUserId4, string ApproverUserId5, string Title, string Content, DailyReportDatas dailyReportDatas)
  185. {
  186. int checkcnt = 0;
  187. float[] WorkcolumnWidth = new float[] { 60f, 95f, 95f, 589f };
  188. float[] WorkcolumnenergyWidth = new float[] { 167f, 167f, 167f, 167f, 171f };
  189. String[] Workexceptions = new String[] { "WorkRequestId", "BusinessFieldId", "RequestDate" };
  190. float[] MaterialcolumnWidth = new float[] { 84f, 84f, 84f, 84f, 121f, 121f, 121f, 80f, 60f };
  191. String[] Materialexceptions = new String[] { "No", "FirstClassId", "SecondClassId", "ThirdClassId", "WorkerName" };
  192. /* 결재자 */
  193. if (dailyReportDatas.ApproveCnt == null)
  194. {
  195. int cnt = 0;
  196. if (ApproverUserId != null)
  197. {
  198. cnt++;
  199. if (ApproverUserId2 != null)
  200. {
  201. cnt++;
  202. if (ApproverUserId3 != null)
  203. {
  204. cnt++;
  205. if (ApproverUserId4 != null)
  206. {
  207. cnt++;
  208. if (ApproverUserId5 != null)
  209. {
  210. cnt++;
  211. }
  212. }
  213. }
  214. }
  215. }
  216. checkcnt = cnt;
  217. }
  218. else
  219. {
  220. checkcnt = Convert.ToInt32(dailyReportDatas.ApproveCnt);
  221. }
  222. switch (checkcnt)
  223. {
  224. case 0:
  225. checktop1.Visible = false;
  226. checkbottom1.Visible = false;
  227. checktop2.Visible = false;
  228. checkbottom2.Visible = false;
  229. checktop3.Visible = false;
  230. checkbottom3.Visible = false;
  231. checktop4.Visible = false;
  232. checkbottom4.Visible = false;
  233. checktop5.Visible = false;
  234. checkbottom5.Visible = false;
  235. break;
  236. case 1:
  237. checktop1.Visible = false;
  238. checkbottom1.Visible = false;
  239. checktop2.Visible = false;
  240. checkbottom2.Visible = false;
  241. checktop3.Visible = false;
  242. checkbottom3.Visible = false;
  243. checktop4.Visible = false;
  244. checkbottom4.Visible = false;
  245. checktop5.Text = ApproverUserIdTop;
  246. checkbottom5.Text = ApproverUserId;
  247. break;
  248. case 2:
  249. checktop1.Visible = false;
  250. checkbottom1.Visible = false;
  251. checktop2.Visible = false;
  252. checkbottom2.Visible = false;
  253. checktop3.Visible = false;
  254. checkbottom3.Visible = false;
  255. checktop4.Text = ApproverUserIdTop;
  256. checkbottom4.Text = ApproverUserId;
  257. checktop5.Text = ApproverUserIdTop2;
  258. checkbottom5.Text = ApproverUserId2;
  259. break;
  260. case 3:
  261. checktop1.Visible = false;
  262. checkbottom1.Visible = false;
  263. checktop2.Visible = false;
  264. checkbottom2.Visible = false;
  265. checktop3.Text = ApproverUserIdTop;
  266. checkbottom3.Text = ApproverUserId;
  267. checktop4.Text = ApproverUserIdTop2;
  268. checkbottom4.Text = ApproverUserId2;
  269. checktop5.Text = ApproverUserIdTop3;
  270. checkbottom5.Text = ApproverUserId3;
  271. break;
  272. case 4:
  273. checktop1.Visible = false;
  274. checkbottom1.Visible = false;
  275. checktop2.Text = ApproverUserIdTop;
  276. checkbottom2.Text = ApproverUserId;
  277. checktop3.Text = ApproverUserIdTop2;
  278. checkbottom3.Text = ApproverUserId2;
  279. checktop4.Text = ApproverUserIdTop3;
  280. checkbottom4.Text = ApproverUserId3;
  281. checktop5.Text = ApproverUserIdTop4;
  282. checkbottom5.Text = ApproverUserId4;
  283. break;
  284. case 5:
  285. checktop1.Text = ApproverUserIdTop;
  286. checkbottom1.Text = ApproverUserId;
  287. checktop2.Text = ApproverUserIdTop2;
  288. checkbottom2.Text = ApproverUserId2;
  289. checktop3.Text = ApproverUserIdTop3;
  290. checkbottom3.Text = ApproverUserId3;
  291. checktop4.Text = ApproverUserIdTop4;
  292. checkbottom4.Text = ApproverUserId4;
  293. checktop5.Text = ApproverUserIdTop5;
  294. checkbottom5.Text = ApproverUserId5;
  295. break;
  296. }
  297. /* 회사명 */
  298. xrLabelSiteName.Text = SiteName;
  299. /* 기본정보 */
  300. xrTableCellTitle.Text = Title;
  301. if (Content != null)
  302. {
  303. //var result = Content.Replace("\n", " ");
  304. xrTableCellContent.Text = Content;
  305. }
  306. xrTableCellAddDate.Text = AddDate;
  307. String[] addDateArrayStr = AddDate.Split('-');
  308. DateTime tempday = new DateTime(Convert.ToInt32(addDateArrayStr[0]), Convert.ToInt32(addDateArrayStr[1]), Convert.ToInt32(addDateArrayStr[2]));
  309. var tempstringMMDD = tempday.ToString("MM월 dd일");
  310. var tempstringMMDDbefore = tempday.AddDays(-1).ToString("MM월 dd일");
  311. var tempstringMM = tempday.ToString("MM월");
  312. today.Text = tempstringMMDD + "(금일)";
  313. beforeday.Text = tempstringMMDDbefore + "(전일)";
  314. todayusage.Text = tempstringMMDD + " 사용량";
  315. monthusage.Text = tempstringMM + " 사용량";
  316. /* 인원현황 */
  317. xrTableCellHumanResourceTotal.Text = dailyReportDatas.HumanResourceTotal;
  318. xrTableCellHumanResourceVacancy.Text = dailyReportDatas.HumanResourceVacancy;
  319. xrTableCellHumanResourceOff.Text = dailyReportDatas.HumanResourceOff;
  320. xrTableCellHumanResourceVacation.Text = dailyReportDatas.HumanResourceVacation;
  321. xrTableCellHumanResourceClosed.Text = dailyReportDatas.HumanResourceClosed;
  322. xrTableCellHumanResourceTrain.Text = dailyReportDatas.HumanResourceTrain;
  323. xrTableCellHumanResourceCurrent.Text = dailyReportDatas.HumanResourceCurrent;
  324. xrTableCellHumanResourceOut.Text = dailyReportDatas.HumanResourceOut;
  325. xrTableCellHumanResourceEtc.Text = dailyReportDatas.HumanResourceEtc;
  326. /* 작업현황 */
  327. xrTableCellWorkStatus1.Text = dailyReportDatas.WorkStatus.WorkStatusTypePeriodicInspection.ToString();
  328. xrTableCellWorkStatus2.Text = dailyReportDatas.WorkStatus.WorkStatusTypeForensicExamination.ToString();
  329. xrTableCellWorkStatus3.Text = dailyReportDatas.WorkStatus.WorkStatusTypeOccasional.ToString();
  330. xrTableCellWorkStatus4.Text = dailyReportDatas.WorkStatus.WorkStatusTypeEtc.ToString();
  331. xrTableCellWorkStatus5.Text = dailyReportDatas.WorkStatus.WorkStatusTypeTotal.ToString();
  332. xrTableCellWorkStatus6.Text = dailyReportDatas.WorkStatus.WorkStatusPending.ToString();
  333. xrTableCellWorkStatus7.Text = dailyReportDatas.WorkStatus.WorkStatusInProgress.ToString();
  334. xrTableCellWorkStatus8.Text = dailyReportDatas.WorkStatus.WorkStatusDeferred.ToString();
  335. xrTableCellWorkStatus9.Text = dailyReportDatas.WorkStatus.WorkStatusComplete.ToString();
  336. xrTableCellWorkStatus10.Text = dailyReportDatas.WorkStatus.WorkStatusApproved.ToString();
  337. xrTableCellWorkStatus11.Text = dailyReportDatas.WorkStatus.WorkStatusTotal.ToString();
  338. /* 에너지 관리 */
  339. //전기
  340. var tempList = new List<FmsEnergyDailyReport>();
  341. if (dailyReportDatas.resultEnergy1.Name != "")
  342. {
  343. tempList.Add(dailyReportDatas.resultEnergy1);
  344. }
  345. if (dailyReportDatas.resultEnergy2.Name != "")
  346. {
  347. tempList.Add(dailyReportDatas.resultEnergy2);
  348. }
  349. if (dailyReportDatas.resultEnergytotal1.Name != "")
  350. {
  351. tempList.Add(dailyReportDatas.resultEnergytotal1);
  352. }
  353. //가스
  354. if (dailyReportDatas.resultEnergy3.Name != "")
  355. {
  356. tempList.Add(dailyReportDatas.resultEnergy3);
  357. }
  358. if (dailyReportDatas.resultEnergy4.Name != "")
  359. {
  360. tempList.Add(dailyReportDatas.resultEnergy4);
  361. }
  362. if (dailyReportDatas.resultEnergy5.Name != "")
  363. {
  364. tempList.Add(dailyReportDatas.resultEnergy5);
  365. }
  366. if (dailyReportDatas.resultEnergy6.Name != "")
  367. {
  368. tempList.Add(dailyReportDatas.resultEnergy6);
  369. }
  370. if (dailyReportDatas.resultEnergy7.Name != "")
  371. {
  372. tempList.Add(dailyReportDatas.resultEnergy7);
  373. }
  374. if (dailyReportDatas.resultEnergy8.Name != "")
  375. {
  376. tempList.Add(dailyReportDatas.resultEnergy8);
  377. }
  378. if (dailyReportDatas.resultEnergy9.Name != "")
  379. {
  380. tempList.Add(dailyReportDatas.resultEnergy9);
  381. }
  382. if (dailyReportDatas.resultEnergytotal2.Name != "")
  383. {
  384. tempList.Add(dailyReportDatas.resultEnergytotal2);
  385. }
  386. if (dailyReportDatas.resultEnergytotal3.Name != "")
  387. {
  388. tempList.Add(dailyReportDatas.resultEnergytotal3);
  389. }
  390. /* 에너지관리관리 */
  391. XRTable tableEnergy = ReportTableHandler.CreateTableFromEnergyWithWidth(tempList, WorkcolumnenergyWidth);
  392. if (tableEnergy.Rows.Count > 0)
  393. {
  394. EnergyTable.Controls.Clear();
  395. EnergyTable.Controls.Add(tableEnergy);
  396. }
  397. /* 작업관리 */
  398. if (dailyReportDatas.resultWorkCommon != null && dailyReportDatas.resultWorkCommon.Count != 0)
  399. {
  400. XRTable tableCommon = ReportTableHandler.CreateTableFromListWithColumnWidth(dailyReportDatas.resultWorkCommon, WorkcolumnWidth, Workexceptions);
  401. for (var i = 0; i < BusinessFieldlist.Count(); i++)
  402. {
  403. if (BusinessFieldlist[i].BusinessFieldId == dailyReportDatas.resultWorkCommon[0].BusinessFieldId)
  404. {
  405. xrLabelcommon.Text = BusinessFieldlist[i].BusinessFieldName + " 작업관리";
  406. break;
  407. }
  408. }
  409. if (tableCommon.Rows.Count > 0)
  410. {
  411. DetailCommon.Controls.Clear();
  412. DetailCommon.Controls.Add(tableCommon);
  413. }
  414. }
  415. else
  416. {
  417. DetailReportCommon.Visible = false;
  418. }
  419. if (dailyReportDatas.resultWorkCommon1 != null && dailyReportDatas.resultWorkCommon1.Count != 0)
  420. {
  421. XRTable tableCommon1 = ReportTableHandler.CreateTableFromListWithColumnWidth(dailyReportDatas.resultWorkCommon1, WorkcolumnWidth, Workexceptions);
  422. for (var i = 0; i < BusinessFieldlist.Count(); i++)
  423. {
  424. if (BusinessFieldlist[i].BusinessFieldId == dailyReportDatas.resultWorkCommon1[0].BusinessFieldId)
  425. {
  426. xrLabelcommon1.Text = BusinessFieldlist[i].BusinessFieldName + " 작업관리";
  427. break;
  428. }
  429. }
  430. if (tableCommon1.Rows.Count > 0)
  431. {
  432. DetailCommon1.Controls.Clear();
  433. DetailCommon1.Controls.Add(tableCommon1);
  434. }
  435. }
  436. else
  437. {
  438. DetailReportCommon1.Visible = false;
  439. }
  440. if (dailyReportDatas.resultWorkCommon2 != null && dailyReportDatas.resultWorkCommon2.Count != 0)
  441. {
  442. XRTable tableCommon2 = ReportTableHandler.CreateTableFromListWithColumnWidth(dailyReportDatas.resultWorkCommon2, WorkcolumnWidth, Workexceptions);
  443. for (var i = 0; i < BusinessFieldlist.Count(); i++)
  444. {
  445. if (BusinessFieldlist[i].BusinessFieldId == dailyReportDatas.resultWorkCommon2[0].BusinessFieldId)
  446. {
  447. xrLabelcommon2.Text = BusinessFieldlist[i].BusinessFieldName + " 작업관리";
  448. break;
  449. }
  450. }
  451. if (tableCommon2.Rows.Count > 0)
  452. {
  453. DetailCommon2.Controls.Clear();
  454. DetailCommon2.Controls.Add(tableCommon2);
  455. }
  456. }
  457. else
  458. {
  459. DetailReportCommon2.Visible = false;
  460. }
  461. if (dailyReportDatas.resultWorkCommon3 != null && dailyReportDatas.resultWorkCommon3.Count != 0)
  462. {
  463. XRTable tableCommon3 = ReportTableHandler.CreateTableFromListWithColumnWidth(dailyReportDatas.resultWorkCommon3, WorkcolumnWidth, Workexceptions);
  464. for (var i = 0; i < BusinessFieldlist.Count(); i++)
  465. {
  466. if (BusinessFieldlist[i].BusinessFieldId == dailyReportDatas.resultWorkCommon3[0].BusinessFieldId)
  467. {
  468. xrLabelcommon3.Text = BusinessFieldlist[i].BusinessFieldName + " 작업관리";
  469. break;
  470. }
  471. }
  472. if (tableCommon3.Rows.Count > 0)
  473. {
  474. DetailCommon3.Controls.Clear();
  475. DetailCommon3.Controls.Add(tableCommon3);
  476. }
  477. }
  478. else
  479. {
  480. DetailReportCommon3.Visible = false;
  481. }
  482. if (dailyReportDatas.resultWorkCommon4 != null && dailyReportDatas.resultWorkCommon4.Count != 0)
  483. {
  484. XRTable tableCommon4 = ReportTableHandler.CreateTableFromListWithColumnWidth(dailyReportDatas.resultWorkCommon4, WorkcolumnWidth, Workexceptions);
  485. for (var i = 0; i < BusinessFieldlist.Count(); i++)
  486. {
  487. if (BusinessFieldlist[i].BusinessFieldId == dailyReportDatas.resultWorkCommon4[0].BusinessFieldId)
  488. {
  489. xrLabelcommon4.Text = BusinessFieldlist[i].BusinessFieldName + " 작업관리";
  490. break;
  491. }
  492. }
  493. if (tableCommon4.Rows.Count > 0)
  494. {
  495. DetailCommon4.Controls.Clear();
  496. DetailCommon4.Controls.Add(tableCommon4);
  497. }
  498. }
  499. else
  500. {
  501. DetailReportCommon4.Visible = false;
  502. }
  503. if (dailyReportDatas.resultWorkCommon5 != null && dailyReportDatas.resultWorkCommon5.Count != 0)
  504. {
  505. XRTable tableCommon5 = ReportTableHandler.CreateTableFromListWithColumnWidth(dailyReportDatas.resultWorkCommon5, WorkcolumnWidth, Workexceptions);
  506. for (var i = 0; i < BusinessFieldlist.Count(); i++)
  507. {
  508. if (BusinessFieldlist[i].BusinessFieldId == dailyReportDatas.resultWorkCommon5[0].BusinessFieldId)
  509. {
  510. xrLabelcommon5.Text = BusinessFieldlist[i].BusinessFieldName + " 작업관리";
  511. break;
  512. }
  513. }
  514. if (tableCommon5.Rows.Count > 0)
  515. {
  516. DetailCommon5.Controls.Clear();
  517. DetailCommon5.Controls.Add(tableCommon5);
  518. }
  519. }
  520. else
  521. {
  522. DetailReportCommon5.Visible = false;
  523. }
  524. if (dailyReportDatas.resultWorkCommon6 != null && dailyReportDatas.resultWorkCommon6.Count != 0)
  525. {
  526. XRTable tableCommon6 = ReportTableHandler.CreateTableFromListWithColumnWidth(dailyReportDatas.resultWorkCommon6, WorkcolumnWidth, Workexceptions);
  527. for (var i = 0; i < BusinessFieldlist.Count(); i++)
  528. {
  529. if (BusinessFieldlist[i].BusinessFieldId == dailyReportDatas.resultWorkCommon6[0].BusinessFieldId)
  530. {
  531. xrLabelcommon6.Text = BusinessFieldlist[i].BusinessFieldName + " 작업관리";
  532. break;
  533. }
  534. }
  535. if (tableCommon6.Rows.Count > 0)
  536. {
  537. DetailCommon6.Controls.Clear();
  538. DetailCommon6.Controls.Add(tableCommon6);
  539. }
  540. }
  541. else
  542. {
  543. DetailReportCommon6.Visible = false;
  544. }
  545. if (dailyReportDatas.resultWorkCommon7 != null && dailyReportDatas.resultWorkCommon7.Count != 0)
  546. {
  547. XRTable tableCommon7 = ReportTableHandler.CreateTableFromListWithColumnWidth(dailyReportDatas.resultWorkCommon7, WorkcolumnWidth, Workexceptions);
  548. for (var i = 0; i < BusinessFieldlist.Count(); i++)
  549. {
  550. if (BusinessFieldlist[i].BusinessFieldId == dailyReportDatas.resultWorkCommon7[0].BusinessFieldId)
  551. {
  552. xrLabelcommon7.Text = BusinessFieldlist[i].BusinessFieldName + " 작업관리";
  553. break;
  554. }
  555. }
  556. if (tableCommon7.Rows.Count > 0)
  557. {
  558. DetailCommon7.Controls.Clear();
  559. DetailCommon7.Controls.Add(tableCommon7);
  560. }
  561. }
  562. else
  563. {
  564. DetailReportCommon7.Visible = false;
  565. }
  566. if (dailyReportDatas.resultWorkCommon8 != null && dailyReportDatas.resultWorkCommon8.Count != 0)
  567. {
  568. XRTable tableCommon8 = ReportTableHandler.CreateTableFromListWithColumnWidth(dailyReportDatas.resultWorkCommon8, WorkcolumnWidth, Workexceptions);
  569. for (var i = 0; i < BusinessFieldlist.Count(); i++)
  570. {
  571. if (BusinessFieldlist[i].BusinessFieldId == dailyReportDatas.resultWorkCommon8[0].BusinessFieldId)
  572. {
  573. xrLabelcommon8.Text = BusinessFieldlist[i].BusinessFieldName + " 작업관리";
  574. break;
  575. }
  576. }
  577. if (tableCommon8.Rows.Count > 0)
  578. {
  579. DetailCommon8.Controls.Clear();
  580. DetailCommon8.Controls.Add(tableCommon8);
  581. }
  582. }
  583. else
  584. {
  585. DetailReportCommon8.Visible = false;
  586. }
  587. /* 자재사용내역 */
  588. if (dailyReportDatas.resultFmsMaterial != null && dailyReportDatas.resultFmsMaterial.Count() != 0)
  589. {
  590. XRTable tableFmsMaterial = ReportTableHandler.CreateTableFromListWithColumnWidthMaterial(dailyReportDatas.resultFmsMaterial, MaterialcolumnWidth, Materialexceptions);
  591. for (var i = 0; i < BusinessFieldlist.Count(); i++)
  592. {
  593. if (BusinessFieldlist[i].BusinessFieldId == dailyReportDatas.resultWorkCommon[0].BusinessFieldId)
  594. {
  595. xrLabelMaterial.Text = BusinessFieldlist[i].BusinessFieldName + " 자재사용내역";
  596. break;
  597. }
  598. }
  599. if (tableFmsMaterial.Rows.Count > 0)
  600. {
  601. DetailFmsMaterial.Controls.Clear();
  602. DetailFmsMaterial.Controls.Add(tableFmsMaterial);
  603. }
  604. }
  605. else
  606. {
  607. DetailMaterial.Visible = false;
  608. }
  609. if (dailyReportDatas.resultFmsMaterial1 != null && dailyReportDatas.resultFmsMaterial1.Count() != 0)
  610. {
  611. XRTable tableFmsMaterial1 = ReportTableHandler.CreateTableFromListWithColumnWidthMaterial(dailyReportDatas.resultFmsMaterial1, MaterialcolumnWidth, Materialexceptions);
  612. for (var i = 0; i < BusinessFieldlist.Count(); i++)
  613. {
  614. if (BusinessFieldlist[i].BusinessFieldId == dailyReportDatas.resultWorkCommon1[0].BusinessFieldId)
  615. {
  616. xrLabelMaterial1.Text = BusinessFieldlist[i].BusinessFieldName + " 자재사용내역";
  617. break;
  618. }
  619. }
  620. if (tableFmsMaterial1.Rows.Count > 0)
  621. {
  622. DetailFmsMaterial1.Controls.Clear();
  623. DetailFmsMaterial1.Controls.Add(tableFmsMaterial1);
  624. }
  625. }
  626. else
  627. {
  628. DetailMaterial1.Visible = false;
  629. }
  630. if (dailyReportDatas.resultFmsMaterial2 != null && dailyReportDatas.resultFmsMaterial2.Count() != 0)
  631. {
  632. XRTable tableFmsMaterial2 = ReportTableHandler.CreateTableFromListWithColumnWidthMaterial(dailyReportDatas.resultFmsMaterial2, MaterialcolumnWidth, Materialexceptions);
  633. for (var i = 0; i < BusinessFieldlist.Count(); i++)
  634. {
  635. if (BusinessFieldlist[i].BusinessFieldId == dailyReportDatas.resultWorkCommon2[0].BusinessFieldId)
  636. {
  637. xrLabelMaterial2.Text = BusinessFieldlist[i].BusinessFieldName + " 자재사용내역";
  638. break;
  639. }
  640. }
  641. if (tableFmsMaterial2.Rows.Count > 0)
  642. {
  643. DetailFmsMaterial2.Controls.Clear();
  644. DetailFmsMaterial2.Controls.Add(tableFmsMaterial2);
  645. }
  646. }
  647. else
  648. {
  649. DetailMaterial2.Visible = false;
  650. }
  651. if (dailyReportDatas.resultFmsMaterial3 != null && dailyReportDatas.resultFmsMaterial3.Count() != 0)
  652. {
  653. XRTable tableFmsMaterial3 = ReportTableHandler.CreateTableFromListWithColumnWidthMaterial(dailyReportDatas.resultFmsMaterial3, MaterialcolumnWidth, Materialexceptions);
  654. for (var i = 0; i < BusinessFieldlist.Count(); i++)
  655. {
  656. if (BusinessFieldlist[i].BusinessFieldId == dailyReportDatas.resultWorkCommon3[0].BusinessFieldId)
  657. {
  658. xrLabelMaterial3.Text = BusinessFieldlist[i].BusinessFieldName + " 자재사용내역";
  659. break;
  660. }
  661. }
  662. if (tableFmsMaterial3.Rows.Count > 0)
  663. {
  664. DetailFmsMaterial3.Controls.Clear();
  665. DetailFmsMaterial3.Controls.Add(tableFmsMaterial3);
  666. }
  667. }
  668. else
  669. {
  670. DetailMaterial3.Visible = false;
  671. }
  672. if (dailyReportDatas.resultFmsMaterial4 != null && dailyReportDatas.resultFmsMaterial4.Count() != 0)
  673. {
  674. XRTable tableFmsMaterial4 = ReportTableHandler.CreateTableFromListWithColumnWidthMaterial(dailyReportDatas.resultFmsMaterial4, MaterialcolumnWidth, Materialexceptions);
  675. for (var i = 0; i < BusinessFieldlist.Count(); i++)
  676. {
  677. if (BusinessFieldlist[i].BusinessFieldId == dailyReportDatas.resultWorkCommon4[0].BusinessFieldId)
  678. {
  679. xrLabelMaterial4.Text = BusinessFieldlist[i].BusinessFieldName + " 자재사용내역";
  680. break;
  681. }
  682. }
  683. if (tableFmsMaterial4.Rows.Count > 0)
  684. {
  685. DetailFmsMaterial4.Controls.Clear();
  686. DetailFmsMaterial4.Controls.Add(tableFmsMaterial4);
  687. }
  688. }
  689. else
  690. {
  691. DetailMaterial4.Visible = false;
  692. }
  693. if (dailyReportDatas.resultFmsMaterial5 != null && dailyReportDatas.resultFmsMaterial5.Count() != 0)
  694. {
  695. XRTable tableFmsMaterial5 = ReportTableHandler.CreateTableFromListWithColumnWidthMaterial(dailyReportDatas.resultFmsMaterial5, MaterialcolumnWidth, Materialexceptions);
  696. for (var i = 0; i < BusinessFieldlist.Count(); i++)
  697. {
  698. if (BusinessFieldlist[i].BusinessFieldId == dailyReportDatas.resultWorkCommon5[0].BusinessFieldId)
  699. {
  700. xrLabelMaterial5.Text = BusinessFieldlist[i].BusinessFieldName + " 자재사용내역";
  701. break;
  702. }
  703. }
  704. if (tableFmsMaterial5.Rows.Count > 0)
  705. {
  706. DetailFmsMaterial5.Controls.Clear();
  707. DetailFmsMaterial5.Controls.Add(tableFmsMaterial5);
  708. }
  709. }
  710. else
  711. {
  712. DetailMaterial5.Visible = false;
  713. }
  714. if (dailyReportDatas.resultFmsMaterial6 != null && dailyReportDatas.resultFmsMaterial6.Count() != 0)
  715. {
  716. XRTable tableFmsMaterial6 = ReportTableHandler.CreateTableFromListWithColumnWidthMaterial(dailyReportDatas.resultFmsMaterial6, MaterialcolumnWidth, Materialexceptions);
  717. for (var i = 0; i < BusinessFieldlist.Count(); i++)
  718. {
  719. if (BusinessFieldlist[i].BusinessFieldId == dailyReportDatas.resultWorkCommon6[0].BusinessFieldId)
  720. {
  721. xrLabelMaterial6.Text = BusinessFieldlist[i].BusinessFieldName + " 자재사용내역";
  722. break;
  723. }
  724. }
  725. if (tableFmsMaterial6.Rows.Count > 0)
  726. {
  727. DetailFmsMaterial6.Controls.Clear();
  728. DetailFmsMaterial6.Controls.Add(tableFmsMaterial6);
  729. }
  730. }
  731. else
  732. {
  733. DetailMaterial6.Visible = false;
  734. }
  735. if (dailyReportDatas.resultFmsMaterial7 != null && dailyReportDatas.resultFmsMaterial7.Count() != 0)
  736. {
  737. XRTable tableFmsMaterial7 = ReportTableHandler.CreateTableFromListWithColumnWidthMaterial(dailyReportDatas.resultFmsMaterial7, MaterialcolumnWidth, Materialexceptions);
  738. for (var i = 0; i < BusinessFieldlist.Count(); i++)
  739. {
  740. if (BusinessFieldlist[i].BusinessFieldId == dailyReportDatas.resultWorkCommon7[0].BusinessFieldId)
  741. {
  742. xrLabelMaterial7.Text = BusinessFieldlist[i].BusinessFieldName + " 자재사용내역";
  743. break;
  744. }
  745. }
  746. if (tableFmsMaterial7.Rows.Count > 0)
  747. {
  748. DetailFmsMaterial7.Controls.Clear();
  749. DetailFmsMaterial7.Controls.Add(tableFmsMaterial7);
  750. }
  751. }
  752. else
  753. {
  754. DetailMaterial7.Visible = false;
  755. }
  756. if (dailyReportDatas.resultFmsMaterial8 != null && dailyReportDatas.resultFmsMaterial8.Count() != 0)
  757. {
  758. XRTable tableFmsMaterial8 = ReportTableHandler.CreateTableFromListWithColumnWidthMaterial(dailyReportDatas.resultFmsMaterial8, MaterialcolumnWidth, Materialexceptions);
  759. for (var i = 0; i < BusinessFieldlist.Count(); i++)
  760. {
  761. if (BusinessFieldlist[i].BusinessFieldId == dailyReportDatas.resultWorkCommon8[0].BusinessFieldId)
  762. {
  763. xrLabelMaterial8.Text = BusinessFieldlist[i].BusinessFieldName + " 자재사용내역";
  764. break;
  765. }
  766. }
  767. if (tableFmsMaterial8.Rows.Count > 0)
  768. {
  769. DetailFmsMaterial8.Controls.Clear();
  770. DetailFmsMaterial8.Controls.Add(tableFmsMaterial8);
  771. }
  772. }
  773. else
  774. {
  775. DetailMaterial8.Visible = false;
  776. }
  777. }
  778. public class BusinessField
  779. {
  780. public int BusinessFieldId { get; set; }
  781. public string BusinessFieldName { get; set; }
  782. }
  783. public class DailyReportDatas
  784. {
  785. public String HumanResourceTotal { get; set; }
  786. public String HumanResourceVacancy { get; set; }
  787. public String HumanResourceOff { get; set; }
  788. public String HumanResourceVacation { get; set; }
  789. public String HumanResourceCurrent { get; set; }
  790. public String HumanResourceTrain { get; set; }
  791. public String HumanResourceClosed { get; set; }
  792. public String HumanResourceOut { get; set; }
  793. public String HumanResourceEtc { get; set; }
  794. public String dataseq { get; set; }
  795. public String Approveseq { get; set; }
  796. public String ApproveCnt { get; set; }
  797. public WorkStatus WorkStatus { get; set; }
  798. public FmsEnergyDailyReport resultEnergy1 { get; set; }
  799. public FmsEnergyDailyReport resultEnergy2 { get; set; }
  800. public FmsEnergyDailyReport resultEnergy3 { get; set; }
  801. public FmsEnergyDailyReport resultEnergy4 { get; set; }
  802. public FmsEnergyDailyReport resultEnergy5 { get; set; }
  803. public FmsEnergyDailyReport resultEnergy6 { get; set; }
  804. public FmsEnergyDailyReport resultEnergy7 { get; set; }
  805. public FmsEnergyDailyReport resultEnergy8 { get; set; }
  806. public FmsEnergyDailyReport resultEnergy9 { get; set; }
  807. public FmsEnergyDailyReport resultEnergytotal1 { get; set; }
  808. public FmsEnergyDailyReport resultEnergytotal2 { get; set; }
  809. public FmsEnergyDailyReport resultEnergytotal3 { get; set; }
  810. public List<FmsWorkRequestForDailyReport> resultWorkCommon { get; set; }
  811. public List<FmsMaterialForDailyReport> resultFmsMaterial { get; set; }
  812. public List<FmsWorkRequestForDailyReport> resultWorkCommon1 { get; set; }
  813. public List<FmsMaterialForDailyReport> resultFmsMaterial1 { get; set; }
  814. public List<FmsWorkRequestForDailyReport> resultWorkCommon2 { get; set; }
  815. public List<FmsMaterialForDailyReport> resultFmsMaterial2 { get; set; }
  816. public List<FmsWorkRequestForDailyReport> resultWorkCommon3 { get; set; }
  817. public List<FmsMaterialForDailyReport> resultFmsMaterial3 { get; set; }
  818. public List<FmsWorkRequestForDailyReport> resultWorkCommon4 { get; set; }
  819. public List<FmsMaterialForDailyReport> resultFmsMaterial4 { get; set; }
  820. public List<FmsWorkRequestForDailyReport> resultWorkCommon5 { get; set; }
  821. public List<FmsMaterialForDailyReport> resultFmsMaterial5 { get; set; }
  822. public List<FmsWorkRequestForDailyReport> resultWorkCommon6 { get; set; }
  823. public List<FmsMaterialForDailyReport> resultFmsMaterial6 { get; set; }
  824. public List<FmsWorkRequestForDailyReport> resultWorkCommon7 { get; set; }
  825. public List<FmsMaterialForDailyReport> resultFmsMaterial7 { get; set; }
  826. public List<FmsWorkRequestForDailyReport> resultWorkCommon8 { get; set; }
  827. public List<FmsMaterialForDailyReport> resultFmsMaterial8 { get; set; }
  828. public int FileUpload { get; set; }
  829. }
  830. }
  831. }