ProducHelper.cs 45 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981
  1. using Core.Mes.Client.Comm.Format;
  2. using Core.Mes.Client.Comm.Server;
  3. using Core.Mes.Client.Comm.Tool;
  4. using Core.StlMes.Client.PlnSaleOrd.工序排产.entity;
  5. using CoreFS.CA06;
  6. using Infragistics.Win;
  7. using Infragistics.Win.UltraWinGrid;
  8. using System;
  9. using System.Collections;
  10. using System.Collections.Generic;
  11. using System.Data;
  12. using System.Drawing;
  13. using System.Globalization;
  14. using System.Linq;
  15. using System.Text;
  16. using System.Windows.Forms;
  17. namespace Core.StlMes.Client.PlnSaleOrd.工序排产
  18. {
  19. public class ProducHelper
  20. {
  21. /// <summary>
  22. /// 查询选择记录
  23. /// </summary>
  24. /// <returns>ArrayList</returns>
  25. public static ArrayList GetChcRows<T>(UltraGrid ug)
  26. {
  27. try { ug.UpdateData(); }
  28. catch (Exception) { return null; }
  29. IQueryable<UltraGridRow> chcRows = ug.Rows.AsQueryable().Where(a => a.GetValue("CHC") == "True");
  30. if (chcRows == null || chcRows.Count() == 0)
  31. {
  32. return null;
  33. }
  34. ArrayList list = new ArrayList();
  35. foreach (UltraGridRow ugr in chcRows)
  36. {
  37. T t = (T)ugr.ListObject;
  38. list.Add(t);
  39. }
  40. return list;
  41. }
  42. public static ProducEntity GenerationProEntity(object obj, string processCode)
  43. {
  44. ProducEntity proEntity = new ProducEntity();
  45. if (processCode.Equals("B"))
  46. {
  47. Core.StlMes.Client.PlnSaleOrd.炼钢计划.entity.PlnOrderCastSEntity entity = (Core.StlMes.Client.PlnSaleOrd.炼钢计划.entity.PlnOrderCastSEntity)obj;
  48. entity.PlanTimeB = Convert.ToDateTime(entity.PlanTimeB).ToString("yyyy-MM-dd HH:mm:ss");
  49. proEntity.ProPlanId = entity.ProPlanId;
  50. proEntity.GxPlanNo = entity.GxPlanNo.ToString();
  51. proEntity.IsPlanOk = entity.IsPlanOk;
  52. proEntity.IsRepairPln = entity.IsRepairPln;
  53. proEntity.PlanNum = Convert.ToString(entity.PlanNumS - entity.PlanedNum - entity.PlanNumSold);
  54. proEntity.PlanWgt = Convert.ToString(entity.PlanWtS - entity.PlanedWt-entity.PlanWtSold);
  55. proEntity.ExeStatus = entity.ExeStatus;
  56. proEntity.PlanUseTime = Convert.ToString(entity.PlanUsetime);
  57. proEntity.GxProSeq = entity.GxProSeq.ToString();
  58. proEntity.IfStoveIssued = "";
  59. proEntity.ProMonth = entity.ProMonth;
  60. proEntity.InWeightS = Convert.ToString(entity.PlanWtS - entity.PlanedWt - entity.PlanWtSold);
  61. proEntity.InNums = Convert.ToString(entity.PlanNumS - entity.PlanedNum - entity.PlanNumSold);
  62. proEntity.Castingtype = entity.Castingtype;
  63. proEntity.WeigthSMin = Convert.ToString(entity.PlanWtMin);
  64. if (entity.PlanedNum == 0)
  65. {
  66. proEntity.FurnDz = "0";
  67. }
  68. else
  69. {
  70. proEntity.FurnDz ="1";
  71. }
  72. proEntity.JsonStr = JSONFormat.Format(entity);
  73. }
  74. else if (processCode.Equals("C"))
  75. {
  76. PlnOrderDzSEntity entity = (PlnOrderDzSEntity)obj;
  77. entity.PlanTimeB = Convert.ToDateTime(entity.PlanTimeB).ToString("yyyy-MM-dd HH:mm:ss");
  78. proEntity.ProPlanId = entity.ProPlanId;
  79. proEntity.GxPlanNo = entity.GxPlanNo;
  80. proEntity.IsPlanOk = entity.IsPlanOk;
  81. proEntity.IsRepairPln = entity.IsRepairPln;
  82. proEntity.PlanNum = Convert.ToString(entity.NumS);
  83. proEntity.PlanWgt = Convert.ToString(entity.WeigthS);
  84. proEntity.ExeStatus = entity.ExeStatus;
  85. proEntity.GxProSeq = entity.GxProSeq;
  86. proEntity.IfStoveIssued = "";
  87. proEntity.ProMonth = entity.ProMonth;
  88. proEntity.InWeightS = "0";
  89. proEntity.InNums = "0";
  90. proEntity.PlanUseTime = Convert.ToString(entity.PlanUsetime);
  91. proEntity.JsonStr = JSONFormat.Format(entity);
  92. }
  93. else if (processCode.Equals("D"))
  94. {
  95. PlnOrderZgSEntity entity = (PlnOrderZgSEntity)obj;
  96. entity.PlanTimeB = Convert.ToDateTime(entity.PlanTimeB).ToString("yyyy-MM-dd HH:mm:ss");
  97. proEntity.ProPlanId = entity.ProPlanId;
  98. proEntity.GxPlanNo = entity.GxPlanNo;
  99. proEntity.IsPlanOk = entity.IsPlanOk;
  100. proEntity.IsRepairPln = entity.IsRepairPln;
  101. proEntity.PlanNum = Convert.ToString(entity.NumS);
  102. proEntity.PlanWgt = Convert.ToString(entity.WeigthS);
  103. proEntity.ExeStatus = entity.ExeStatus;
  104. proEntity.GxProSeq = Convert.ToString(entity.GxProSeq);
  105. proEntity.IfStoveIssued = entity.IfStoveIssued;
  106. proEntity.ProMonth = entity.ProMonth;
  107. proEntity.InWeightS = entity.InWeightS.ToString();
  108. proEntity.InNums = entity.InNumS.ToString();
  109. proEntity.PlanUseTime = Convert.ToString(entity.PlanUsetime);
  110. proEntity.GpreqNum = entity.GpreqNum.ToString();
  111. proEntity.GpreqWeight = entity.GpreqWeight.ToString();
  112. proEntity.WeigthSMin = entity.WeigthSMin.ToString();
  113. proEntity.PlansNum = int.Parse(entity.PlansNum.ToString());
  114. proEntity.OrderNo = entity.OrderNo;
  115. proEntity.Memo = entity.Memo;
  116. proEntity.ProgyMemo = entity.ProgyMemo;
  117. proEntity.FurnaNum = entity.FurnaNum.ToString();
  118. proEntity.FurnaWeight = entity.FurnaWeight.ToString();
  119. proEntity.CkNum = entity.CkNum.ToString();
  120. proEntity.CkWeight = entity.CkWeight.ToString();
  121. proEntity.LjNum = entity.LjNum.ToString();
  122. proEntity.LjWeight = entity.LjWeight.ToString();
  123. proEntity.MatchNumIn = entity.MatchNumIn.ToString();
  124. proEntity.MatchWtIn = entity.MatchWtIn.ToString();
  125. proEntity.ExpectWt=entity.ExpectWt.ToString();
  126. proEntity.ExpectNum = entity.ExpectNum.ToString();
  127. proEntity.ReducedWt = entity.ReducedWt.ToString();
  128. proEntity.JsonStr = JSONFormat.Format(entity);
  129. }
  130. else if (processCode.Equals("E"))
  131. {
  132. PlnOrderDbkSEntity entity = (PlnOrderDbkSEntity)obj;
  133. entity.PlanTimeB = Convert.ToDateTime(entity.PlanTimeB).ToString("yyyy-MM-dd HH:mm:ss");
  134. proEntity.ProPlanId = entity.ProPlanId;
  135. proEntity.GxPlanNo = entity.GxPlanNo;
  136. proEntity.IsPlanOk = entity.IsPlanOk;
  137. proEntity.IsRepairPln = entity.IsRepairPln;
  138. proEntity.PlanNum = Convert.ToString(entity.NumS);
  139. proEntity.PlanWgt = Convert.ToString(entity.WeigthS);
  140. proEntity.ExeStatus = entity.ExeStatus;
  141. proEntity.GxProSeq = Convert.ToString(entity.GxProSeq);
  142. proEntity.IfStoveIssued = entity.IfStoveIssued;
  143. proEntity.InWeightS = entity.InWeightS.ToString();
  144. proEntity.InNums = entity.InNumS.ToString();
  145. proEntity.ProMonth = entity.ProMonth;
  146. proEntity.PlanUseTime = Convert.ToString(entity.PlanUsetime);
  147. proEntity.WeigthSMin = Convert.ToString(entity.MinWgt);
  148. proEntity.ExpectWt = entity.ExpectWt.ToString();
  149. proEntity.ExpectNum = entity.ExpectNum.ToString();
  150. proEntity.ReducedWt = entity.ExpectWt.ToString();
  151. proEntity.JsonStr = JSONFormat.Format(entity);
  152. }
  153. else if (processCode.Equals("F"))
  154. {
  155. PlnOrderRclSEntity entity = (PlnOrderRclSEntity)obj;
  156. entity.PlanTimeB = Convert.ToDateTime(entity.PlanTimeB).ToString("yyyy-MM-dd HH:mm:ss");
  157. proEntity.ProPlanId = entity.ProPlanId;
  158. proEntity.GxPlanNo = entity.GxPlanNo;
  159. proEntity.IsPlanOk = entity.IsPlanOk;
  160. proEntity.IsRepairPln = entity.IsRepairPln;
  161. proEntity.PlanNum = Convert.ToString(entity.NumS);
  162. proEntity.PlanWgt = Convert.ToString(entity.WeigthS);
  163. proEntity.ExeStatus = entity.ExeStatus;
  164. proEntity.GxProSeq = Convert.ToString(entity.GxProSeq);
  165. proEntity.IfStoveIssued = entity.IfStoveIssued;
  166. proEntity.ProMonth = entity.ProMonth;
  167. proEntity.InWeightS = entity.InWeightS.ToString();
  168. proEntity.InNums = entity.InNumS.ToString();
  169. proEntity.WeigthSMin = entity.WeigthSMin.ToString();
  170. proEntity.PlanUseTime = Convert.ToString(entity.PlanUsetime);
  171. proEntity.ExpectWt = entity.ExpectWt.ToString();
  172. proEntity.ExpectNum = entity.ExpectNum.ToString();
  173. proEntity.ReducedWt = entity.ExpectWt.ToString();
  174. proEntity.JsonStr = JSONFormat.Format(entity);
  175. }
  176. else if (processCode.Equals("G"))
  177. {
  178. PlnOrderJgxSEntity entity = (PlnOrderJgxSEntity)obj;
  179. entity.PlanTimeB = Convert.ToDateTime(entity.PlanTimeB).ToString("yyyy-MM-dd HH:mm:ss");
  180. proEntity.ProPlanId = entity.ProPlanId;
  181. proEntity.GxPlanNo = entity.GxPlanNo;
  182. proEntity.IsPlanOk = entity.IsPlanOk;
  183. proEntity.IsRepairPln = entity.IsRepairPln;
  184. proEntity.PlanNum = Convert.ToString(entity.NumS);
  185. proEntity.PlanWgt = Convert.ToString(entity.WeigthS);
  186. proEntity.ExeStatus = entity.ExeStatus;
  187. proEntity.GxProSeq = Convert.ToString(entity.GxProSeq);
  188. proEntity.IfStoveIssued = entity.IfStoveIssued;
  189. proEntity.ProMonth = entity.ProMonth;
  190. proEntity.InWeightS = entity.InWeightS.ToString();
  191. proEntity.InNums = entity.InNumS.ToString();
  192. proEntity.PlanUseTime = Convert.ToString(entity.PlanUsetime);
  193. proEntity.ExpectWt = entity.ExpectWtJ.ToString();
  194. proEntity.ExpectNum = entity.ExpectNumJ.ToString();
  195. proEntity.ReducedWt = entity.ExpectWtJ.ToString();
  196. proEntity.WeigthSMin = entity.InWeightS.ToString();
  197. proEntity.JsonStr = JSONFormat.Format(entity);
  198. }
  199. else if (processCode.Equals("H"))
  200. {
  201. PlnGxJgPropSEntity entity = (PlnGxJgPropSEntity)obj;
  202. entity.PlanTimeB = Convert.ToDateTime(entity.PlanTimeB).ToString("yyyy-MM-dd HH:mm:ss");
  203. proEntity.ProPlanId = entity.ProPlanId;
  204. proEntity.GxPlanNo = entity.GxPlanNo;
  205. proEntity.IsPlanOk = entity.IsPlanOk;
  206. proEntity.IsRepairPln = entity.IsRepairPln;
  207. proEntity.PlanNum = Convert.ToString(entity.GroupBlNumS);
  208. proEntity.PlanWgt = Convert.ToString(entity.GroupBlWtS);
  209. proEntity.ExeStatus = entity.ExeStatus;
  210. proEntity.GxProSeq = entity.GxProSeq;
  211. proEntity.IfStoveIssued = entity.IsStoveIssued;
  212. proEntity.ProMonth = entity.ProMonth;
  213. proEntity.InWeightS = entity.GroupBlWtS.ToString();
  214. proEntity.InNums = entity.GroupBlNumS.ToString();
  215. proEntity.ReducedWt = entity.GroupBlWtS.ToString();
  216. proEntity.WeigthSMin = entity.GroupBlWtS.ToString();
  217. proEntity.ExpectWt = entity.GroupBlWtS.ToString();
  218. proEntity.ExpectNum = entity.GroupBlNumS.ToString();
  219. proEntity.PlanUseTime = Convert.ToString(entity.PlanUsetime);
  220. proEntity.JsonStr = JSONFormat.Format(entity);
  221. }
  222. return proEntity;
  223. }
  224. /// <summary>
  225. /// 排产确认
  226. /// </summary>
  227. /// <param name="entityList">实体类集合</param>
  228. /// <param name="username">操作人</param>
  229. /// <param name="isFlag">下发标识</param>
  230. /// <param name="procesCode">工序</param>
  231. /// <param name="ob"></param>
  232. /// <returns></returns>
  233. public static bool issuedPlanOrder(ArrayList entityList, string username, string isFlag, string procesCode, OpeBase ob)
  234. {
  235. if (entityList == null || entityList.Count == 0)
  236. {
  237. MessageUtil.ShowWarning("请选择订单!");
  238. return false;
  239. }
  240. ArrayList jsonList = new ArrayList();
  241. foreach (object obj in entityList)
  242. {
  243. ProducEntity entity = ProducHelper.GenerationProEntity(obj, procesCode);
  244. if (!entity.IfStoveIssued.Equals("是") && isFlag.Equals("3"))
  245. {
  246. MessageUtil.ShowWarning("订单编号(" + entity.ProPlanId + ") 炉计划未下发!");
  247. return false;
  248. }
  249. if (entity.IfStoveIssued.Equals("是") && isFlag.Equals("2"))
  250. {
  251. MessageUtil.ShowWarning("订单编号(" + entity.ProPlanId + ") 炉计划已下发!");
  252. return false;
  253. }
  254. if (!entity.IsPlanOk.Equals("是") && isFlag.Equals("2"))
  255. {
  256. MessageUtil.ShowWarning("订单编号(" + entity.ProPlanId + ") 未确认!");
  257. return false;
  258. } if (!procesCode.Equals("B"))
  259. {
  260. if (entity.IsPlanOk.Equals("是") && isFlag.Equals("0"))
  261. {
  262. MessageUtil.ShowWarning("订单编号(" + entity.ProPlanId + ")已经确认!");
  263. return false;
  264. }
  265. if (!entity.IsPlanOk.Equals("是") && isFlag.Equals("1"))
  266. {
  267. MessageUtil.ShowWarning("订单编号(" + entity.ProPlanId + ")未确认!");
  268. return false;
  269. }
  270. }
  271. else
  272. {
  273. if (entity.IsPlanOk.Equals("是") && isFlag.Equals("0"))
  274. {
  275. MessageUtil.ShowWarning("订单编号(" + entity.ProPlanId + ")已经下发!");
  276. return false;
  277. }
  278. if (!entity.IsPlanOk.Equals("是") && isFlag.Equals("1"))
  279. {
  280. MessageUtil.ShowWarning("订单编号(" + entity.ProPlanId + ")未下发!");
  281. return false;
  282. }
  283. }
  284. jsonList.Add(entity.JsonStr);
  285. }
  286. if (procesCode.Equals("B"))
  287. {
  288. if (MessageUtil.ShowYesNoAndQuestion(isFlag.Equals("0") ? "是否下发?" : "是否取消下发?") == DialogResult.No)
  289. {
  290. return false;
  291. }
  292. }
  293. else {
  294. if (MessageUtil.ShowYesNoAndQuestion(isFlag.Equals("0") ? "是否确认?" : isFlag.Equals("1") ? "是否取消确认?" : isFlag.Equals("2") ? "是否炉计划下发?" : "是否取消炉计划下发?") == DialogResult.No)
  295. {
  296. return false;
  297. }
  298. }
  299. string[] param = PlanHelper.SetData("com.steering.pss.plnsaleord.processOrder.base.ProducHelper.issued", new object[] { jsonList, isFlag, username, procesCode }, ob);
  300. if (param == null) { MessageUtil.ShowTips("服务端处理失败!"); return false; }
  301. else
  302. {
  303. MessageUtil.ShowTips(param[1]);
  304. if ((bool.Parse(param[0]))) { return true; } else { return false; }
  305. }
  306. }
  307. /// <summary>
  308. /// 订单拆分
  309. /// </summary>
  310. /// <param name="entityList"></param>
  311. /// <param name="procesCode"></param>
  312. /// <param name="ob"></param>
  313. /// <returns></returns>
  314. public static bool SpitPlanOrder(ArrayList entityList, string procesCode, OpeBase ob)
  315. {
  316. if (entityList == null)
  317. {
  318. MessageUtil.ShowWarning("请选择订单!");
  319. return false;
  320. }
  321. if (entityList.Count > 1)
  322. {
  323. MessageUtil.ShowWarning("不能一次性拆分多条订单!");
  324. return false;
  325. }
  326. ProducEntity entity = ProducHelper.GenerationProEntity(entityList[0], procesCode);
  327. if (entity.IsRepairPln.Equals("是"))
  328. {
  329. MessageUtil.ShowTips("检修计划不能拆分!");
  330. return false;
  331. }
  332. //if (entity.IsPlanOk.Equals("是"))
  333. //{
  334. // MessageUtil.ShowWarning("订单编号(" + entity.ProPlanId + ") 已确认!");
  335. // return false;
  336. //}
  337. //if (entity.IfStoveIssued.Equals("是"))
  338. //{
  339. // MessageUtil.ShowWarning("订单编号(" + entity.ProPlanId + ") 炉计划下发!");
  340. // return false;
  341. //}
  342. if (!entity.ExeStatus.Equals("计划") && !entity.ExeStatus.Equals("生产中"))
  343. {
  344. MessageUtil.ShowTips("不是计划/生产中状态,不能拆分!");
  345. return false;
  346. }
  347. string wgt = "";
  348. string num = "";
  349. int numF = 0;
  350. if (procesCode.Equals("D"))
  351. {
  352. wgt = entity.GpreqWeight;
  353. num = entity.GpreqNum;
  354. //if (entity.LjNum.Equals("0"))
  355. //{
  356. numF = int.Parse(entity.LjNum);
  357. //}
  358. //if (entity.FurnaNum != null && !entity.FurnaNum.Equals(""))
  359. //{
  360. // numF += int.Parse(entity.FurnaNum);
  361. //}
  362. //if (entity.CkNum != null && !entity.CkNum.Equals(""))
  363. //{
  364. // numF += int.Parse(entity.CkNum);
  365. //}
  366. //if (entity.LjNum != null && !entity.LjNum.Equals(""))
  367. //{
  368. // numF += int.Parse(entity.LjNum);
  369. //}
  370. }
  371. else if (procesCode.Equals("B") || procesCode.Equals("C"))
  372. {
  373. wgt = entity.PlanWgt;
  374. num = entity.PlanNum;
  375. }
  376. else
  377. {
  378. wgt = entity.InWeightS;
  379. num = entity.InNums;
  380. }
  381. if (wgt == "")
  382. {
  383. wgt = "0";
  384. }
  385. if (num == "")
  386. {
  387. wgt = "0";
  388. }
  389. string[] param = null;
  390. if (!procesCode.Equals("D"))
  391. {
  392. if (procesCode.Equals("B"))
  393. {
  394. //重量与支数验证
  395. if (double.Parse(wgt) <= 0)//|| int.Parse(num) <= 1
  396. {
  397. MessageUtil.ShowWarning("订单编号(" + entity.ProPlanId + ")重量为0吨,支数小于或者等于1支!");
  398. return false;
  399. }
  400. //重量与支数比例
  401. double ratio = double.Parse(wgt) / int.Parse(num);
  402. FrmSpitWgt frmSpitWgt = new FrmSpitWgt(double.Parse(wgt), int.Parse(num), ratio, procesCode, numF, entity.Castingtype, entity.FurnDz);
  403. frmSpitWgt.ShowDialog();
  404. double spitWgt = frmSpitWgt.AlreadySpitWgt;
  405. int spitNum = frmSpitWgt.AlreadySpitNum;
  406. int countNum = frmSpitWgt.CountNum;
  407. if (spitWgt <= 0) { return false; }
  408. param = PlanHelper.SetData("com.steering.pss.plnsaleord.steelMarkingPlan.ControlOrderPlan.spitPlanOrder", new object[] { entity.JsonStr, spitWgt.ToString(), spitNum.ToString(), procesCode, countNum.ToString() }, ob);
  409. }
  410. else
  411. {
  412. double ratio = double.Parse(wgt) / int.Parse(num);
  413. FrmSpitWgtZg frmSpitWgtzg = new FrmSpitWgtZg(double.Parse(wgt), int.Parse(num), ratio, procesCode, numF, entity, ob);
  414. frmSpitWgtzg.ShowDialog();
  415. double spitWgt = frmSpitWgtzg.AlreadySpitWgt;
  416. int spitNum = frmSpitWgtzg.AlreadySpitNum;
  417. string heatPlanNo = frmSpitWgtzg.HeatPlanNo;
  418. if (spitWgt <= 0) { return false; }
  419. if (heatPlanNo.Equals("") && int.Parse(entity.InNums) - spitNum < numF)
  420. {
  421. MessageUtil.ShowWarning("订单编号(" + entity.ProPlanId + ")分配剩余需坯支数不能小于利库或计划支数!");
  422. return false;
  423. }
  424. param = PlanHelper.SetData("com.steering.pss.plnsaleord.processOrder.base.ProducHelper.spitPlanOrderM", new object[] { entity.JsonStr, spitWgt.ToString(), spitNum.ToString(), heatPlanNo, procesCode }, ob);
  425. //param = PlanHelper.SetData("com.steering.pss.plnsaleord.processOrder.base.ProducHelper.spitPlanOrder", new object[] { entity.JsonStr, spitWgt.ToString(), spitNum.ToString(), procesCode }, ob);
  426. }
  427. }
  428. else
  429. {
  430. double ratio = double.Parse(wgt) / int.Parse(num);
  431. FrmSpitWgtZg frmSpitWgtzg = new FrmSpitWgtZg(double.Parse(wgt), int.Parse(num), ratio, "D", numF,entity, ob);
  432. frmSpitWgtzg.ShowDialog();
  433. double spitWgt = frmSpitWgtzg.AlreadySpitWgt;
  434. int spitNum = frmSpitWgtzg.AlreadySpitNum;
  435. string heatPlanNo = frmSpitWgtzg.HeatPlanNo;
  436. if (spitWgt <= 0) { return false; }
  437. if (heatPlanNo.Equals("")&&int.Parse(entity.GpreqNum) - spitNum < numF)
  438. {
  439. MessageUtil.ShowWarning("订单编号(" + entity.ProPlanId + ")分配剩余需坯支数不能小于利库或LJ支数!");
  440. return false;
  441. }
  442. param = PlanHelper.SetData("com.steering.pss.plnsaleord.processOrder.base.ProducHelper.spitPlanOrderZg", new object[] { entity.JsonStr, spitWgt.ToString(), spitNum.ToString(), heatPlanNo }, ob);
  443. }
  444. if (param == null) { MessageUtil.ShowTips("服务端处理失败!"); return false; }
  445. else
  446. {
  447. MessageUtil.ShowTips(param[1]);
  448. if ((bool.Parse(param[0]))) { return true; } else { return false; }
  449. }
  450. }
  451. /// <summary>
  452. /// 合并订单
  453. /// </summary>
  454. /// <param name="entityList"></param>
  455. /// <param name="procesCode"></param>
  456. /// <param name="ob"></param>
  457. /// <returns></returns>
  458. public static bool MergePlanOrder(ArrayList entityList, string processCode, OpeBase ob)
  459. {
  460. if (entityList == null || entityList.Count == 1)
  461. {
  462. MessageUtil.ShowWarning("请选择多条订单!");
  463. return false;
  464. }
  465. ArrayList jsonList = new ArrayList();
  466. string proPlanId = "";
  467. foreach (object obj in entityList)
  468. {
  469. ProducEntity entity = ProducHelper.GenerationProEntity(obj, processCode);
  470. if (entity.IsRepairPln.Equals("是")||entity.IsRepairPln.Equals("Y"))
  471. {
  472. MessageUtil.ShowTips("检修计划不能合并!");
  473. return false;
  474. }
  475. if (!entity.ExeStatus.Equals("计划") && !entity.ExeStatus.Equals("生产中"))
  476. {
  477. MessageUtil.ShowTips("不是计划/生产中状态!");
  478. return false;
  479. }
  480. if (proPlanId.Equals("")) { proPlanId = entity.ProPlanId; }
  481. if (!entity.ProPlanId.Equals(proPlanId))
  482. {
  483. MessageUtil.ShowTips("相同订单编号才能合并!");
  484. return false;
  485. }
  486. if (entity.IfStoveIssued.Equals("是"))
  487. {
  488. MessageUtil.ShowWarning("订单编号(" + entity.ProPlanId + ") 炉计划下发!");
  489. return false;
  490. }
  491. //if (entity.IsPlanOk.Equals("是"))
  492. //{
  493. // MessageUtil.ShowWarning("订单编号(" + entity.ProPlanId + ") 已确认!");
  494. // return false;
  495. //}
  496. if (processCode.Equals("B"))
  497. {
  498. DataTable dt = ServerHelper.GetData("com.steering.pss.plnsaleord.steelMarkingPlan.ControlFurNacePlan.getFurnacePlnOrderProPlanId", new object[] { entity.ProPlanId, entity.GxPlanNo }, ob);
  499. if (dt.Rows.Count > 0)
  500. {
  501. MessageUtil.ShowTips("铸造订单(" + entity.ProPlanId + "/" + entity.GxPlanNo + ")已组浇,浇次为:" + dt.Rows[0]["CAST_NO"].ToString() + ",炉次为:" + dt.Rows[0]["FURNACENO"].ToString() + ",不能合并");
  502. return false;
  503. }
  504. }
  505. jsonList.Add(entity.JsonStr);
  506. }
  507. if (MessageUtil.ShowYesNoAndQuestion("是否合并?") == DialogResult.No)
  508. {
  509. return false;
  510. }
  511. string[] param = PlanHelper.SetData("com.steering.pss.plnsaleord.processOrder.base.ProducHelper.mergePlanOrder", new object[] { jsonList, processCode }, ob);
  512. if (param == null) { MessageUtil.ShowTips("服务端处理失败!"); return false; }
  513. else
  514. {
  515. MessageUtil.ShowTips(param[1]);
  516. if ((bool.Parse(param[0]))) { return true; } else { return false; }
  517. }
  518. }
  519. /// <summary>
  520. /// 排序
  521. /// </summary>
  522. /// <param name="entityList"></param>
  523. /// <param name="obj"></param>
  524. /// <param name="processCode"></param>
  525. /// <param name="ob"></param>
  526. /// <returns></returns>
  527. public static bool SortPlanOrder(ArrayList entityList, object obj, string processCode,string customInfo, OpeBase ob)
  528. { //定位行计划
  529. ProducEntity entityD = ProducHelper.GenerationProEntity(obj,processCode);
  530. if (!entityD.ExeStatus.Equals("计划")) { return false; }
  531. if (processCode.Equals("E"))
  532. {
  533. if (customInfo.Equals("1") && entityD.IfStoveIssued.Equals("1")) { return false; }
  534. }
  535. //定位行序号
  536. string gxProSeqD = entityD.GxProSeq.ToString();
  537. //移动行序号集合
  538. ArrayList seqList = new ArrayList();
  539. ArrayList list = new ArrayList();
  540. //获取数据库服务器当前时间
  541. string time = DateTime.Now.ToString("yyyy-MM");
  542. DataTable dt= ServerHelper.GetData("com.steering.pss.plnsaleord.processOrder.base.ProducHelper.selectSystemTime",null, ob);
  543. DateTimeFormatInfo dtFormat = new DateTimeFormatInfo();
  544. dtFormat.ShortDatePattern = "yyyy-MM-dd HH:mm:ss";
  545. if (dt.Rows.Count > 0)
  546. {
  547. DateTime ds1 = Convert.ToDateTime(dt.Rows[0]["DATIME"].ToString());
  548. //DateTime ds1 = Convert.ToDateTime("2021-03-26 00:00:00", dtFormat);
  549. DateTime ds2 = Convert.ToDateTime(dt.Rows[0]["DATIME"].ToString().Substring(0, 7) + "-25 21:00:00");
  550. //time = dt.Rows[0]["DATIME"].ToString().Substring(0,7);
  551. if ((ds1.CompareTo(ds2)) > 0)
  552. {
  553. time = ds1.AddMonths(1).ToString("yyyy-MM-dd HH:mm:ss").Substring(0,7);
  554. }
  555. else
  556. {
  557. time = dt.Rows[0]["DATIME"].ToString().Substring(0, 7);
  558. }
  559. }
  560. foreach (object entityM in entityList)
  561. {
  562. ProducEntity entity = ProducHelper.GenerationProEntity(entityM, processCode);
  563. //调整行只能为计划中的
  564. if (!entity.ExeStatus.Equals("计划")) { return false ; }
  565. if (processCode.Equals("E"))
  566. {
  567. if (customInfo.Equals("1") && entity.IfStoveIssued.Equals("1")) { return false; }
  568. }
  569. if (processCode.Equals("D"))
  570. {
  571. if (DateTime.Compare(Convert.ToDateTime(entity.ProMonth), Convert.ToDateTime(time)) <= 0)
  572. {
  573. if (DateTime.Compare(Convert.ToDateTime(time), Convert.ToDateTime(entityD.ProMonth)) < 0)
  574. {
  575. MessageUtil.ShowTips("所选合同:" + entity.OrderNo + ",生产年月小于等于当前日历年月,不能调整至当前日历年月之后 。");
  576. return false;
  577. }
  578. }
  579. else
  580. {
  581. if (DateTime.Compare(Convert.ToDateTime(entityD.ProMonth), Convert.ToDateTime(entity.ProMonth)) < 0)
  582. {
  583. MessageUtil.ShowTips("所选合同:" + entity.OrderNo + ",生产年月大于当前日历年月, 。");
  584. return false;
  585. }
  586. }
  587. }
  588. seqList.Add(Convert.ToInt32(entity.GxProSeq));
  589. list.Add(entity.JsonStr);
  590. }
  591. seqList.Sort();
  592. //如果鼠标坐标行在调整行的中间,则不允许调整
  593. if (Convert.ToInt32(gxProSeqD) >= (int)seqList[0] && Convert.ToInt32(gxProSeqD) <= (int)seqList[seqList.Count - 1])
  594. {
  595. return false ;
  596. }
  597. if (MessageUtil.ShowYesNoAndQuestion("是否调整生产顺序至:" + entityD.GxProSeq + "位?") == DialogResult.No)
  598. {
  599. return false ;
  600. }
  601. string[] param = PlanHelper.SetData("com.steering.pss.plnsaleord.processOrder.base.ProducHelper.sortPlanOrder", new object[] { list, entityD.JsonStr, processCode, customInfo }, ob);
  602. if (param == null) { MessageUtil.ShowTips("服务端处理失败!"); return false; }
  603. else
  604. {
  605. MessageUtil.ShowTips(param[1]);
  606. if ((bool.Parse(param[0]))) { return true; } else { return false; }
  607. }
  608. }
  609. /// <summary>
  610. /// 状态调整
  611. /// </summary>
  612. /// <param name="entityList"></param>
  613. /// <param name="processCode"></param>
  614. /// <param name="ob"></param>
  615. /// <returns></returns>
  616. public static bool StatusChange(ArrayList entityList, string processCode, OpeBase ob)
  617. {
  618. if (entityList == null || entityList.Count!=1)
  619. {
  620. MessageUtil.ShowWarning("请选择一条订单!");
  621. return false;
  622. }
  623. ProducEntity entity = ProducHelper.GenerationProEntity(entityList[0], processCode);
  624. if (MessageUtil.ShowYesNoAndQuestion("是否状态调整?") == DialogResult.No)
  625. {
  626. return false;
  627. }
  628. string[] param = PlanHelper.SetData("com.steering.pss.plnsaleord.processOrder.base.ProducHelper.statusChange", new object[] { entity.JsonStr, processCode }, ob);
  629. if (param == null) { MessageUtil.ShowTips("服务端处理失败!"); return false; }
  630. else
  631. {
  632. MessageUtil.ShowTips(param[1]);
  633. if ((bool.Parse(param[0]))) { return true; } else { return false; }
  634. }
  635. }
  636. /// <summary>
  637. /// 时间调整
  638. /// </summary>
  639. /// <param name="entityList"></param>
  640. /// <param name="processCode"></param>
  641. /// <param name="ob"></param>
  642. /// <returns></returns>
  643. public static bool TimeChange(ArrayList entityList, string processCode, OpeBase ob)
  644. {
  645. if (entityList == null || entityList.Count != 1)
  646. {
  647. MessageUtil.ShowWarning("请选择一条订单!");
  648. return false;
  649. }
  650. ProducEntity entity = ProducHelper.GenerationProEntity(entityList[0], processCode);
  651. if (!entity.ExeStatus.Equals("生产中"))
  652. {
  653. MessageUtil.ShowWarning("只有生产中的订单才能调整时间!");
  654. return false;
  655. }
  656. if (MessageUtil.ShowYesNoAndQuestion("是否时间调整?") == DialogResult.No)
  657. {
  658. return false;
  659. }
  660. string[] param = PlanHelper.SetData("com.steering.pss.plnsaleord.processOrder.base.ProducHelper.TimeChange", new object[] { entity.JsonStr, processCode }, ob);
  661. if (param == null) { MessageUtil.ShowTips("服务端处理失败!"); return false; }
  662. else
  663. {
  664. MessageUtil.ShowTips(param[1]);
  665. if ((bool.Parse(param[0]))) { return true; } else { return false; }
  666. }
  667. }
  668. /// <summary>
  669. /// 初始化数据
  670. /// </summary>
  671. /// <param name="entityList"></param>
  672. /// <param name="processCode"></param>
  673. /// <param name="ob"></param>
  674. /// <returns></returns>
  675. public static bool InitData(ArrayList entityList, string processCode, OpeBase ob)
  676. {
  677. if (entityList == null )
  678. {
  679. MessageUtil.ShowWarning("请选择订单!");
  680. return false;
  681. }
  682. ArrayList jsonlist = new ArrayList();
  683. foreach (Object obj in entityList)
  684. {
  685. ProducEntity entity = ProducHelper.GenerationProEntity(obj, processCode);
  686. //if (entity.IfStoveIssued.Equals("是"))
  687. //{
  688. // MessageUtil.ShowWarning("订单编号(" + entity.ProPlanId + ") 炉计划下发!");
  689. // return false;
  690. //}
  691. if (entity.PlanUseTime == null || entity.PlanUseTime.Equals(""))
  692. {
  693. MessageUtil.ShowWarning("计划耗时不能为空!");
  694. return false ;
  695. }
  696. jsonlist.Add(entity.JsonStr);
  697. }
  698. if (MessageUtil.ShowYesNoAndQuestion("是否初始化数据?") == DialogResult.No)
  699. {
  700. return false ;
  701. }
  702. string[] param = PlanHelper.SetData("com.steering.pss.plnsaleord.processOrder.base.ProducHelper.initData", new object[] { jsonlist, processCode }, ob);
  703. if (param == null) { MessageUtil.ShowTips("服务端处理失败!"); return false; }
  704. else
  705. {
  706. MessageUtil.ShowTips(param[1]);
  707. if ((bool.Parse(param[0]))) { return true; } else { return false; }
  708. }
  709. }
  710. /// <summary>
  711. /// 产线调整
  712. /// </summary>
  713. /// <param name="entityList"></param>
  714. /// <param name="processCode"></param>
  715. /// <param name="ob"></param>
  716. /// <returns></returns>
  717. public static bool PlineChange(ArrayList entityList, string processCode, OpeBase ob)
  718. {
  719. if (entityList == null)
  720. {
  721. MessageUtil.ShowWarning("请选择订单!");
  722. return false;
  723. }
  724. ArrayList jsonlist = new ArrayList();
  725. foreach (object obj in entityList)
  726. {
  727. ProducEntity entity = ProducHelper.GenerationProEntity(obj, processCode);
  728. //if (entity.IfStoveIssued.Equals("是"))
  729. //{
  730. // MessageUtil.ShowWarning("订单编号(" + entity.ProPlanId + ") 炉计划下发!");
  731. // return false;
  732. //}
  733. if (entity.IsRepairPln.Equals("是"))
  734. {
  735. MessageUtil.ShowTips("检修计划不能产线调整!");
  736. return false ;
  737. }
  738. if (!entity.ExeStatus.Equals("计划"))
  739. {
  740. MessageUtil.ShowTips("不是计划状态,不能产线调整!");
  741. return false ;
  742. }
  743. jsonlist.Add(entity.JsonStr);
  744. }
  745. if (MessageUtil.ShowYesNoAndQuestion("是否产线调整?") == DialogResult.No)
  746. {
  747. return false ;
  748. }
  749. string[] param = PlanHelper.SetData("com.steering.pss.plnsaleord.processOrder.base.ProducHelper.plineChange", new object[] { jsonlist, processCode }, ob);
  750. if (param == null) { MessageUtil.ShowTips("服务端处理失败!"); return false; }
  751. else
  752. {
  753. MessageUtil.ShowTips(param[1]);
  754. if ((bool.Parse(param[0]))) { return true; } else { return false; }
  755. }
  756. }
  757. /// <summary>
  758. /// 删除检修
  759. /// </summary>
  760. /// <param name="entityList"></param>
  761. /// <param name="processCode"></param>
  762. /// <param name="ob"></param>
  763. /// <returns></returns>
  764. public static bool DeleteRepairPlan(ArrayList entityList, string processCode, OpeBase ob)
  765. {
  766. if (entityList == null)
  767. {
  768. MessageUtil.ShowWarning("请选择检修订单!");
  769. return false;
  770. }
  771. ArrayList jsonlist = new ArrayList();
  772. foreach (Object obj in entityList)
  773. {
  774. ProducEntity entity = ProducHelper.GenerationProEntity(obj, processCode);
  775. if (entity.IfStoveIssued.Equals("是"))
  776. {
  777. MessageUtil.ShowWarning("订单编号(" + entity.ProPlanId + ") 炉计划下发!");
  778. return false;
  779. }
  780. if (!entity.IsRepairPln.Equals("是"))
  781. {
  782. MessageUtil.ShowWarning("不是检修计划,不能删除!");
  783. return false ;
  784. }
  785. if (!entity.ExeStatus.Equals("计划"))
  786. {
  787. MessageUtil.ShowWarning("检修计划不是计划状态,不能删除!");
  788. return false ;
  789. }
  790. jsonlist.Add(entity.JsonStr);
  791. }
  792. if (MessageUtil.ShowYesNoAndQuestion("是否删除检修计划?") == DialogResult.No)
  793. {
  794. return false ;
  795. }
  796. string[] param = PlanHelper.SetData("com.steering.pss.plnsaleord.processOrder.base.ProducHelper.deleteRepairPlan", new object[] { jsonlist, processCode }, ob);
  797. if (param == null) { MessageUtil.ShowTips("服务端处理失败!"); return false; }
  798. else
  799. {
  800. MessageUtil.ShowTips(param[1]);
  801. if ((bool.Parse(param[0]))) { return true; } else { return false; }
  802. }
  803. }
  804. /// <summary>
  805. /// 设置完成
  806. /// </summary>
  807. /// <param name="entityList"></param>
  808. /// <param name="processCode"></param>
  809. /// <param name="ob"></param>
  810. /// <returns></returns>
  811. public static bool SetPlanFinish(ArrayList entityList,string username, string processCode, OpeBase ob)
  812. {
  813. if (entityList == null)
  814. {
  815. MessageUtil.ShowWarning("请选择订单!");
  816. return false;
  817. }
  818. ArrayList jsonlist = new ArrayList();
  819. foreach (Object obj in entityList)
  820. {
  821. ProducEntity entity = ProducHelper.GenerationProEntity(obj, processCode);
  822. if (entity.IsRepairPln.Equals("是"))
  823. {
  824. MessageUtil.ShowWarning("检修计划订单,不能设置完成!");
  825. return false;
  826. }
  827. //if (entity.GxProSeq.Equals("0"))
  828. //{
  829. // MessageUtil.ShowWarning("订单已经设置完成!");
  830. // return false;
  831. //}
  832. jsonlist.Add(entity.JsonStr);
  833. }
  834. if (MessageUtil.ShowYesNoAndQuestion("是否设置完成(此操作数据暂不可恢复)?") == DialogResult.No)
  835. {
  836. return false;
  837. }
  838. string[] param = PlanHelper.SetData("com.steering.pss.plnsaleord.processOrder.base.ProducHelper.setPlanFinish", new object[] { jsonlist, username, processCode }, ob);
  839. if (param == null) { MessageUtil.ShowTips("服务端处理失败!"); return false; }
  840. else
  841. {
  842. MessageUtil.ShowTips(param[1]);
  843. if ((bool.Parse(param[0]))) { return true; } else { return false; }
  844. }
  845. }
  846. /// <summary>
  847. /// 查询炼轧数据
  848. /// </summary>
  849. /// <param name="ob"></param>
  850. /// <returns></returns>
  851. public static DataTable QueryLZData( OpeBase ob)
  852. {
  853. return ServerHelper.GetData("com.steering.pss.plnsaleord.processOrder.base.ProducHelper.queryLZData", new object[] { }, ob);
  854. }
  855. /// <summary>
  856. /// 查询轧管炼轧数据
  857. /// </summary>
  858. /// <param name="ob"></param>
  859. /// <returns></returns>
  860. public static DataTable QueryLZDataZg(OpeBase ob)
  861. {
  862. return ServerHelper.GetData("com.steering.pss.plnsaleord.processOrder.base.ProducHelper.queryLZDataZg", new object[] { }, ob);
  863. }
  864. /// <summary>
  865. /// 赋值炼轧数据
  866. /// </summary>
  867. /// <param name="ug"></param>
  868. /// <param name="ob"></param>
  869. public static void copyLZData(UltraGrid ug,string flag, OpeBase ob)
  870. {
  871. if (ug.Rows.Count == 0) { return; }
  872. DataTable dt = ProducHelper.QueryLZData(ob);
  873. if (dt == null || dt.Rows.Count == 0){ return;}
  874. foreach(UltraGridRow ugr in ug.Rows){
  875. string key = ugr.Cells["OrdLnDlyPk"].Text + "-" + ugr.Cells["PlnDivideId"].Text;
  876. DataRow[] drs = dt.Select("PK ='" + key+"'");
  877. if (drs != null && drs.Length> 0)
  878. {
  879. ugr.Cells["FinishWgt"].Value = drs[0]["FINISH_WGT"].ToString();
  880. ugr.Cells["UnfinishWgt"].Value = drs[0]["UNFINISH_WGT"].ToString();
  881. ugr.Cells["UnfinishTime"].Value = drs[0]["UNFINISH_TIME"].ToString();
  882. ugr.Cells["UnfinishNum"].Value = drs[0]["UNFINISH_NUM"].ToString();
  883. if (flag.Equals("D") && !ugr.Cells["AfPlanTimeB"].Text.Equals("") && !drs[0]["UNFINISH_TIME"].ToString().Equals(""))
  884. {
  885. DateTime t1 = DateTime.Parse(ugr.Cells["AfPlanTimeB"].Text);
  886. DateTime t2 = DateTime.Parse(drs[0]["UNFINISH_TIME"].ToString());
  887. ugr.Cells["DifTime"].Value = String.Format("{0:N0} ", (t1 - t2).TotalDays);
  888. }
  889. }
  890. }
  891. }
  892. /// <summary>
  893. /// 赋值轧管炼轧数据
  894. /// </summary>
  895. /// <param name="ug"></param>
  896. /// <param name="ob"></param>
  897. public static void copyLZDataZg(UltraGrid ug, string flag, OpeBase ob)
  898. {
  899. if (ug.Rows.Count == 0) { return; }
  900. DataTable dt = ProducHelper.QueryLZDataZg(ob);
  901. if (dt == null || dt.Rows.Count == 0) { return; }
  902. foreach (UltraGridRow ugr in ug.Rows)
  903. {
  904. string key = ugr.Cells["proPlanId"].Text + "-" + ugr.Cells["gxPlanNo"].Text;
  905. DataRow[] drs = dt.Select("订单号 ='" + ugr.Cells["proPlanId"].Text + "' AND 序号='" + ugr.Cells["gxPlanNo"].Text + "'");
  906. if (drs != null && drs.Length > 0)
  907. {
  908. if (!drs[0]["LJ支"].ToString().Equals(""))
  909. {
  910. ugr.Cells["LjNum"].Value = drs[0]["LJ支"].ToString();
  911. ugr.Cells["LjWeight"].Value = drs[0]["LJ吨"].ToString();
  912. }
  913. if (!drs[0]["装炉支"].ToString().Equals(""))
  914. {
  915. ugr.Cells["FurnaNum"].Value = drs[0]["装炉支"].ToString();
  916. ugr.Cells["FurnaWeight"].Value = drs[0]["装炉吨"].ToString();
  917. }
  918. if (!drs[0]["出库支"].ToString().Equals(""))
  919. {
  920. ugr.Cells["CkNum"].Value = drs[0]["出库支"].ToString();
  921. ugr.Cells["CkWeight"].Value = drs[0]["出库吨"].ToString();
  922. }
  923. //ugr.Cells["LjNum"].Value = drs[0]["LJ支"].ToString();
  924. //ugr.Cells["LjWeight"].Value = drs[0]["LJ吨"].ToString();
  925. //ugr.Cells["FurnaNum"].Value = drs[0]["装炉支"].ToString();
  926. //ugr.Cells["FurnaWeight"].Value = drs[0]["装炉吨"].ToString();
  927. //ugr.Cells["CkNum"].Value = drs[0]["出库支"].ToString();
  928. //ugr.Cells["CkWeight"].Value = drs[0]["出库吨"].ToString();
  929. //if (flag.Equals("D") && !ugr.Cells["AfPlanTimeB"].Text.Equals("") && !drs[0]["UNFINISH_TIME"].ToString().Equals(""))
  930. //{
  931. // DateTime t1 = DateTime.Parse(ugr.Cells["AfPlanTimeB"].Text);
  932. // DateTime t2 = DateTime.Parse(drs[0]["UNFINISH_TIME"].ToString());
  933. // ugr.Cells["DifTime"].Value = String.Format("{0:N0} ", (t1 - t2).TotalDays);
  934. //}
  935. }
  936. }
  937. }
  938. }
  939. }