frmOrderProducer.cs 70 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Data;
  4. using System.Windows.Forms;
  5. using CoreFS.CA06;
  6. using Core.Mes.Client.Comm.Control;
  7. using Infragistics.Win.UltraWinGrid;
  8. using Infragistics.Win;
  9. using System.Collections;
  10. using System.Linq;
  11. using Core.StlMes.Client.SaleComm;
  12. using Core.Mes.Client.Comm.Server;
  13. using Infragistics.Win.UltraWinEditors;
  14. using Core.Mes.Client.Comm.Tool;
  15. using Core.StlMes.Client.SaleOrder.ReviewForm;
  16. namespace Core.StlMes.Client.SaleOrder
  17. {
  18. public partial class frmOrderProducer : FrmBase
  19. {
  20. //定位
  21. string prdcrIndex = "";
  22. public frmOrderProducer()
  23. {
  24. InitializeComponent();
  25. }
  26. DataTable dtMain = new DataTable(); //监制主表
  27. DataTable dtVice = new DataTable(); //监制从表
  28. //witch Tab
  29. private string tabNum = "1";
  30. public override void ToolBar_Click(object sender, string ToolbarKey)
  31. {
  32. switch (ToolbarKey)
  33. {
  34. case "doQuery":
  35. doQuery();
  36. break;
  37. case "doAdd":
  38. doAdd();
  39. break;
  40. case "doAddHt":
  41. doAddHt();
  42. break;
  43. case "doFect":
  44. doFect();
  45. break;
  46. case "doFeckBack":
  47. doFectBack();
  48. break;
  49. case "doFeckBoss":
  50. doFectBoss();
  51. break;
  52. case "Export":
  53. exportData();
  54. break;
  55. case "Copy":
  56. CopyData();
  57. break;
  58. case "Paste":
  59. PasteData();
  60. break;
  61. case "doClose":
  62. this.Close();
  63. break;
  64. }
  65. }
  66. public void doAddHt()
  67. {
  68. ultraGrid2.UpdateData();
  69. if (ultraGrid2.Rows.Count == 0)
  70. {
  71. MessageBox.Show("没有需要保存的数据!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  72. return;
  73. }
  74. int mflag = 0; //主表标识
  75. int flag = 0; //从表标识
  76. ArrayList mlist = new ArrayList(); //主表修改参数
  77. ArrayList clist = new ArrayList(); // 从表修改参数
  78. ArrayList dlist = new ArrayList(); //从表需要清空的参数
  79. foreach (UltraGridRow row in ultraGrid2.Rows)
  80. {
  81. if (Convert.ToBoolean(row.Cells["CHK"].Value))
  82. {
  83. string prdcrNo = row.Cells["PRDCR_NO"].Value.ToString();
  84. string prdcrNoIndex = row.Cells["PRDCR_INDEX"].Value.ToString();
  85. string status = GetPrdcrStatus(prdcrNo, prdcrNoIndex);
  86. //改流程注释下面限制
  87. if (status == "W")
  88. {
  89. MessageUtil.ShowWarning("您所选记录,监制处于待确认状态,不能修改!");
  90. row.Activate();
  91. return;
  92. }
  93. if (row.Cells["PRDCR_DESC"].Text.Trim() == "")
  94. {
  95. MessageUtil.ShowWarning("请选择监制说明!");
  96. return;
  97. }
  98. mflag += 1;
  99. ArrayList list = new ArrayList();
  100. list.Add(row.Cells["PRDCR_DESC"].Value.ToString());
  101. list.Add(this.txtPrdcrFile.Text);
  102. list.Add(UserInfo.GetUserName());
  103. list.Add(prdcrNo.Substring(0, 32).ToString());
  104. mlist.Add(list);
  105. foreach (UltraGridRow crow in row.ChildBands[0].Rows)
  106. {
  107. if (Convert.ToBoolean(crow.Cells["XZ"].Value))
  108. {
  109. ArrayList parm = new ArrayList();
  110. if (crow.Cells["PRDCR_PRC_DESC"].Value.ToString() == "")
  111. {
  112. MessageBox.Show("请选择监制类型!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  113. return;
  114. }
  115. if (crow.Cells["PRDCR_ADVC_DAY"].Value.ToString() == "")
  116. {
  117. MessageBox.Show("请输入提前天数!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  118. return;
  119. }
  120. if (crow.Cells["PDEPT_NO"].Value.ToString() == "")
  121. {
  122. MessageBox.Show("请选择监制单位1!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  123. return;
  124. }
  125. if (crow.Cells["PRDCR_MAN"].Value.ToString() == "")
  126. {
  127. MessageBox.Show("请选择监制人员1!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  128. return;
  129. }
  130. if (Convert.ToBoolean(crow.Cells["XZ"].Value))
  131. {
  132. parm.Add("1");
  133. }
  134. else
  135. {
  136. parm.Add("0");
  137. }
  138. parm.Add(crow.Cells["PRDCR_PRC_DESC"].Value.ToString());
  139. parm.Add(crow.Cells["PRDCR_ADVC_DAY"].Value.ToString());
  140. parm.Add(crow.Cells["PDEPT_NO"].Value.ToString());
  141. parm.Add(crow.Cells["PDEPT_NAME"].Value.ToString());
  142. parm.Add(crow.Cells["PHONE"].Value.ToString());
  143. parm.Add(crow.Cells["PRDCR_MAN"].Text);
  144. parm.Add(crow.Cells["PRDCR_MAN_PHONE"].Value.ToString());
  145. parm.Add(crow.Cells["PDEPT_NO2"].Value.ToString());
  146. parm.Add(crow.Cells["PDEPT_NAME2"].Value.ToString());
  147. parm.Add(crow.Cells["PHONE2"].Value.ToString());
  148. parm.Add(crow.Cells["PRDCR_MAN2"].Text);
  149. parm.Add(crow.Cells["PRDCR_MAN_PHONE2"].Value.ToString());
  150. parm.Add(crow.Cells["PDEPT_NO3"].Value.ToString());
  151. parm.Add(crow.Cells["PDEPT_NAME3"].Value.ToString());
  152. parm.Add(crow.Cells["PHONE3"].Value.ToString());
  153. parm.Add(crow.Cells["PRDCR_MAN3"].Text);
  154. parm.Add(crow.Cells["PRDCR_MAN_PHONE3"].Value.ToString());
  155. parm.Add(crow.Cells["MEMO"].Value.ToString());
  156. parm.Add(crow.Cells["PRDCR_NO"].Value.ToString().Substring(0, 32));
  157. flag += 1;
  158. clist.Add(parm);
  159. }
  160. }
  161. }
  162. }
  163. if (mflag == 0)
  164. {
  165. MessageUtil.ShowWarning("请选择需要保存的制程!");
  166. return;
  167. }
  168. if (flag == 0)
  169. {
  170. MessageUtil.ShowWarning("一个制程下请至少维护一条监制信息!");
  171. return;
  172. }
  173. if (MessageBox.Show("是否确认保存?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
  174. {
  175. return;
  176. }
  177. CoreClientParam ccp = new CoreClientParam();
  178. ccp.IfShowErrMsg = false;
  179. ccp.ServerName = "com.steering.pss.sale.order.CoreOrderProducer";
  180. ccp.MethodName = "doAddHt";
  181. ccp.ServerParams = new object[] { mlist, clist };
  182. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  183. if (ccp != null)
  184. {
  185. if (ccp.ReturnCode == -1)
  186. {
  187. MessageUtil.ShowWarning(ccp.ReturnInfo);
  188. return;
  189. }
  190. MessageUtil.ShowTips("保存成功!");
  191. doQuery();
  192. }
  193. }
  194. private void exportData()
  195. {
  196. if(tabNum=="1"){
  197. GridHelper.ulGridToExcel(this.ultraGrid1, "监制要求管理");
  198. }
  199. else
  200. {
  201. GridHelper.ulGridToExcel(this.ultraGrid3, "监制要求查看");
  202. }
  203. }
  204. /// <summary>
  205. /// 行复制
  206. /// </summary>
  207. /// <param name="srcRow"></param>
  208. /// <param name="desRow"></param>
  209. private void CopyRowToRow(DataRow srcRow, DataRow desRow)
  210. {
  211. for (int i = 0; i < srcRow.Table.Columns.Count; i++)
  212. {
  213. string columnName = srcRow.Table.Columns[i].ColumnName;
  214. desRow[columnName] = srcRow[columnName];
  215. }
  216. }
  217. /// <summary>
  218. /// 复制选择的数据
  219. /// </summary>
  220. private void CopyData()
  221. {
  222. // ultraGrid2
  223. ultraGrid2.UpdateData();
  224. UltraGridRow ugr = ultraGrid2.ActiveRow;
  225. if (ugr == null)
  226. {
  227. MessageUtil.ShowWarning("请选择一条制程主表记录或者从表记录进行复制!");
  228. return;
  229. }
  230. if (ugr.HasParent())
  231. {
  232. ugr = ugr.ParentRow;
  233. }
  234. dtMain = OrderProducer_Main.Copy();
  235. dtMain.Clear();
  236. dtVice = OrderProducer_Tain.Copy();
  237. dtVice.Clear();
  238. DataRow mRow = dtMain.NewRow();
  239. CopyRowToRow(((DataRowView)ugr.ListObject).Row, mRow);
  240. dtMain.Rows.Add(mRow);
  241. //复制子表
  242. foreach (UltraGridRow uRow in ugr.ChildBands[0].Rows)
  243. {
  244. DataRow vRow = dtVice.NewRow();
  245. if (uRow.Cells["XZ"].Value.ToString().ToUpper() == "TRUE")
  246. {
  247. CopyRowToRow(((DataRowView)uRow.ListObject).Row, vRow);
  248. dtVice.Rows.Add(vRow);
  249. }
  250. }
  251. }
  252. /// <summary>
  253. /// 粘贴复制的数据
  254. /// </summary>
  255. private void PasteData()
  256. {
  257. if (dtMain == null || dtMain.Rows.Count <= 0 || dtVice == null || dtVice.Rows.Count <= 0)
  258. {
  259. MessageUtil.ShowWarning("没有数据,请复制后再进行粘贴操作!");
  260. return;
  261. }
  262. UltraGridRow ugr = ultraGrid2.ActiveRow;
  263. if (ugr == null)
  264. {
  265. MessageUtil.ShowWarning("请选择一条制程主表记录或者从表记录来粘贴你复制的数据!");
  266. return;
  267. }
  268. if (ugr.HasParent())
  269. {
  270. ugr = ugr.ParentRow;
  271. }
  272. //粘贴主记录 OrderProducer_Main OrderProducer_Tain
  273. //OrderProducer_Main.BeginInit();
  274. DataRow mRow = dtMain.Rows[0];
  275. ugr.Cells["PRDCR_DESC"].Value = mRow["PRDCR_DESC"].ToString();
  276. //粘贴从表
  277. foreach (UltraGridRow uRow in ugr.ChildBands[0].Rows)
  278. {
  279. foreach (DataRow dr in dtVice.Rows)
  280. {
  281. if (uRow.Cells["PROCESS_DESC"].Value.ToString() == dr["PROCESS_DESC"].ToString()
  282. && uRow.Cells["PROCESS_DESC_C"].Value.ToString() == dr["PROCESS_DESC_C"].ToString()
  283. && uRow.Cells["STATION_DESC"].Value.ToString() == dr["STATION_DESC"].ToString())
  284. {
  285. uRow.Cells["PRDCR_PRC_DESC"].Value = dr["PRDCR_PRC_DESC"].ToString();
  286. uRow.Cells["PRDCR_ADVC_DAY"].Value = dr["PRDCR_ADVC_DAY"].ToString();
  287. uRow.Cells["PDEPT_NO"].Value = dr["PDEPT_NO"].ToString();
  288. uRow.Cells["PHONE"].Value = dr["PHONE"].ToString();
  289. uRow.Cells["PRDCR_MAN"].Value = dr["PRDCR_MAN"].ToString();
  290. uRow.Cells["PRDCR_MAN_PHONE"].Value = dr["PRDCR_MAN_PHONE"].ToString();
  291. uRow.Cells["PDEPT_NO2"].Value = dr["PDEPT_NO2"].ToString();
  292. uRow.Cells["PHONE2"].Value = dr["PHONE2"].ToString();
  293. uRow.Cells["PRDCR_MAN2"].Value = dr["PRDCR_MAN2"].ToString();
  294. uRow.Cells["PRDCR_MAN_PHONE2"].Value = dr["PRDCR_MAN_PHONE2"].ToString();
  295. uRow.Cells["PDEPT_NO3"].Value = dr["PDEPT_NO3"].ToString();
  296. uRow.Cells["PHONE3"].Value = dr["PHONE3"].ToString();
  297. uRow.Cells["PRDCR_MAN3"].Value = dr["PRDCR_MAN3"].ToString();
  298. uRow.Cells["PRDCR_MAN_PHONE3"].Value = dr["PRDCR_MAN_PHONE3"].ToString();
  299. uRow.Cells["MEMO"].Value = dr["MEMO"].ToString();
  300. uRow.Cells["XZ"].Value = true;
  301. }
  302. }
  303. }
  304. ultraGrid2.UpdateData();
  305. }
  306. /// <summary>
  307. /// 监制通过
  308. /// </summary>
  309. public void doFectBoss()
  310. {
  311. ultraGrid1.UpdateData();
  312. int rCount = 0;
  313. ArrayList list = new ArrayList();
  314. foreach (UltraGridRow row in ultraGrid1.Rows)
  315. {
  316. if (Convert.ToBoolean(row.Cells["CHK"].Value))
  317. {
  318. rCount += 1;
  319. string prdcrNo = row.Cells["PRDCR_NO"].Value.ToString();
  320. List<string> status = GetPrdcrAllStatus(prdcrNo);
  321. if (status.Contains("S"))
  322. {
  323. MessageUtil.ShowWarning("您所选记录监制已经审批通过!");
  324. return;
  325. }
  326. list.Add(row.Cells["PRDCR_NO"].Value.ToString());
  327. }
  328. }
  329. if (rCount == 0)
  330. {
  331. MessageBox.Show("请选择您要审批通过的记录!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  332. return;
  333. }
  334. if (MessageBox.Show("是否审批通过?", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.No) return;
  335. CoreClientParam ccp = new CoreClientParam();
  336. ccp.IfShowErrMsg = false;
  337. ccp.ServerName = "com.steering.pss.sale.order.CoreOrderProducer";
  338. ccp.MethodName = "coreOrderProducerDeptProsu";
  339. ccp.ServerParams = new object[] { list, this.UserInfo.GetUserName() };
  340. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  341. if (ccp != null)
  342. {
  343. if (ccp.ReturnCode == -1)
  344. {
  345. MessageUtil.ShowWarning(ccp.ReturnInfo);
  346. return;
  347. }
  348. MessageBox.Show("操作成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
  349. doQuery();
  350. }
  351. }
  352. /// <summary>
  353. /// 监制退回
  354. /// </summary>
  355. public void doFectBack()
  356. {
  357. ultraGrid1.UpdateData();
  358. int rCount = 0;
  359. ArrayList list = new ArrayList();
  360. DataTable dt = MakeDataTable();
  361. foreach (UltraGridRow row in ultraGrid1.Rows)
  362. {
  363. if (Convert.ToBoolean(row.Cells["CHK"].Value))
  364. {
  365. rCount += 1;
  366. string orderNo = row.Cells["ORDER_NO"].Value.ToString();
  367. string prdcrNo = row.Cells["PRDCR_NO"].Value.ToString();
  368. List<string> status = GetPrdcrAllStatus(prdcrNo);
  369. if (status.Contains("S"))
  370. {
  371. string orderSts = GetOrderStatus(orderNo);
  372. if (orderSts == "12020402") //提报完毕
  373. {
  374. MessageUtil.ShowWarning("您所选合同已经提报,监制无法退回!");
  375. return;
  376. }
  377. }
  378. DataTable dt1 = ServerHelper.GetData("com.steering.pss.sale.order.CoreOrderProducer.getOrderLinePrdcr", new Object[] { prdcrNo }, this.ob);
  379. foreach (DataRow t in dt1.Rows)
  380. {
  381. DataRow dr = dt.NewRow();
  382. dr["ORDER_NO"] = row.Cells["ORDER_NO"].Value.ToString();
  383. dr["ORDER_SEQ"] = row.Cells["ORDER_SEQ"].Value.ToString();
  384. dr["MSC_PLINE"] = t["MSC_PLINE"].ToString();
  385. dr["MSC_PLINE_DESC"] = t["MSC_PLINE_DESC"].ToString();
  386. dr["PSC_DESC"] = row.Cells["PSC_DESC"].Value.ToString();
  387. dr["STD_NAME"] = row.Cells["STD_NAME"].Value.ToString();
  388. dr["PRODUCNAME"] = row.Cells["PRODUCNAME"].Value.ToString();
  389. //dr["STD_STYLE_DESC"] = row.Cells["STD_STYLE_DESC"].Value.ToString();
  390. dr["MODEL_DESC"] = row.Cells["MODEL_DESC"].Value.ToString();
  391. dr["PRDCR_NO"] = t["PRDCR_NO"].ToString();
  392. dr["PRDCR_INDEX"] = t["PRDCR_INDEX"].ToString();
  393. dt.Rows.Add(dr);
  394. }
  395. }
  396. }
  397. if (rCount == 0)
  398. {
  399. MessageBox.Show("请选择您要审批退回的记录!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  400. return;
  401. }
  402. if (MessageBox.Show("是否审批退回?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) return;
  403. FrmOrderPrdcrBack fop = new FrmOrderPrdcrBack();
  404. fop.Dt = dt;
  405. fop.ShowDialog();
  406. dt = fop.Dt;
  407. if (fop.DialogResult != DialogResult.OK)
  408. return;
  409. foreach (DataRow dr in dt.Rows)
  410. {
  411. ArrayList parm = new ArrayList();
  412. parm.Add(UserInfo.GetUserName());
  413. parm.Add(dr["FAIL_RSN"].ToString());
  414. parm.Add(dr["PRDCR_INDEX"].ToString());
  415. parm.Add(dr["PRDCR_NO"].ToString());
  416. list.Add(parm);
  417. }
  418. CoreClientParam ccp = new CoreClientParam();
  419. ccp.IfShowErrMsg = false;
  420. ccp.ServerName = "com.steering.pss.sale.order.CoreOrderProducer";
  421. ccp.MethodName = "coreOrderProducerDeptProBa";
  422. ccp.ServerParams = new object[] { list };
  423. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  424. if (ccp != null)
  425. {
  426. if (ccp.ReturnCode == -1)
  427. {
  428. MessageUtil.ShowWarning(ccp.ReturnInfo);
  429. return;
  430. }
  431. MessageBox.Show("退回操作成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
  432. doQuery();
  433. }
  434. }
  435. /// <summary>
  436. /// 提报监制
  437. /// </summary>
  438. public void doFect()
  439. {
  440. ultraGrid1.UpdateData();
  441. int rCount = 0;
  442. ArrayList list = new ArrayList();
  443. foreach (UltraGridRow row in ultraGrid1.Rows)
  444. {
  445. if (Convert.ToBoolean(row.Cells["CHK"].Value))
  446. {
  447. rCount += 1;
  448. string prdcrNo = row.Cells["PRDCR_NO"].Value.ToString();
  449. List<string> status = GetPrdcrAllStatus(prdcrNo);
  450. if (status.Contains("L"))
  451. {
  452. MessageUtil.ShowWarning("您所选记录,监制尚未维护!");
  453. return;
  454. }
  455. else if (status.Contains("W"))
  456. {
  457. MessageUtil.ShowWarning("您所选记录,监制已经提报!");
  458. return;
  459. }
  460. else if (status.Contains("S"))
  461. {
  462. MessageUtil.ShowWarning("您所选记录,监制已经生效!");
  463. return;
  464. }
  465. else if (status.Contains("F"))
  466. {
  467. MessageUtil.ShowWarning("您所选记录,存在回退的监制,请修改!");
  468. return;
  469. }
  470. list.Add(row.Cells["PRDCR_NO"].Value.ToString());
  471. }
  472. }
  473. if (rCount == 0)
  474. {
  475. MessageBox.Show("请选择您要提报的数据!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  476. return;
  477. }
  478. if (MessageBox.Show("是否审批提报?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) return;
  479. CoreClientParam ccp = new CoreClientParam();
  480. ccp.IfShowErrMsg = false;
  481. ccp.ServerName = "com.steering.pss.sale.order.CoreOrderProducer";
  482. ccp.MethodName = "coreOrderProducerDeptProFe";
  483. ccp.ServerParams = new object[] { list };
  484. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  485. if (ccp != null)
  486. {
  487. if (ccp.ReturnCode == -1)
  488. {
  489. MessageUtil.ShowWarning(ccp.ReturnInfo);
  490. return;
  491. }
  492. MessageBox.Show("提报成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
  493. doQuery();
  494. }
  495. }
  496. /// <summary>
  497. /// 保存
  498. /// </summary>
  499. public void doAdd()
  500. {
  501. ultraGrid2.UpdateData();
  502. if (ultraGrid2.Rows.Count == 0)
  503. {
  504. MessageBox.Show("没有需要保存的数据!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  505. return;
  506. }
  507. int mflag = 0; //主表标识
  508. int flag = 0; //从表标识
  509. ArrayList mlist = new ArrayList(); //主表修改参数
  510. ArrayList clist = new ArrayList(); // 从表修改参数
  511. ArrayList dlist = new ArrayList(); //从表需要清空的参数
  512. foreach (UltraGridRow row in ultraGrid2.Rows)
  513. {
  514. if (Convert.ToBoolean(row.Cells["CHK"].Value))
  515. {
  516. string prdcrNo = row.Cells["PRDCR_NO"].Value.ToString();
  517. string prdcrNoIndex = row.Cells["PRDCR_INDEX"].Value.ToString();
  518. string status = GetPrdcrStatus(prdcrNo, prdcrNoIndex);
  519. //改流程注释下面限制
  520. if (status == "W")
  521. {
  522. MessageUtil.ShowWarning("您所选记录,监制处于待确认状态,不能修改!");
  523. row.Activate();
  524. return;
  525. }
  526. //if (status == "S")
  527. //{
  528. // MessageUtil.ShowWarning("您所选记录,监制已经生效,不能修改!");
  529. // row.Activate();
  530. // return;
  531. //}
  532. if (row.Cells["PRDCR_DESC"].Text.Trim() == "")
  533. {
  534. MessageUtil.ShowWarning("请选择监制说明!");
  535. return;
  536. }
  537. mflag += 1;
  538. ArrayList list = new ArrayList();
  539. list.Add(row.Cells["PRDCR_DESC"].Value.ToString());
  540. list.Add(this.txtPrdcrFile.Text);
  541. list.Add(UserInfo.GetUserName());
  542. list.Add(prdcrNo);
  543. list.Add(prdcrNoIndex);
  544. mlist.Add(list);
  545. foreach (UltraGridRow crow in row.ChildBands[0].Rows)
  546. {
  547. if (Convert.ToBoolean(crow.Cells["XZ"].Value))
  548. {
  549. ArrayList parm = new ArrayList();
  550. if (crow.Cells["PRDCR_PRC_DESC"].Value.ToString() == "")
  551. {
  552. MessageBox.Show("请选择监制类型!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  553. return;
  554. }
  555. if (crow.Cells["PRDCR_ADVC_DAY"].Value.ToString() == "")
  556. {
  557. MessageBox.Show("请输入提前天数!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  558. return;
  559. }
  560. if (crow.Cells["PDEPT_NO"].Value.ToString() == "")
  561. {
  562. MessageBox.Show("请选择监制单位1!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  563. return;
  564. }
  565. if (crow.Cells["PRDCR_MAN"].Value.ToString() == "")
  566. {
  567. MessageBox.Show("请选择监制人员1!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  568. return;
  569. }
  570. if (Convert.ToBoolean(crow.Cells["XZ"].Value))
  571. {
  572. parm.Add("1");
  573. }
  574. else
  575. {
  576. parm.Add("0");
  577. }
  578. parm.Add(crow.Cells["PRDCR_PRC_DESC"].Value.ToString());
  579. parm.Add(crow.Cells["PRDCR_ADVC_DAY"].Value.ToString());
  580. parm.Add(crow.Cells["PDEPT_NO"].Value.ToString());
  581. parm.Add(crow.Cells["PDEPT_NAME"].Value.ToString());
  582. parm.Add(crow.Cells["PHONE"].Value.ToString());
  583. parm.Add(crow.Cells["PRDCR_MAN"].Text);
  584. parm.Add(crow.Cells["PRDCR_MAN_PHONE"].Value.ToString());
  585. parm.Add(crow.Cells["PDEPT_NO2"].Value.ToString());
  586. parm.Add(crow.Cells["PDEPT_NAME2"].Value.ToString());
  587. parm.Add(crow.Cells["PHONE2"].Value.ToString());
  588. parm.Add(crow.Cells["PRDCR_MAN2"].Text);
  589. parm.Add(crow.Cells["PRDCR_MAN_PHONE2"].Value.ToString());
  590. parm.Add(crow.Cells["PDEPT_NO3"].Value.ToString());
  591. parm.Add(crow.Cells["PDEPT_NAME3"].Value.ToString());
  592. parm.Add(crow.Cells["PHONE3"].Value.ToString());
  593. parm.Add(crow.Cells["PRDCR_MAN3"].Text);
  594. parm.Add(crow.Cells["PRDCR_MAN_PHONE3"].Value.ToString());
  595. parm.Add(crow.Cells["MEMO"].Value.ToString());
  596. parm.Add(crow.Cells["PRDCR_NO"].Value.ToString());
  597. parm.Add(crow.Cells["PRDCR_INDEX"].Value.ToString());
  598. parm.Add(crow.Cells["STATION_CODE"].Value.ToString());
  599. flag += 1;
  600. clist.Add(parm);
  601. }
  602. else
  603. {
  604. //未监制的工序点
  605. ArrayList al = new ArrayList();
  606. al.Add(crow.Cells["PRDCR_NO"].Value.ToString());
  607. al.Add(crow.Cells["PRDCR_INDEX"].Value.ToString());
  608. al.Add(crow.Cells["STATION_CODE"].Value.ToString());
  609. dlist.Add(al);
  610. }
  611. }
  612. }
  613. }
  614. if (mflag == 0)
  615. {
  616. MessageUtil.ShowWarning("请选择需要保存的制程!");
  617. return;
  618. }
  619. if (flag == 0)
  620. {
  621. MessageUtil.ShowWarning("一个制程下请至少维护一条监制信息!");
  622. return;
  623. }
  624. if (MessageBox.Show("是否确认保存?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
  625. {
  626. return;
  627. }
  628. CoreClientParam ccp = new CoreClientParam();
  629. ccp.IfShowErrMsg = false;
  630. ccp.ServerName = "com.steering.pss.sale.order.CoreOrderProducer";
  631. ccp.MethodName = "save";
  632. ccp.ServerParams = new object[] { mlist, clist, dlist };
  633. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  634. if (ccp != null)
  635. {
  636. if (ccp.ReturnCode == -1)
  637. {
  638. MessageUtil.ShowWarning(ccp.ReturnInfo);
  639. return;
  640. }
  641. MessageUtil.ShowTips("保存成功!");
  642. doQuery();
  643. }
  644. }
  645. public void doQuery()
  646. {
  647. //创建时间
  648. string date = "";
  649. string From = "1000-01-01 00:00:01";
  650. string End = "9999-12-31 23:59:59";
  651. if (che_date.Checked)
  652. {
  653. if (Convert.ToDateTime(date_starte.Value) > Convert.ToDateTime(date_end.Value))
  654. {
  655. MessageBox.Show("请输入的日期范围不正确!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  656. return;
  657. }
  658. From = Convert.ToDateTime(date_starte.Value).ToString("yyyy-MM-dd") + " 00:00:01";
  659. End = Convert.ToDateTime(date_end.Value).ToString("yyyy-MM-dd") + " 23:59:59";
  660. }
  661. date = " AND T.CREATE_TIME>= TO_DATE('" + From + "' ,'YYYY-MM-DD HH24:MI:SS') AND T.CREATE_TIME <= TO_DATE( '" + End + "','YYYY-MM-DD HH24:MI:SS')";
  662. ultraGrid1.UpdateData();
  663. UltraGridRow ugr = ultraGrid1.ActiveRow;
  664. string prdcrNo = "";
  665. if (ugr != null)
  666. {
  667. prdcrNo = ugr.Cells["PRDCR_NO"].Value.ToString();
  668. }
  669. //合同号
  670. string order = "";
  671. if (che_order.Checked)
  672. {
  673. if (te_order.Text == "")
  674. {
  675. MessageBox.Show("请输入合同号!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  676. return;
  677. }
  678. else
  679. {
  680. order = te_order.Text;
  681. }
  682. }
  683. //监制的要求状态
  684. var status = dept_stuts.Checked ? cho_stuts.CheckedItems.Select(p => p.DataValue.ToString()).ToArray() : new string[] { "M", "W", "S", "F", "L" };
  685. if (tabNum == "1")
  686. {
  687. dataSet2.Clear();
  688. }
  689. else if (tabNum == "2")
  690. {
  691. dataSet4.Clear();
  692. }
  693. string[] arr = this.ValidDataPurviewIds;
  694. DataTable dt = ServerHelper.GetData("com.steering.pss.sale.order.CoreOrderProducer.CoreOrderProducerHeadQuery", new Object[] { date, order, status, arr, this.CustomInfo, tabNum }, this.ob);
  695. if (tabNum == "1")
  696. {
  697. GridHelper.CopyDataToDatatable(ref dt, ref this.OrderProduSql, true);
  698. }
  699. else if (tabNum == "2")
  700. {
  701. GridHelper.CopyDataToDatatable(ref dt, ref this.dataTable1, true);
  702. }
  703. if (tabNum == "1")
  704. {
  705. if (prdcrNo != "")
  706. {
  707. foreach (UltraGridRow row in ultraGrid1.Rows)
  708. {
  709. if (row.Cells["PRDCR_NO"].Value.ToString().Equals(prdcrNo))
  710. {
  711. row.Activate();
  712. break;
  713. }
  714. }
  715. }
  716. }
  717. }
  718. private void che_date_CheckedChanged(object sender, EventArgs e)
  719. {
  720. date_starte.Enabled = che_date.Checked;
  721. date_end.Enabled = che_date.Checked;
  722. }
  723. private void dept_stuts_CheckedChanged(object sender, EventArgs e)
  724. {
  725. cho_stuts.Enabled = dept_stuts.Checked;
  726. }
  727. private void che_order_CheckedChanged(object sender, EventArgs e)
  728. {
  729. te_order.Enabled = che_order.Checked;
  730. }
  731. ValueList vlistManageNo = new ValueList();
  732. ValueList vlistManageNo1 = new ValueList();
  733. private void frmOrderProducer_Load(object sender, EventArgs e)
  734. {
  735. date_starte.Value = DateTime.Now.AddDays(-30).ToShortDateString();
  736. date_end.Value = DateTime.Now.ToShortDateString();
  737. UltraComboEditor uce = new UltraComboEditor();
  738. DataTable dt = ServerHelper.GetData("com.steering.pss.sale.order.CoreOrderProducer.getPrdcrDesc", null, this.ob);
  739. uce.DataSource = dt;
  740. this.Controls.Add(uce);
  741. uce.Visible = false;
  742. uce.DisplayMember = "BASENAME";
  743. uce.ValueMember = "BASECODE";
  744. ultraGrid2.DisplayLayout.Bands[0].Columns["PRDCR_DESC"].EditorComponent = uce;
  745. ultraGrid2.DisplayLayout.Bands[0].Columns["PRDCR_DESC"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DropDownList;
  746. ultraGrid4.DisplayLayout.Bands[0].Columns["PRDCR_DESC"].EditorComponent = uce;
  747. ultraGrid4.DisplayLayout.Bands[0].Columns["PRDCR_DESC"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DropDownList;
  748. if (this.CustomInfo == "2")
  749. {
  750. dept_stuts.Checked = true;
  751. cho_stuts.Value = "W";
  752. }
  753. DataTable dt3 = ServerHelper.GetData("com.steering.pss.sale.order.CoreOrderProducer.CoreOrderProducerPdeptBase", null, this.ob);
  754. vlistManageNo = GeneralValuelist(ref dt3, "PDEPT_NO", "PDEPT_NAME");
  755. DataTable dt4 = ServerHelper.GetData("com.steering.pss.sale.order.CoreOrderProducer.CoreOrderProducerPrcBase", null, this.ob);
  756. vlistManageNo1 = GeneralValuelist(ref dt4, "BASECODE", "BASENAME");
  757. }
  758. public static ValueList GeneralValuelist(ref DataTable table, string strKey, string strText)
  759. {
  760. if (table == null || !table.Columns.Contains(strKey) || !table.Columns.Contains(strText))
  761. {
  762. return null;
  763. }
  764. ArrayList alist = new ArrayList();
  765. ValueList vlist = new ValueList();
  766. for (int i = 0; i < table.Rows.Count; i++)
  767. {
  768. try
  769. {
  770. if (!alist.Contains(table.Rows[i][strKey]))
  771. {
  772. alist.Add(table.Rows[i][strKey]);
  773. vlist.ValueListItems.Add(table.Rows[i][strKey], Convert.ToString(table.Rows[i][strText]));
  774. }
  775. }
  776. catch { }
  777. }
  778. return vlist;
  779. }
  780. private void ultraGrid1_AfterRowActivate(object sender, EventArgs e)
  781. {
  782. UltraGridRow ugr = ultraGrid1.ActiveRow;
  783. if (ugr != null)
  784. {
  785. this.Cursor = Cursors.WaitCursor;
  786. for (int i = 0; i < ugr.Cells.Count; i++)
  787. {
  788. if (!ugr.Cells[i].Column.Key.Equals("CHK"))
  789. ugr.Cells[i].Activation = Activation.ActivateOnly;
  790. }
  791. doQueryProducer();
  792. }
  793. this.Cursor = Cursors.Default;
  794. }
  795. public void doQueryProducer()
  796. {
  797. ultraGrid1.UpdateData();
  798. UltraGridRow ugr = ultraGrid1.ActiveRow;
  799. if (ugr == null)
  800. return;
  801. //查询合同监制从表
  802. string prdcrNo = ugr.Cells["PRDCR_NO"].Value.ToString();
  803. DataTable dt1 = ServerHelper.GetData("com.steering.pss.sale.order.CoreOrderProducer.getOrderLinePrdcr", new Object[] { prdcrNo }, this.ob);
  804. DataTable dt2 = ServerHelper.GetData("com.steering.pss.sale.order.CoreOrderProducer.getOrderLinePrdcrLst", new Object[] { prdcrNo }, this.ob);
  805. OrderProducer_Tain.Clear();
  806. GridHelper.CopyDataToDatatable(ref dt1, ref this.OrderProducer_Main, true);
  807. GridHelper.CopyDataToDatatable(ref dt2, ref this.OrderProducer_Tain, true);
  808. for (int i = 0; i < ultraGrid2.Rows.Count; i++)
  809. {
  810. for (int j = 0; j < ultraGrid2.Rows[i].ChildBands[0].Rows.Count; j++)
  811. {
  812. ultraGrid2.Rows[i].ChildBands[0].Rows[j].Cells["PDEPT_NO"].ValueList = vlistManageNo;
  813. ultraGrid2.Rows[i].ChildBands[0].Rows[j].Cells["PDEPT_NO2"].ValueList = vlistManageNo;
  814. ultraGrid2.Rows[i].ChildBands[0].Rows[j].Cells["PDEPT_NO3"].ValueList = vlistManageNo;
  815. ultraGrid2.Rows[i].ChildBands[0].Rows[j].Cells["PRDCR_PRC_DESC"].ValueList = vlistManageNo1;
  816. }
  817. }
  818. }
  819. private void ultraGrid2_CellChange(object sender, Infragistics.Win.UltraWinGrid.CellEventArgs e)
  820. {
  821. ultraGrid2.UpdateData();
  822. if (e.Cell.Column.Key.Equals("CHK"))
  823. {
  824. e.Cell.Row.ExpandAll();
  825. if (e.Cell.Row.Cells["CHK"].Value.ToString().ToUpper() != "TRUE")
  826. {
  827. e.Cell.Row.Cells["PRDCR_DESC"].Activation = Activation.ActivateOnly;
  828. }
  829. else
  830. {
  831. e.Cell.Row.Cells["PRDCR_DESC"].Activation = Activation.AllowEdit;
  832. }
  833. }
  834. else if (e.Cell.Column.Key.Equals("PRDCR_DESC")) //监制说明
  835. {
  836. string code = e.Cell.Value.ToString();
  837. //获取这个CODE下的所有工序点。
  838. DataTable stDt = ServerHelper.GetData("com.steering.pss.sale.order.CoreOrderProducer.getPrdcrStationCode", new object[] { code }, this.ob);
  839. List<string> list = new List<string>();
  840. if (stDt != null && stDt.Rows.Count > 0)
  841. {
  842. for (int i = 0; i < stDt.Rows.Count; i++)
  843. list.Add(stDt.Rows[i][0].ToString());
  844. }
  845. for (int j = 0; j < e.Cell.Row.ChildBands[0].Rows.Count; j++)
  846. {
  847. if (list.Contains(e.Cell.Row.ChildBands[0].Rows[j].Cells["STATION_CODE"].Value.ToString()))
  848. e.Cell.Row.ChildBands[0].Rows[j].Cells["XZ"].Value = true;
  849. else
  850. e.Cell.Row.ChildBands[0].Rows[j].Cells["XZ"].Value = false;
  851. }
  852. }
  853. else if (e.Cell.Column.Key.Equals("PRDCR_PRC_DESC"))
  854. {
  855. int num = Convert.ToInt32(e.Cell.Row.Cells["ROWNUM"].Value);
  856. foreach (UltraGridRow row in e.Cell.Row.ParentRow.ChildBands[0].Rows)
  857. {
  858. if (Convert.ToInt32(row.Cells["ROWNUM"].Value) > num)
  859. {
  860. if (row.Cells["XZ"].Value.ToString().ToUpper() == "TRUE")
  861. row.Cells["PRDCR_PRC_DESC"].Value = e.Cell.Value;
  862. }
  863. }
  864. }
  865. else if (e.Cell.Column.Key.Equals("PRDCR_ADVC_DAY"))
  866. {
  867. int num = Convert.ToInt32(e.Cell.Row.Cells["ROWNUM"].Value);
  868. foreach (UltraGridRow row in e.Cell.Row.ParentRow.ChildBands[0].Rows)
  869. {
  870. if (Convert.ToInt32(row.Cells["ROWNUM"].Value) > num)
  871. {
  872. if (row.Cells["XZ"].Value.ToString().ToUpper() == "TRUE")
  873. row.Cells["PRDCR_ADVC_DAY"].Value = e.Cell.Value;
  874. }
  875. }
  876. }
  877. else if (e.Cell.Column.Key == "PDEPT_NO" || e.Cell.Column.Key == "PDEPT_NO2" || e.Cell.Column.Key == "PDEPT_NO3")
  878. {
  879. string unit = "";
  880. if (e.Cell.Column.Key == "PDEPT_NO")
  881. {
  882. unit = e.Cell.Value.ToString();
  883. e.Cell.Row.Cells["PDEPT_NAME"].Value = e.Cell.Text;
  884. DataTable personDt = ServerHelper.GetData("com.steering.pss.sale.order.CoreOrderProducer.getDeptPerson", new object[] { unit }, this.ob); //监制人
  885. ValueList vl = GeneralValuelist(ref personDt, "PHONE", "NAME_");
  886. e.Cell.Row.Cells["PRDCR_MAN"].ValueList = vl;
  887. e.Cell.Row.Cells["PRDCR_MAN"].Value = "";
  888. e.Cell.Row.Cells["PRDCR_MAN_PHONE"].Value = "";
  889. int num = Convert.ToInt32(e.Cell.Row.Cells["ROWNUM"].Value);
  890. foreach (UltraGridRow row in e.Cell.Row.ParentRow.ChildBands[0].Rows)
  891. {
  892. if (Convert.ToInt32(row.Cells["ROWNUM"].Value) > num)
  893. {
  894. if (row.Cells["XZ"].Value.ToString().ToUpper() == "TRUE")
  895. {
  896. row.Cells["PDEPT_NO"].Value = e.Cell.Value;
  897. row.Cells["PHONE"].Value = e.Cell.Row.Cells["PHONE"].Value;
  898. row.Cells["PRDCR_MAN"].Value = e.Cell.Row.Cells["PRDCR_MAN"].Value;
  899. row.Cells["PRDCR_MAN_PHONE"].Value = e.Cell.Row.Cells["PRDCR_MAN_PHONE"].Value;
  900. }
  901. }
  902. }
  903. }
  904. if (e.Cell.Column.Key == "PDEPT_NO2")
  905. {
  906. unit = e.Cell.Value.ToString();
  907. e.Cell.Row.Cells["PDEPT_NAME2"].Value = e.Cell.Text;
  908. DataTable personDt = ServerHelper.GetData("com.steering.pss.sale.order.CoreOrderProducer.getDeptPerson", new object[] { unit }, this.ob); //监制人
  909. ValueList vl = GeneralValuelist(ref personDt, "PHONE", "NAME_");
  910. e.Cell.Row.Cells["PRDCR_MAN2"].ValueList = vl;
  911. e.Cell.Row.Cells["PRDCR_MAN2"].Value = "";
  912. e.Cell.Row.Cells["PRDCR_MAN_PHONE2"].Value = "";
  913. int num = Convert.ToInt32(e.Cell.Row.Cells["ROWNUM"].Value);
  914. foreach (UltraGridRow row in e.Cell.Row.ParentRow.ChildBands[0].Rows)
  915. {
  916. if (Convert.ToInt32(row.Cells["ROWNUM"].Value) > num)
  917. {
  918. if (row.Cells["XZ"].Value.ToString().ToUpper() == "TRUE")
  919. {
  920. row.Cells["PDEPT_NO2"].Value = e.Cell.Value;
  921. row.Cells["PHONE2"].Value = e.Cell.Row.Cells["PHONE2"].Value;
  922. row.Cells["PRDCR_MAN2"].Value = e.Cell.Row.Cells["PRDCR_MAN2"].Value;
  923. row.Cells["PRDCR_MAN_PHONE2"].Value = e.Cell.Row.Cells["PRDCR_MAN_PHONE2"].Value;
  924. }
  925. }
  926. }
  927. }
  928. if (e.Cell.Column.Key == "PDEPT_NO3")
  929. {
  930. unit = e.Cell.Value.ToString();
  931. e.Cell.Row.Cells["PDEPT_NAME3"].Value = e.Cell.Text;
  932. DataTable personDt = ServerHelper.GetData("com.steering.pss.sale.order.CoreOrderProducer.getDeptPerson", new object[] { unit }, this.ob); //监制人
  933. ValueList vl = GeneralValuelist(ref personDt, "PHONE", "NAME_");
  934. e.Cell.Row.Cells["PRDCR_MAN3"].ValueList = vl;
  935. e.Cell.Row.Cells["PRDCR_MAN3"].Value = "";
  936. e.Cell.Row.Cells["PRDCR_MAN_PHONE3"].Value = "";
  937. int num = Convert.ToInt32(e.Cell.Row.Cells["ROWNUM"].Value);
  938. foreach (UltraGridRow row in e.Cell.Row.ParentRow.ChildBands[0].Rows)
  939. {
  940. if (Convert.ToInt32(row.Cells["ROWNUM"].Value) > num)
  941. {
  942. if (row.Cells["XZ"].Value.ToString().ToUpper() == "TRUE")
  943. {
  944. row.Cells["PDEPT_NO3"].Value = e.Cell.Value;
  945. row.Cells["PHONE3"].Value = e.Cell.Row.Cells["PHONE3"].Value;
  946. row.Cells["PRDCR_MAN3"].Value = e.Cell.Row.Cells["PRDCR_MAN3"].Value;
  947. row.Cells["PRDCR_MAN_PHONE3"].Value = e.Cell.Row.Cells["PRDCR_MAN_PHONE3"].Value;
  948. }
  949. }
  950. }
  951. }
  952. DataTable dt = Globals.GetData("com.steering.pss.sale.order.CoreOrderProducer.CoreOrderProducerPhoneQuery", new Object[] { unit }, this.ob); //单位电话
  953. string phone = dt.Rows.Count == 0 ? "" : dt.Rows[0][0].ToString2();
  954. if (e.Cell.Column.Key == "PDEPT_NO")
  955. {
  956. e.Cell.Row.Cells["PHONE"].Value = phone;
  957. int num = Convert.ToInt32(e.Cell.Row.Cells["ROWNUM"].Value);
  958. foreach (UltraGridRow row in e.Cell.Row.ParentRow.ChildBands[0].Rows)
  959. {
  960. if (Convert.ToInt32(row.Cells["ROWNUM"].Value) > num)
  961. {
  962. if (row.Cells["XZ"].Value.ToString().ToUpper() == "TRUE")
  963. {
  964. row.Cells["PHONE"].Value = phone;
  965. }
  966. }
  967. }
  968. }
  969. else if (e.Cell.Column.Key == "PDEPT_NO2")
  970. {
  971. e.Cell.Row.Cells["PHONE2"].Value = phone;
  972. int num = Convert.ToInt32(e.Cell.Row.Cells["ROWNUM"].Value);
  973. foreach (UltraGridRow row in e.Cell.Row.ParentRow.ChildBands[0].Rows)
  974. {
  975. if (Convert.ToInt32(row.Cells["ROWNUM"].Value) > num)
  976. {
  977. if (row.Cells["XZ"].Value.ToString().ToUpper() == "TRUE")
  978. {
  979. row.Cells["PHONE2"].Value = phone;
  980. }
  981. }
  982. }
  983. }
  984. else if (e.Cell.Column.Key == "PDEPT_NO3")
  985. {
  986. e.Cell.Row.Cells["PHONE3"].Value = phone;
  987. int num = Convert.ToInt32(e.Cell.Row.Cells["ROWNUM"].Value);
  988. foreach (UltraGridRow row in e.Cell.Row.ParentRow.ChildBands[0].Rows)
  989. {
  990. if (Convert.ToInt32(row.Cells["ROWNUM"].Value) > num)
  991. {
  992. if (row.Cells["XZ"].Value.ToString().ToUpper() == "TRUE")
  993. {
  994. row.Cells["PHONE3"].Value = phone;
  995. }
  996. }
  997. }
  998. }
  999. }
  1000. else if (e.Cell.Column.Key.Equals("PRDCR_MAN"))
  1001. {
  1002. e.Cell.Row.Cells["PRDCR_MAN_PHONE"].Value = e.Cell.Value;
  1003. int num = Convert.ToInt32(e.Cell.Row.Cells["ROWNUM"].Value);
  1004. foreach (UltraGridRow row in e.Cell.Row.ParentRow.ChildBands[0].Rows)
  1005. {
  1006. if (Convert.ToInt32(row.Cells["ROWNUM"].Value) > num)
  1007. {
  1008. if (row.Cells["XZ"].Value.ToString().ToUpper() == "TRUE")
  1009. {
  1010. row.Cells["PDEPT_NO"].Value = e.Cell.Row.Cells["PDEPT_NO"].Value;
  1011. row.Cells["PRDCR_MAN"].Value = e.Cell.Text;
  1012. row.Cells["PRDCR_MAN_PHONE"].Value = e.Cell.Row.Cells["PRDCR_MAN_PHONE"].Value;
  1013. }
  1014. }
  1015. }
  1016. }
  1017. else if (e.Cell.Column.Key.Equals("PRDCR_MAN2"))
  1018. {
  1019. e.Cell.Row.Cells["PRDCR_MAN_PHONE2"].Value = e.Cell.Value;
  1020. int num = Convert.ToInt32(e.Cell.Row.Cells["ROWNUM"].Value);
  1021. foreach (UltraGridRow row in e.Cell.Row.ParentRow.ChildBands[0].Rows)
  1022. {
  1023. if (Convert.ToInt32(row.Cells["ROWNUM"].Value) > num)
  1024. {
  1025. if (row.Cells["XZ"].Value.ToString().ToUpper() == "TRUE")
  1026. {
  1027. row.Cells["PDEPT_NO2"].Value = e.Cell.Row.Cells["PDEPT_NO2"].Value;
  1028. row.Cells["PRDCR_MAN2"].Value = e.Cell.Text;
  1029. row.Cells["PRDCR_MAN_PHONE2"].Value = e.Cell.Row.Cells["PRDCR_MAN_PHONE2"].Value;
  1030. }
  1031. }
  1032. }
  1033. }
  1034. else if (e.Cell.Column.Key.Equals("PRDCR_MAN3"))
  1035. {
  1036. e.Cell.Row.Cells["PRDCR_MAN_PHONE3"].Value = e.Cell.Value;
  1037. int num = Convert.ToInt32(e.Cell.Row.Cells["ROWNUM"].Value);
  1038. foreach (UltraGridRow row in e.Cell.Row.ParentRow.ChildBands[0].Rows)
  1039. {
  1040. if (Convert.ToInt32(row.Cells["ROWNUM"].Value) > num)
  1041. {
  1042. if (row.Cells["XZ"].Value.ToString().ToUpper() == "TRUE")
  1043. {
  1044. row.Cells["PDEPT_NO3"].Value = e.Cell.Row.Cells["PDEPT_NO3"].Value;
  1045. row.Cells["PRDCR_MAN3"].Value = e.Cell.Text;
  1046. row.Cells["PRDCR_MAN_PHONE3"].Value = e.Cell.Row.Cells["PRDCR_MAN_PHONE3"].Value;
  1047. }
  1048. }
  1049. }
  1050. }
  1051. else if (e.Cell.Column.Key == "XZ")
  1052. {
  1053. if (Convert.ToBoolean(e.Cell.Value))
  1054. {
  1055. e.Cell.Row.Cells["PRDCR_PRC_FL"].Value = true;
  1056. e.Cell.Row.Cells["PRDCR_PRC_FL"].Activation = Activation.AllowEdit;
  1057. e.Cell.Row.Cells["PRDCR_PRC_DESC"].Activation = Activation.AllowEdit;
  1058. e.Cell.Row.Cells["PRDCR_ADVC_DAY"].Activation = Activation.AllowEdit;
  1059. e.Cell.Row.Cells["PDEPT_NO"].Activation = Activation.AllowEdit;
  1060. e.Cell.Row.Cells["PRDCR_MAN"].Activation = Activation.AllowEdit;
  1061. e.Cell.Row.Cells["PDEPT_NO2"].Activation = Activation.AllowEdit;
  1062. e.Cell.Row.Cells["PRDCR_MAN2"].Activation = Activation.AllowEdit;
  1063. e.Cell.Row.Cells["PDEPT_NO3"].Activation = Activation.AllowEdit;
  1064. e.Cell.Row.Cells["PRDCR_MAN3"].Activation = Activation.AllowEdit;
  1065. e.Cell.Row.Cells["MEMO"].Activation = Activation.AllowEdit;
  1066. //自动带出存在的记录的数据
  1067. string prdcr = e.Cell.Row.ParentRow.Cells["PRDCR_NO"].Value.ToString();
  1068. DataRow[] arr = OrderProducer_Tain.Select("PRDCR_NO = '" + prdcr + "' AND XZ='True' AND PRDCR_PRC_DESC <> '' ", "");
  1069. if (arr.Length > 0)
  1070. {
  1071. DataRow dr = arr[arr.Length - 1];
  1072. if (e.Cell.Row.Cells["PRDCR_PRC_DESC"].Text == "" || e.Cell.Row.Cells["PRDCR_ADVC_DAY"].Text == ""
  1073. || e.Cell.Row.Cells["PDEPT_NO"].Text == "")
  1074. {
  1075. e.Cell.Row.Cells["PRDCR_PRC_DESC"].Value = dr["PRDCR_PRC_DESC"].ToString();
  1076. e.Cell.Row.Cells["PRDCR_ADVC_DAY"].Value = dr["PRDCR_ADVC_DAY"].ToString();
  1077. e.Cell.Row.Cells["PDEPT_NO"].Value = dr["PDEPT_NO"].ToString();
  1078. e.Cell.Row.Cells["PDEPT_NAME"].Value = dr["PDEPT_NAME"].ToString();
  1079. e.Cell.Row.Cells["PHONE"].Value = dr["PHONE"].ToString();
  1080. DataTable personDt = ServerHelper.GetData("com.steering.pss.sale.order.CoreOrderProducer.getDeptPerson", new object[] { dr["PDEPT_NO"].ToString() }, this.ob); //监制人
  1081. ValueList vl = GeneralValuelist(ref personDt, "PHONE", "NAME_");
  1082. e.Cell.Row.Cells["PRDCR_MAN"].ValueList = vl;
  1083. e.Cell.Row.Cells["PRDCR_MAN"].Value = dr["PRDCR_MAN"].ToString();
  1084. e.Cell.Row.Cells["PRDCR_MAN_PHONE"].Value = dr["PRDCR_MAN_PHONE"].ToString();
  1085. e.Cell.Row.Cells["PDEPT_NO2"].Value = dr["PDEPT_NO2"].ToString();
  1086. e.Cell.Row.Cells["PDEPT_NAME2"].Value = dr["PDEPT_NAME2"].ToString();
  1087. e.Cell.Row.Cells["PHONE2"].Value = dr["PHONE2"].ToString();
  1088. DataTable personDt2 = ServerHelper.GetData("com.steering.pss.sale.order.CoreOrderProducer.getDeptPerson", new object[] { dr["PDEPT_NO2"].ToString() }, this.ob); //监制人
  1089. ValueList vl2 = GeneralValuelist(ref personDt2, "PHONE", "NAME_");
  1090. e.Cell.Row.Cells["PRDCR_MAN2"].ValueList = vl2;
  1091. e.Cell.Row.Cells["PRDCR_MAN2"].Value = dr["PRDCR_MAN2"].ToString();
  1092. e.Cell.Row.Cells["PRDCR_MAN_PHONE2"].Value = dr["PRDCR_MAN_PHONE2"].ToString();
  1093. e.Cell.Row.Cells["PDEPT_NO3"].Value = dr["PDEPT_NO3"].ToString();
  1094. e.Cell.Row.Cells["PDEPT_NAME3"].Value = dr["PDEPT_NAME3"].ToString();
  1095. DataTable personDt3 = ServerHelper.GetData("com.steering.pss.sale.order.CoreOrderProducer.getDeptPerson", new object[] { dr["PDEPT_NO3"].ToString() }, this.ob); //监制人
  1096. ValueList vl3 = GeneralValuelist(ref personDt3, "PHONE", "NAME_");
  1097. e.Cell.Row.Cells["PRDCR_MAN3"].ValueList = vl3;
  1098. e.Cell.Row.Cells["PHONE3"].Value = dr["PHONE3"].ToString();
  1099. e.Cell.Row.Cells["PRDCR_MAN3"].Value = dr["PRDCR_MAN3"].ToString();
  1100. e.Cell.Row.Cells["PRDCR_MAN_PHONE3"].Value = dr["PRDCR_MAN_PHONE3"].ToString();
  1101. }
  1102. }
  1103. }
  1104. else
  1105. {
  1106. e.Cell.Row.Cells["PRDCR_PRC_FL"].Activation = Activation.ActivateOnly;
  1107. e.Cell.Row.Cells["PRDCR_PRC_DESC"].Activation = Activation.ActivateOnly;
  1108. e.Cell.Row.Cells["PRDCR_ADVC_DAY"].Activation = Activation.ActivateOnly;
  1109. e.Cell.Row.Cells["PDEPT_NO"].Activation = Activation.ActivateOnly;
  1110. e.Cell.Row.Cells["PRDCR_MAN_PHONE"].Activation = Activation.ActivateOnly;
  1111. e.Cell.Row.Cells["PDEPT_NO2"].Activation = Activation.ActivateOnly;
  1112. e.Cell.Row.Cells["PRDCR_MAN_PHONE2"].Activation = Activation.ActivateOnly;
  1113. e.Cell.Row.Cells["PDEPT_NO3"].Activation = Activation.ActivateOnly;
  1114. e.Cell.Row.Cells["PRDCR_MAN_PHONE3"].Activation = Activation.ActivateOnly;
  1115. e.Cell.Row.Cells["MEMO"].Activation = Activation.ActivateOnly;
  1116. }
  1117. }
  1118. }
  1119. private void txtPrdcrFile_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e)
  1120. {
  1121. if (e.Button.Key == "DownLoad")//下载
  1122. {
  1123. frmOrderProducerinfo stu = new frmOrderProducerinfo();
  1124. stu.oPbc = this.ob;
  1125. stu.index = ultraGrid1.ActiveRow.Cells["ORDER_NO"].Text;
  1126. stu.ShowDialog();
  1127. }
  1128. else//上传
  1129. {
  1130. string sFileName = "Image/pss/sale/order/ORD_PK/ORD_LN_PK/PRDCR/" + ultraGrid1.ActiveRow.Cells["ORDER_NO"].Text;
  1131. this.txtPrdcrFile.Text = sFileName;
  1132. FlileUploadcomm.FlileUpload(sFileName);
  1133. }
  1134. }
  1135. private void ultraGrid2_AfterRowActivate(object sender, EventArgs e)
  1136. {
  1137. ultraGrid2.UpdateData();
  1138. UltraGridRow row = ultraGrid2.ActiveRow;
  1139. if (row == null)
  1140. return;
  1141. if (row.HasParent())
  1142. {
  1143. if (row.Cells["XZ"].Value.ToString().ToUpper() == "TRUE" && this.CustomInfo == "1")
  1144. {
  1145. row.Cells["PRDCR_PRC_FL"].Value = true;
  1146. row.Cells["PRDCR_PRC_FL"].Activation = Activation.AllowEdit;
  1147. row.Cells["PRDCR_PRC_DESC"].Activation = Activation.AllowEdit;
  1148. row.Cells["PRDCR_ADVC_DAY"].Activation = Activation.AllowEdit;
  1149. row.Cells["PDEPT_NO"].Activation = Activation.AllowEdit;
  1150. row.Cells["PHONE"].Activation = Activation.ActivateOnly;
  1151. row.Cells["PRDCR_MAN"].Activation = Activation.AllowEdit;
  1152. row.Cells["PRDCR_MAN_PHONE"].Activation = Activation.ActivateOnly;
  1153. row.Cells["PDEPT_NO2"].Activation = Activation.AllowEdit;
  1154. row.Cells["PDEPT_NAME2"].Activation = Activation.AllowEdit;
  1155. row.Cells["PHONE2"].Activation = Activation.ActivateOnly;
  1156. row.Cells["PRDCR_MAN2"].Activation = Activation.AllowEdit;
  1157. row.Cells["PRDCR_MAN_PHONE2"].Activation = Activation.ActivateOnly;
  1158. row.Cells["PDEPT_NO3"].Activation = Activation.AllowEdit;
  1159. row.Cells["PDEPT_NAME3"].Activation = Activation.AllowEdit;
  1160. row.Cells["PHONE3"].Activation = Activation.ActivateOnly;
  1161. row.Cells["PRDCR_MAN3"].Activation = Activation.AllowEdit;
  1162. row.Cells["PRDCR_MAN_PHONE3"].Activation = Activation.ActivateOnly;
  1163. row.Cells["MEMO"].Activation = Activation.AllowEdit;
  1164. DataTable personDt = ServerHelper.GetData("com.steering.pss.sale.order.CoreOrderProducer.getDeptPerson", new object[] { row.Cells["PDEPT_NO"].Value.ToString() }, this.ob); //监制人
  1165. ValueList vl = GeneralValuelist(ref personDt, "PHONE", "NAME_");
  1166. row.Cells["PRDCR_MAN"].ValueList = vl;
  1167. DataTable personDt2 = ServerHelper.GetData("com.steering.pss.sale.order.CoreOrderProducer.getDeptPerson", new object[] { row.Cells["PDEPT_NO2"].Value.ToString() }, this.ob); //监制人
  1168. ValueList vl2 = GeneralValuelist(ref personDt2, "PHONE", "NAME_");
  1169. row.Cells["PRDCR_MAN2"].ValueList = vl2;
  1170. DataTable personDt3 = ServerHelper.GetData("com.steering.pss.sale.order.CoreOrderProducer.getDeptPerson", new object[] { row.Cells["PDEPT_NO3"].Value.ToString() }, this.ob); //监制人
  1171. ValueList vl3 = GeneralValuelist(ref personDt3, "PHONE", "NAME_");
  1172. row.Cells["PRDCR_MAN3"].ValueList = vl3;
  1173. }
  1174. else
  1175. {
  1176. if (this.CustomInfo == "2")
  1177. {
  1178. row.Cells["XZ"].Activation = Activation.ActivateOnly;
  1179. row.ParentRow.Cells["PRDCR_DESC"].Activation = Activation.ActivateOnly;
  1180. }
  1181. row.Cells["PRDCR_PRC_FL"].Activation = Activation.ActivateOnly;
  1182. row.Cells["PRDCR_PRC_DESC"].Activation = Activation.ActivateOnly;
  1183. row.Cells["PRDCR_ADVC_DAY"].Activation = Activation.ActivateOnly;
  1184. row.Cells["PDEPT_NO"].Activation = Activation.ActivateOnly;
  1185. row.Cells["PDEPT_NAME"].Activation = Activation.ActivateOnly;
  1186. row.Cells["PHONE"].Activation = Activation.ActivateOnly;
  1187. row.Cells["PRDCR_MAN"].Activation = Activation.ActivateOnly;
  1188. row.Cells["PRDCR_MAN_PHONE"].Activation = Activation.ActivateOnly;
  1189. row.Cells["PDEPT_NO2"].Activation = Activation.ActivateOnly;
  1190. row.Cells["PDEPT_NAME2"].Activation = Activation.ActivateOnly;
  1191. row.Cells["PHONE2"].Activation = Activation.ActivateOnly;
  1192. row.Cells["PRDCR_MAN2"].Activation = Activation.ActivateOnly;
  1193. row.Cells["PRDCR_MAN_PHONE2"].Activation = Activation.ActivateOnly;
  1194. row.Cells["PDEPT_NO3"].Activation = Activation.ActivateOnly;
  1195. row.Cells["PDEPT_NAME3"].Activation = Activation.ActivateOnly;
  1196. row.Cells["PHONE3"].Activation = Activation.ActivateOnly;
  1197. row.Cells["PRDCR_MAN3"].Activation = Activation.ActivateOnly;
  1198. row.Cells["PRDCR_MAN_PHONE3"].Activation = Activation.ActivateOnly;
  1199. row.Cells["MEMO"].Activation = Activation.ActivateOnly;
  1200. }
  1201. }
  1202. else
  1203. {
  1204. if (this.CustomInfo == "2")
  1205. {
  1206. row.Cells["PRDCR_DESC"].Activation = Activation.ActivateOnly;
  1207. }
  1208. else
  1209. {
  1210. if (row.Cells["CHK"].Value.ToString().ToUpper() != "TRUE")
  1211. {
  1212. row.Cells["PRDCR_DESC"].Activation = Activation.ActivateOnly;
  1213. }
  1214. else
  1215. {
  1216. row.Cells["PRDCR_DESC"].Activation = Activation.AllowEdit;
  1217. }
  1218. }
  1219. }
  1220. }
  1221. /// <summary>
  1222. /// 获取监制状态
  1223. /// </summary>
  1224. /// <param name="orderNo"></param>
  1225. /// <returns></returns>
  1226. public string GetPrdcrStatus(string prdcrNo, string prdcrNoIndex)
  1227. {
  1228. string status = "";
  1229. DataTable dt = ServerHelper.GetData("com.steering.pss.sale.order.CoreOrderProducer.getPrdcrStatus", new object[] { prdcrNo, prdcrNoIndex }, this.ob);
  1230. if (dt != null && dt.Rows.Count > 0)
  1231. {
  1232. status = dt.Rows[0][0].ToString();
  1233. }
  1234. return status;
  1235. }
  1236. /// <summary>
  1237. /// 获取监制编码下的所有状态
  1238. /// </summary>
  1239. /// <param name="prdcrNo"></param>
  1240. /// <returns></returns>
  1241. public List<string> GetPrdcrAllStatus(string prdcrNo)
  1242. {
  1243. List<string> status = new List<string>();
  1244. DataTable dt = ServerHelper.GetData("com.steering.pss.sale.order.CoreOrderProducer.getPrdcrAllStatus", new object[] { prdcrNo }, this.ob);
  1245. if (dt != null && dt.Rows.Count > 0)
  1246. {
  1247. for (int i = 0; i < dt.Rows.Count; i++)
  1248. {
  1249. status.Add(dt.Rows[i][0].ToString());
  1250. }
  1251. }
  1252. return status;
  1253. }
  1254. /// <summary>
  1255. /// 获取合同状态
  1256. /// </summary>
  1257. /// <param name="orderNo"></param>
  1258. /// <returns></returns>
  1259. public string GetOrderStatus(string orderNo)
  1260. {
  1261. string status = "";
  1262. DataTable dt = ServerHelper.GetData("com.steering.pss.sale.order.CoreOrderProducer.getOrderStatus", new object[] { orderNo }, this.ob);
  1263. if (dt != null && dt.Rows.Count > 0)
  1264. {
  1265. status = dt.Rows[0][0].ToString();
  1266. }
  1267. return status;
  1268. }
  1269. private void te_order_KeyPress(object sender, KeyPressEventArgs e)
  1270. {
  1271. if (e.KeyChar == 13)
  1272. doQuery();
  1273. }
  1274. private void frmOrderProducer_Shown(object sender, EventArgs e)
  1275. {
  1276. if (this.CustomInfo.Equals("1"))
  1277. {
  1278. ultraLabel2.Text = "批量只是用于提报";
  1279. }
  1280. else
  1281. {
  1282. ultraLabel2.Visible = false;
  1283. }
  1284. }
  1285. private DataTable MakeDataTable()
  1286. {
  1287. DataTable dt = new DataTable();
  1288. dt.Columns.Add("ORDER_NO", Type.GetType("System.String"));
  1289. dt.Columns.Add("ORDER_SEQ", Type.GetType("System.String"));
  1290. dt.Columns.Add("MSC_PLINE", Type.GetType("System.String"));
  1291. dt.Columns.Add("MSC_PLINE_DESC", Type.GetType("System.String"));
  1292. dt.Columns.Add("PRDCR_NO", Type.GetType("System.String"));
  1293. dt.Columns.Add("PRDCR_INDEX", Type.GetType("System.String"));
  1294. dt.Columns.Add("PSC_DESC", Type.GetType("System.String"));
  1295. dt.Columns.Add("STD_NAME", Type.GetType("System.String"));
  1296. dt.Columns.Add("STD_STYLE_DESC", Type.GetType("System.String"));
  1297. dt.Columns.Add("PRODUCNAME", Type.GetType("System.String"));
  1298. dt.Columns.Add("MODEL_DESC", Type.GetType("System.String"));
  1299. dt.Columns.Add("FAIL_RSN", Type.GetType("System.String"));
  1300. return dt;
  1301. }
  1302. private void ultraTabControl1_SelectedTabChanged(object sender, Infragistics.Win.UltraWinTabControl.SelectedTabChangedEventArgs e)
  1303. {
  1304. try
  1305. {
  1306. if (ultraTabControl1.ActiveTab.Key == "0")
  1307. {
  1308. tabNum = "1";
  1309. }
  1310. else if (ultraTabControl1.ActiveTab.Key == "1")
  1311. {
  1312. tabNum = "2";
  1313. ultraLabel2.Visible = false;
  1314. dept_stuts.Checked = false;
  1315. }
  1316. SetToolMenuVisible(this.CustomInfo);
  1317. }
  1318. catch { }
  1319. }
  1320. /// <summary>
  1321. /// 设置按钮的可见性
  1322. /// </summary>
  1323. /// <param name="p"></param>
  1324. private void SetToolMenuVisible(string p)
  1325. {
  1326. if (toolMenu == null)
  1327. return;
  1328. if (p == "1") //监制维护
  1329. {
  1330. if (tabNum == "1")
  1331. {
  1332. if (toolMenu.Toolbars[0].Tools.Exists("doAdd"))
  1333. toolMenu.Toolbars[0].Tools["doAdd"].InstanceProps.Visible = DefaultableBoolean.True;
  1334. if (toolMenu.Toolbars[0].Tools.Exists("doFect"))
  1335. toolMenu.Toolbars[0].Tools["doFect"].InstanceProps.Visible = DefaultableBoolean.True;
  1336. if (toolMenu.Toolbars[0].Tools.Exists("Copy"))
  1337. toolMenu.Toolbars[0].Tools["Copy"].InstanceProps.Visible = DefaultableBoolean.True;
  1338. if (toolMenu.Toolbars[0].Tools.Exists("Paste"))
  1339. toolMenu.Toolbars[0].Tools["Paste"].InstanceProps.Visible = DefaultableBoolean.True;
  1340. }
  1341. else if (tabNum == "2")
  1342. {
  1343. if (toolMenu.Toolbars[0].Tools.Exists("doAdd"))
  1344. toolMenu.Toolbars[0].Tools["doAdd"].InstanceProps.Visible = DefaultableBoolean.False;
  1345. if (toolMenu.Toolbars[0].Tools.Exists("doFect"))
  1346. toolMenu.Toolbars[0].Tools["doFect"].InstanceProps.Visible = DefaultableBoolean.False;
  1347. if (toolMenu.Toolbars[0].Tools.Exists("Copy"))
  1348. toolMenu.Toolbars[0].Tools["Copy"].InstanceProps.Visible = DefaultableBoolean.False;
  1349. if (toolMenu.Toolbars[0].Tools.Exists("Paste"))
  1350. toolMenu.Toolbars[0].Tools["Paste"].InstanceProps.Visible = DefaultableBoolean.False;
  1351. }
  1352. }
  1353. else if (p == "2") //监制审批
  1354. {
  1355. if (tabNum == "1")
  1356. {
  1357. if (toolMenu.Toolbars[0].Tools.Exists("doFeckBoss"))
  1358. toolMenu.Toolbars[0].Tools["doFeckBoss"].InstanceProps.Visible = DefaultableBoolean.True;
  1359. if (toolMenu.Toolbars[0].Tools.Exists("doFeckBack"))
  1360. toolMenu.Toolbars[0].Tools["doFeckBack"].InstanceProps.Visible = DefaultableBoolean.True;
  1361. }
  1362. else if (tabNum == "2")
  1363. {
  1364. if (toolMenu.Toolbars[0].Tools.Exists("doFeckBoss"))
  1365. toolMenu.Toolbars[0].Tools["doFeckBoss"].InstanceProps.Visible = DefaultableBoolean.False;
  1366. if (toolMenu.Toolbars[0].Tools.Exists("doFeckBack"))
  1367. toolMenu.Toolbars[0].Tools["doFeckBack"].InstanceProps.Visible = DefaultableBoolean.False;
  1368. }
  1369. }
  1370. }
  1371. private void ultraGrid3_AfterRowActivate(object sender, EventArgs e)
  1372. {
  1373. doQueryProducerViewer();
  1374. }
  1375. public void doQueryProducerViewer()
  1376. {
  1377. ultraGrid3.UpdateData();
  1378. UltraGridRow ugr = ultraGrid3.ActiveRow;
  1379. if (ugr == null)
  1380. return;
  1381. //查询合同监制从表
  1382. string prdcrNo = ugr.Cells["PRDCR_NO"].Value.ToString();
  1383. DataTable dt1 = ServerHelper.GetData("com.steering.pss.sale.order.CoreOrderProducer.getOrderLinePrdcr", new Object[] { prdcrNo }, this.ob);
  1384. DataTable dt2 = ServerHelper.GetData("com.steering.pss.sale.order.CoreOrderProducer.getOrderLinePrdcrLst", new Object[] { prdcrNo }, this.ob);
  1385. dataTable3.Clear();
  1386. GridHelper.CopyDataToDatatable(ref dt1, ref this.dataTable2, true);
  1387. GridHelper.CopyDataToDatatable(ref dt2, ref this.dataTable3, true);
  1388. for (int i = 0; i < ultraGrid4.Rows.Count; i++)
  1389. {
  1390. for (int j = 0; j < ultraGrid4.Rows[i].ChildBands[0].Rows.Count; j++)
  1391. {
  1392. ultraGrid4.Rows[i].ChildBands[0].Rows[j].Cells["PDEPT_NO"].ValueList = vlistManageNo;
  1393. ultraGrid4.Rows[i].ChildBands[0].Rows[j].Cells["PDEPT_NO2"].ValueList = vlistManageNo;
  1394. ultraGrid4.Rows[i].ChildBands[0].Rows[j].Cells["PDEPT_NO3"].ValueList = vlistManageNo;
  1395. ultraGrid4.Rows[i].ChildBands[0].Rows[j].Cells["PRDCR_PRC_DESC"].ValueList = vlistManageNo1;
  1396. }
  1397. }
  1398. }
  1399. private void txtPrdcrFile1_EditorButtonClick(object sender, EditorButtonEventArgs e)
  1400. {
  1401. if (e.Button.Key == "DownLoad")//下载
  1402. {
  1403. frmOrderProducerinfo stu = new frmOrderProducerinfo();
  1404. stu.oPbc = this.ob;
  1405. stu.index = ultraGrid3.ActiveRow.Cells["ORDER_NO"].Text;
  1406. stu.ShowDialog();
  1407. }
  1408. }
  1409. }
  1410. }