FrmGlOrderManage.cs 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572
  1. using Core.Mes.Client.Comm;
  2. using Core.Mes.Client.Comm.Control;
  3. using Core.Mes.Client.Comm.Server;
  4. using Core.Mes.Client.Comm.Tool;
  5. using Core.StlMes.Client.GlBusiness.Dialog;
  6. using Core.StlMes.Client.Judge.Forms;
  7. using CoreFS.CA06;
  8. using Infragistics.Win;
  9. using Infragistics.Win.UltraWinGrid;
  10. using System;
  11. using System.Collections;
  12. using System.Collections.Generic;
  13. using System.ComponentModel;
  14. using System.Data;
  15. using System.Drawing;
  16. using System.Linq;
  17. using System.Text;
  18. using System.Threading.Tasks;
  19. using System.Windows.Forms;
  20. namespace Core.StlMes.Client.GlBusiness
  21. {
  22. public partial class FrmGlOrderManage : FrmBase
  23. {
  24. public FrmGlOrderManage()
  25. {
  26. InitializeComponent();
  27. this.IsLoadUserView = true;
  28. }
  29. public override void ToolBar_Click(object sender, string ToolbarKey)
  30. {
  31. switch (ToolbarKey)
  32. {
  33. case "doQuery":
  34. doQuery();//查询
  35. break;
  36. case "doAdd":
  37. doAdd();//新增合同
  38. break;
  39. case "doUpdate":
  40. doUpdate();//修改合同
  41. break;
  42. case "doDelete":
  43. doDelete();//作废合同头
  44. break;
  45. case "doSavePrice":
  46. doSavePrice();///价格维护
  47. break;
  48. case "doConfirm":
  49. doConfirm();//确认生效
  50. break;
  51. case "cancelConfirm":
  52. cancelConfirm();//取消确认
  53. break;
  54. case "doApprove1":
  55. doApprove("1");//审批通过
  56. break;
  57. case "doApprove2":
  58. doApprove("2");//审批退回
  59. break;
  60. case "doApprove3":
  61. doApprove("3");//审批拒绝
  62. break;
  63. case "doReturn":
  64. doReturn();//审批拒绝
  65. break;
  66. case "doPrint":
  67. doPrint();//打印
  68. break;
  69. case "queryBuyInfo":
  70. queryInfo("122302");
  71. break;
  72. case "querySaleInfo":
  73. queryInfo("122301");
  74. break;
  75. }
  76. }
  77. private void doQuery()
  78. {
  79. string orderNo = ""; //合同号
  80. string orderStart = "";
  81. string orderEnd = "";
  82. if (uchkOrderNo.Checked)
  83. {
  84. orderNo = utxtOrderNo.Text.Trim();
  85. }
  86. if (uchkDate.Checked)
  87. {
  88. orderStart = udtStart.DateTime.ToString("yyyy-MM-dd") + " 00:00:01";
  89. orderEnd = udtEnd.DateTime.ToString("yyyy-MM-dd") + " 23:59:59";
  90. }
  91. else
  92. {
  93. orderStart = "1000-01-01 00:00:01";
  94. orderEnd = "9999-12-31 23:59:59";
  95. }
  96. DataTable dt = ServerHelper.GetData("com.steering.pss.glbusiness.GlOrderManage.doQuery", new Object[] { orderNo, orderStart, orderEnd, this.ValidDataPurviewIds }, this.ob);
  97. GridHelper.CopyDataToDatatable(ref dt, ref this.orderHead, true);
  98. if (orderHead.Rows.Count<=0)
  99. orderLine.Clear();
  100. GridHelper.RefreshAndAutoSizeExceptColumns(this.ultraGrid1, "MNY_ASK_DESC");
  101. }
  102. private void doAdd()
  103. {
  104. orderHeadInfo head = new orderHeadInfo();
  105. head.Key = "add";
  106. head.ob = this.ob;
  107. head.ShowDialog();
  108. if (head.CloseEvent.Equals("Add"))
  109. this.doQuery();
  110. }
  111. private void doUpdate()
  112. {
  113. if (this.ultraGrid1.ActiveRow == null)
  114. return;
  115. if (!ultraGrid1.ActiveRow.Cells["VALIDFLAG"].Value.ToString().Equals("10"))
  116. {
  117. MessageUtil.ShowTips("合同状态非有效状态,不能修改");
  118. return;
  119. }
  120. orderHeadInfo head = new orderHeadInfo();
  121. head.Key = "update";
  122. head.OrdPk = ultraGrid1.ActiveRow.Cells["ORD_PK"].Value.ToString();
  123. head.ob = this.ob;
  124. head.ShowDialog();
  125. if (head.CloseEvent.Equals("Add"))
  126. this.doQuery();
  127. }
  128. private void doDelete()
  129. {
  130. if (ultraGrid1.ActiveRow == null)
  131. return;
  132. if (!ultraGrid1.ActiveRow.Cells["VALIDFLAG"].Value.ToString().Equals("10"))
  133. {
  134. MessageUtil.ShowTips("合同状态非有效状态,不能作废");
  135. return;
  136. }
  137. if (MessageUtil.ShowYesNoAndQuestion("是否确认作废选中合同?") == DialogResult.No) return;
  138. String ordPk = ultraGrid1.ActiveRow.Cells["ord_pk"].Value.ToString();
  139. CoreClientParam ccp = new CoreClientParam();
  140. ccp.ServerName = "com.steering.pss.glbusiness.GlOrderManage";
  141. ccp.MethodName = "deleteHead";
  142. ccp.ServerParams = new object[] { ordPk };
  143. ccp.IfShowErrMsg = false;
  144. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  145. if (ccp != null)
  146. {
  147. if (ccp.ReturnCode == -1)
  148. {
  149. MessageUtil.ShowWarning(ccp.ReturnInfo);
  150. return;
  151. }
  152. MessageUtil.ShowTips("作废成功!");
  153. doQuery();
  154. }
  155. }
  156. private void doSavePrice()
  157. {
  158. if (ultraGrid1.ActiveRow == null)
  159. return;
  160. List<UltraGridRow> listRow = ComHelper.UltraGridGetOtherRows(ultraGrid2, "Choose");
  161. if(listRow.Count<=0)
  162. {
  163. MessageUtil.ShowTips("请选择需要保存的记录");
  164. return;
  165. }
  166. if (!ultraGrid1.ActiveRow.Cells["VALIDFLAG"].Value.ToString().Equals("10"))
  167. {
  168. MessageUtil.ShowTips("合同状态非有效状态,不能保存价格");
  169. return;
  170. }
  171. ArrayList parm = new ArrayList();
  172. foreach (UltraGridRow row in listRow)
  173. {
  174. ArrayList list = new ArrayList();
  175. list.Add(row.Cells["BALNCE_PRICE"].Value.ToString());
  176. list.Add(row.Cells["BALNCE_TOL_PRICE"].Value.ToString());
  177. list.Add(row.Cells["ORD_LN_PK"].Value.ToString());
  178. parm.Add(list);
  179. }
  180. CoreClientParam ccp = new CoreClientParam();
  181. ccp.ServerName = "com.steering.pss.glbusiness.GlOrderManage";
  182. ccp.MethodName = "doSavePrice";
  183. ccp.ServerParams = new object[] { parm };
  184. ccp.IfShowErrMsg = false;
  185. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  186. if (ccp != null)
  187. {
  188. if (ccp.ReturnCode == -1)
  189. {
  190. MessageUtil.ShowWarning(ccp.ReturnInfo);
  191. return;
  192. }
  193. MessageUtil.ShowTips("价格维护成功!");
  194. doQuery();
  195. }
  196. }
  197. private void doConfirm()
  198. {
  199. if (ultraGrid1.ActiveRow==null)
  200. return;
  201. String ordPk = ultraGrid1.ActiveRow.Cells["ord_pk"].Value.ToString();
  202. if (!ultraGrid1.ActiveRow.Cells["VALIDFLAG"].Value.ToString().Equals("10"))
  203. {
  204. MessageUtil.ShowTips("合同状态非有效状态,不能确认");
  205. return;
  206. }
  207. CoreClientParam ccp = new CoreClientParam();
  208. ccp.ServerName = "com.steering.pss.glbusiness.GlOrderManage";
  209. ccp.MethodName = "doConfirm";
  210. ccp.ServerParams = new object[] { ordPk };
  211. ccp.IfShowErrMsg = false;
  212. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  213. if (ccp != null)
  214. {
  215. if (ccp.ReturnCode == -1)
  216. {
  217. MessageUtil.ShowWarning(ccp.ReturnInfo);
  218. return;
  219. }
  220. MessageUtil.ShowTips("确认成功!");
  221. doQuery();
  222. }
  223. }
  224. private void cancelConfirm()
  225. {
  226. if (ultraGrid1.ActiveRow == null)
  227. return;
  228. if (!ultraGrid1.ActiveRow.Cells["VALIDFLAG"].Value.ToString().Equals("20"))
  229. {
  230. MessageUtil.ShowTips("合同状态非生效状态,不能取消确认");
  231. return;
  232. }
  233. if (!ultraGrid1.ActiveRow.Cells["APPROVALFLAG"].Value.ToString().Equals("00"))
  234. {
  235. MessageUtil.ShowTips("评审状态非待审不能取消确认");
  236. return;
  237. }
  238. String ordPk = ultraGrid1.ActiveRow.Cells["ord_pk"].Value.ToString();
  239. CoreClientParam ccp = new CoreClientParam();
  240. ccp.ServerName = "com.steering.pss.glbusiness.GlOrderManage";
  241. ccp.MethodName = "cancelConfirm";
  242. ccp.ServerParams = new object[] { ordPk };
  243. ccp.IfShowErrMsg = false;
  244. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  245. if (ccp != null)
  246. {
  247. if (ccp.ReturnCode == -1)
  248. {
  249. MessageUtil.ShowWarning(ccp.ReturnInfo);
  250. return;
  251. }
  252. MessageUtil.ShowTips("取消确认成功!");
  253. doQuery();
  254. }
  255. }
  256. //审批通过 1 退回 2 拒绝 3
  257. private void doApprove(String flag)
  258. {
  259. if (ultraGrid1.ActiveRow == null)
  260. return;
  261. String ordPk = ultraGrid1.ActiveRow.Cells["ord_pk"].Value.ToString();
  262. if (!ultraGrid1.ActiveRow.Cells["VALIDFLAG"].Value.ToString().Equals("20"))
  263. {
  264. MessageUtil.ShowTips("合同状态非生效不能审批");
  265. return;
  266. }
  267. if (!ultraGrid1.ActiveRow.Cells["APPROVALFLAG"].Value.ToString().Equals("00"))
  268. {
  269. MessageUtil.ShowTips("评审状态非待审不能审批");
  270. return;
  271. }
  272. glReviewMemo gl = new glReviewMemo();
  273. gl.ShowDialog();
  274. string reviewMemo = gl.ReviewMemo;
  275. if (gl.DialogResult != DialogResult.OK)
  276. return;
  277. CoreClientParam ccp = new CoreClientParam();
  278. ccp.ServerName = "com.steering.pss.glbusiness.GlOrderManage";
  279. ccp.MethodName = "doApprove";
  280. ccp.ServerParams = new object[] { ordPk, flag, reviewMemo,UserInfo.GetUserID(),UserInfo.GetUserName() };
  281. ccp.IfShowErrMsg = false;
  282. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  283. if (ccp != null)
  284. {
  285. if (ccp.ReturnCode == -1)
  286. {
  287. MessageUtil.ShowWarning(ccp.ReturnInfo);
  288. return;
  289. }
  290. MessageUtil.ShowTips("审批成功!");
  291. doQuery();
  292. }
  293. }
  294. //取消审批
  295. private void doReturn()
  296. {
  297. if (ultraGrid1.ActiveRow == null)
  298. return;
  299. String ordPk = ultraGrid1.ActiveRow.Cells["ord_pk"].Value.ToString();
  300. if (!ultraGrid1.ActiveRow.Cells["VALIDFLAG"].Value.ToString().Equals("20"))
  301. {
  302. MessageUtil.ShowTips("合同状态非生效不能撤销审批");
  303. return;
  304. }
  305. if (ultraGrid1.ActiveRow.Cells["APPROVALFLAG"].Value.ToString().Equals("00"))
  306. {
  307. MessageUtil.ShowTips("未审批,不需要撤销审批");
  308. return;
  309. }
  310. CoreClientParam ccp = new CoreClientParam();
  311. ccp.ServerName = "com.steering.pss.glbusiness.GlOrderManage";
  312. ccp.MethodName = "doReturn";
  313. ccp.ServerParams = new object[] { ordPk };
  314. ccp.IfShowErrMsg = false;
  315. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  316. if (ccp != null)
  317. {
  318. if (ccp.ReturnCode == -1)
  319. {
  320. MessageUtil.ShowWarning(ccp.ReturnInfo);
  321. return;
  322. }
  323. MessageUtil.ShowTips("撤销审批成功!");
  324. doQuery();
  325. }
  326. }
  327. //取消审批
  328. private void doPrint()
  329. {
  330. UltraGridRow ugr = this.ultraGrid1.ActiveRow;
  331. if (ugr == null) { MessageUtil.ShowTips("无数据,请确认!"); return; }
  332. string strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepFormalPurchaseContractTH.cpt&op=view" + "&ORD_PK=" + ugr.Cells["ORD_PK"].Value.ToString();
  333. FrmOrderRepExcel fBug = new FrmOrderRepExcel(this.ob, strurl);
  334. fBug.AutoSize = true;
  335. fBug.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height);
  336. fBug.WindowState = FormWindowState.Maximized;
  337. fBug.Text = "天津钢管制造有限公司采购合同";
  338. fBug.Show();
  339. doQuery();
  340. }
  341. private void doApproval()
  342. {
  343. throw new NotImplementedException();
  344. }
  345. private void queryInfo(String flag)
  346. {
  347. FrmMatInfo line = new FrmMatInfo();
  348. line.ob = this.ob;
  349. line.Flag = "1";
  350. line.TradeType = flag;
  351. line.ShowDialog();
  352. }
  353. private void FrmGlOrderManage_Load(object sender, EventArgs e)
  354. {
  355. //默认查询当前日期-1月——当前日期数据。
  356. udtStart.DateTime = Convert.ToDateTime(DateTime.Now.AddMonths(-1).ToShortDateString());
  357. udtEnd.DateTime = Convert.ToDateTime(DateTime.Now.ToShortDateString());
  358. DataTable dtCmbType = ServerHelper.GetData("com.steering.pss.glbusiness.GlOrderManage.getBaseInfo", new object[] { "1223" }, this.ob);
  359. ultraGrid1.DisplayLayout.Bands[0].Columns["TRADE_TYPE"].ValueList = ComHelper.List_GetBaseInfo(dtCmbType);
  360. DataTable dtOrderType = ServerHelper.GetData("com.steering.pss.glbusiness.GlOrderManage.getBaseInfo", new object[] { "1201" }, this.ob);
  361. ultraGrid1.DisplayLayout.Bands[0].Columns["ORDER_TYP"].ValueList = ComHelper.List_GetBaseInfo(dtOrderType);
  362. DataTable dtOrderUnit = ServerHelper.GetData("com.steering.pss.glbusiness.GlOrderManage.getBaseInfo", new object[] { "1205" }, this.ob);
  363. ultraGrid1.DisplayLayout.Bands[0].Columns["SUPPLY_UNIT"].ValueList = ComHelper.List_GetBaseInfo(dtOrderUnit);
  364. DataTable dtAddress = ServerHelper.GetData("com.steering.pss.glbusiness.GlOrderManage.getBaseInfo", new object[] { "1106" }, this.ob);
  365. ultraGrid1.DisplayLayout.Bands[0].Columns["DELVRY_ADDR"].ValueList = ComHelper.List_GetBaseInfo(dtAddress);
  366. DataTable dtDeliveryType = ServerHelper.GetData("com.steering.pss.glbusiness.GlOrderManage.getBaseInfo", new object[] { "1208" }, this.ob);
  367. ultraGrid1.DisplayLayout.Bands[0].Columns["DELVRY_TYPE"].ValueList = ComHelper.List_GetBaseInfo(dtDeliveryType);
  368. DataTable dtTransType = ServerHelper.GetData("com.steering.pss.glbusiness.GlOrderManage.getBaseInfo", new object[] { "1105" }, this.ob);
  369. ultraGrid1.DisplayLayout.Bands[0].Columns["TRANSIT_TYPE"].ValueList = ComHelper.List_GetBaseInfo(dtTransType);
  370. DataTable dtPackType = ServerHelper.GetData("com.steering.pss.glbusiness.GlOrderManage.getBaseInfo", new object[] { "1232" }, this.ob);
  371. ultraGrid1.DisplayLayout.Bands[0].Columns["PACK_TYPE"].ValueList = ComHelper.List_GetBaseInfo(dtPackType);
  372. DataTable dtPayType = ServerHelper.GetData("com.steering.pss.glbusiness.GlOrderManage.getBaseInfo", new object[] { "1212" }, this.ob);
  373. ultraGrid1.DisplayLayout.Bands[0].Columns["MNY_ASK_TYP"].ValueList = ComHelper.List_GetBaseInfo(dtPayType);
  374. ValueList list = new ValueList();
  375. ValueListItem[] items = new ValueListItem[] {
  376. new ValueListItem("00", "无效"),
  377. new ValueListItem("10", "有效"),
  378. new ValueListItem("20", "生效"),
  379. };
  380. list.ValueListItems.AddRange(items);
  381. ultraGrid1.DisplayLayout.Bands[0].Columns["VALIDFLAG"].ValueList = list;
  382. ValueList list1 = new ValueList();
  383. ValueListItem[] items1 = new ValueListItem[] {
  384. new ValueListItem("00", "待审"),
  385. new ValueListItem("10", "通过"),
  386. new ValueListItem("20", "退回"),
  387. new ValueListItem("30", "拒绝"),
  388. };
  389. list1.ValueListItems.AddRange(items1);
  390. ultraGrid1.DisplayLayout.Bands[0].Columns["APPROVALFLAG"].ValueList = list1;
  391. ValueList list2 = new ValueList();
  392. ValueListItem[] items2 = new ValueListItem[] {
  393. new ValueListItem("0", "否"),
  394. new ValueListItem("1", "是")
  395. };
  396. list2.ValueListItems.AddRange(items2);
  397. ultraGrid2.DisplayLayout.Bands[0].Columns["PRODUCER_FL"].ValueList = list2;
  398. GridHelper.SetAllColumnsActive(ultraGrid1);
  399. if("1".Equals(CustomInfo))
  400. {
  401. GridHelper.SetAllColumnsActive(ultraGrid2);
  402. ultraGrid2.DisplayLayout.Bands[0].Columns["Choose"].Hidden = true;
  403. ultraGrid2.DisplayLayout.Bands[0].Columns["BALNCE_PRICE"].Hidden = true;
  404. ultraGrid2.DisplayLayout.Bands[0].Columns["BALNCE_TOL_PRICE"].Hidden = true;
  405. }
  406. else
  407. {
  408. ultraToolbarsManager1.Visible = false;
  409. GridHelper.SetColumnsActivateAndColor(ultraGrid2.Rows.Band, "Choose", "BALNCE_PRICE");
  410. }
  411. }
  412. private void ultraToolbarsManager1_ToolClick(object sender, Infragistics.Win.UltraWinToolbars.ToolClickEventArgs e)
  413. {
  414. switch (e.Tool.Key)
  415. {
  416. case "Add":
  417. Add();
  418. break;
  419. case "Delete":
  420. DeleteLine();
  421. break;
  422. case "Export":
  423. GridHelper.ulGridToExcel(ultraGrid2, "关联交易合同行信息表");
  424. break;
  425. }
  426. }
  427. private void DeleteLine()
  428. {
  429. if (ultraGrid2.ActiveRow == null)
  430. return;
  431. String ordLnPk = ultraGrid2.ActiveRow.Cells["ord_ln_pk"].Value.ToString();
  432. if (!"10".Equals(ultraGrid1.ActiveRow.Cells["VALIDFLAG"].Value.ToString()))
  433. {
  434. MessageUtil.ShowWarning("合同状态为有效时才能作废合同行");
  435. return;
  436. }
  437. if (MessageUtil.ShowYesNoAndQuestion("是否确认作废选中合同行?") == DialogResult.No) return;
  438. CoreClientParam ccp = new CoreClientParam();
  439. ccp.ServerName = "com.steering.pss.glbusiness.GlOrderManage";
  440. ccp.MethodName = "deleteLine";
  441. ccp.ServerParams = new object[] { ordLnPk };
  442. ccp.IfShowErrMsg = false;
  443. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  444. if (ccp != null)
  445. {
  446. if (ccp.ReturnCode == -1)
  447. {
  448. MessageUtil.ShowWarning(ccp.ReturnInfo);
  449. return;
  450. }
  451. MessageUtil.ShowTips("作废成功!");
  452. queryLine();
  453. }
  454. }
  455. private void Add()
  456. {
  457. if (ultraGrid1.ActiveRow == null)
  458. return;
  459. String ordPk = ultraGrid1.ActiveRow.Cells["ord_pk"].Value.ToString();
  460. if (!"10".Equals(ultraGrid1.ActiveRow.Cells["VALIDFLAG"].Value.ToString()))
  461. {
  462. MessageUtil.ShowWarning("合同状态为有效时才能新增合同行");
  463. return;
  464. }
  465. FrmMatInfo line = new FrmMatInfo();
  466. line.ob = this.ob;
  467. line.OrdPk = ordPk;
  468. line.Flag = "0";
  469. line.TradeType = ultraGrid1.ActiveRow.Cells["TRADE_TYPE"].Value.ToString();
  470. line.ShowDialog();
  471. if (line.CloseEvent.Equals("Add"))
  472. {
  473. this.doQuery();
  474. foreach (UltraGridRow row in ultraGrid1.Rows)
  475. {
  476. if (row.Cells["ORD_PK"].Value.ToString() == ordPk)
  477. {
  478. row.Activate();
  479. break;
  480. }
  481. }
  482. }
  483. }
  484. private void ultraGrid1_AfterRowActivate(object sender, EventArgs e)
  485. {
  486. queryLine();
  487. }
  488. public void queryLine()
  489. {
  490. if (ultraGrid1.ActiveRow == null)
  491. return;
  492. String ordPk = ultraGrid1.ActiveRow.Cells["ord_pk"].Value.ToString();
  493. DataTable dt = ServerHelper.GetData("com.steering.pss.glbusiness.GlOrderManage.doQueryLine", new Object[] { ordPk }, this.ob);
  494. GridHelper.CopyDataToDatatable(ref dt, ref this.orderLine, true);
  495. }
  496. private void uchkDate_CheckedChanged(object sender, EventArgs e)
  497. {
  498. if (uchkDate.Checked)
  499. {
  500. udtStart.ReadOnly = false;
  501. udtEnd.ReadOnly = false;
  502. }
  503. else
  504. {
  505. udtStart.ReadOnly = true;
  506. udtEnd.ReadOnly = true;
  507. }
  508. }
  509. private void ultraGrid2_CellChange(object sender, CellEventArgs e)
  510. {
  511. this.ultraGrid2.UpdateData();
  512. if (e.Cell.Column.Key != "BALNCE_PRICE")
  513. return;
  514. int i = e.Cell.Row.Index;
  515. double price =0;
  516. if (!double.TryParse(ultraGrid2.Rows[i].Cells["BALNCE_PRICE"].Text, out price))
  517. return;
  518. double weight = double.Parse(ultraGrid2.Rows[i].Cells["ORDER_QTY"].Text);
  519. double money = price * weight;
  520. ultraGrid2.Rows[i].Cells["BALNCE_TOL_PRICE"].Value = Math.Round(money, 3);
  521. }
  522. private void uchkOrderNo_CheckedChanged(object sender, EventArgs e)
  523. {
  524. if (uchkOrderNo.Checked)
  525. utxtOrderNo.ReadOnly = false;
  526. else
  527. utxtOrderNo.ReadOnly = true;
  528. }
  529. private void craftImg_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e)
  530. {
  531. string filePath = ultraGrid2.ActiveRow.GetValue("CRAFT_NO");
  532. DataTable dt = ServerHelper.GetData("com.steering.pss.glbusiness.GlOrderManage.getFilePath", new Object[] { filePath }, this.ob);
  533. string file = dt.Rows[0]["CRAFT_PATH"].ToString3();
  534. dlgOrderAskDown askDown = new dlgOrderAskDown(this.ob,file);
  535. askDown.DeleteButton.Visible = false;
  536. askDown.Show();
  537. }
  538. }
  539. }