FrmBalPriceInput.cs 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Text;
  7. using System.Windows.Forms;
  8. using System.Threading;
  9. using System.Collections;
  10. using System.Reflection;
  11. using CoreFS.CA06;
  12. namespace Core.StlMes.Client.Sale.UI.Balance.BalanceAccount
  13. {
  14. public partial class FrmBalPriceInput : Core.StlMes.Client.Sale.Common.FrmStyleBase.FrmUIBase
  15. {
  16. public FrmBalPriceInput()
  17. {
  18. InitializeComponent();
  19. }
  20. Core.StlMes.Client.Sale.BLL.SaleBusinessMgt.Order.SlmOrderBll slmOrderBll = null;
  21. private DataSet dsMain = new DataSet();
  22. private DataSet combaseinfo = null;
  23. private void FrmBalPriceInput_Load(object sender, EventArgs e)
  24. {
  25. this.checkBox1.Checked = true;
  26. this.dateTimePicker1.Value = System.DateTime.Now.AddDays(-30);
  27. combaseinfo = new Core.StlMes.Client.Sale.BLL.SaleBusinessMgt.BaseData.ComBaseInfoBll(this.ob).GetComBaseInfo();
  28. slmOrderBll = new Core.StlMes.Client.Sale.BLL.SaleBusinessMgt.Order.SlmOrderBll(this.ob);
  29. dsMain = base.GetDataSetByColumnName(GetDataStruct(), GetColumnDataType(), GetColumnCaption());
  30. this.ultraGrid1.DataSource = dsMain;
  31. base.SetGridStyle(ref this.ultraGrid1);
  32. InitGrid();
  33. this.radioButton2.Checked = true;
  34. InitEditCell();
  35. }
  36. private void InitGrid()
  37. {
  38. try
  39. {
  40. this.ultraGrid1.DisplayLayout.Bands[0].Columns["CONTAIN_TAX"].ValueList = GetContainTaxValueList();
  41. }
  42. catch
  43. { }
  44. }
  45. private Hashtable GetHashTableByImpExcel()
  46. {
  47. Hashtable hs = new Hashtable();
  48. string fileName = Util.UtilExcel.GetExcelFileName();
  49. if (fileName.Length == 0)
  50. return hs;
  51. DataSet ds = Util.UtilExcel.ToDataSet(fileName);
  52. if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
  53. return hs;
  54. foreach (DataRow dr in ds.Tables[0].Rows)
  55. {
  56. try
  57. {
  58. hs.Add(dr[0].ToString(), dr[1].ToString());
  59. }
  60. catch
  61. {
  62. }
  63. }
  64. return hs;
  65. }
  66. private void BatchUpdateOrderLinBalPrice()
  67. {
  68. if (this.ultraGrid1.Rows.Count == 0)
  69. return;
  70. Hashtable hsOrderPrice = GetHashTableByImpExcel();
  71. if (hsOrderPrice.Count == 0)
  72. return;
  73. string orderNoSeq = "";
  74. string orderLiPk = "";
  75. double price = 0;
  76. string errMsg = "";
  77. string userName = CoreFS.SA06.CoreUserInfo.UserInfo.GetUserName();
  78. foreach (Infragistics.Win.UltraWinGrid.UltraGridRow ugr in this.ultraGrid1.Rows)
  79. {
  80. if (ugr.Cells["BALNCE_PRICE_STS"].Value.ToString() == "1")
  81. continue;
  82. orderNoSeq = ugr.Cells["ORDER_NO"].Value.ToString() + ugr.Cells["ORDER_SEQ"].Value.ToString();
  83. orderLiPk = ugr.Cells[this.ORD_LN_PK].Value.ToString();
  84. if (hsOrderPrice.ContainsKey(orderNoSeq))
  85. {
  86. price = Util.ConverObject.ConvertToDouble(hsOrderPrice[orderNoSeq]);
  87. if (price == 0)
  88. continue;
  89. this.slmOrderBll.UpdateFinallBalPrice(orderLiPk,
  90. price + "",
  91. userName, out errMsg
  92. );
  93. }
  94. }
  95. this.Query();
  96. }
  97. private void InitEditCell()
  98. {
  99. if (this.CustomInfo == "1" || this.CustomInfo == "2")
  100. {
  101. if (this.GetOrgDiv() == "1")
  102. {
  103. this.ultraGrid1.DisplayLayout.Bands[0].Columns["BALNCE_PRICE"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit;
  104. this.ultraGrid1.DisplayLayout.Bands[0].Columns["BALNCE_PRICE"].CellAppearance.BackColor = base.GetEditColor();
  105. }
  106. else
  107. {
  108. this.ultraGrid1.DisplayLayout.Bands[0].Columns["BALNCE_PRICE_ORG"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit;
  109. this.ultraGrid1.DisplayLayout.Bands[0].Columns["BALNCE_PRICE_ORG"].CellAppearance.BackColor = base.GetEditColor();
  110. }
  111. }
  112. }
  113. private Infragistics.Win.ValueList GetContainTaxValueList()
  114. {
  115. Infragistics.Win.ValueList lit = new Infragistics.Win.ValueList();
  116. lit.ValueListItems.Add("0", "不含税");
  117. lit.ValueListItems.Add("", "不含税");
  118. lit.ValueListItems.Add("1", "含税");
  119. return lit;
  120. }
  121. // 区分内部价格维护和外部价格维护
  122. private string GetOrgDiv()
  123. {
  124. if (this.CustomInfo == "1" || this.CustomInfo == "3")
  125. return "1";
  126. else
  127. return "2";
  128. }
  129. public override void ToolBar_Click(object sender, string ToolbarKey)
  130. {
  131. if (ToolbarKey == "Query")
  132. this.Query();
  133. if (ToolbarKey == "QueryOrg")
  134. this.QueryOrgPrice();
  135. if (ToolbarKey == "Update")
  136. this.UpdatePrice();
  137. if (ToolbarKey == "UpdateOrg")
  138. this.UpdateOrgPrice();
  139. if (ToolbarKey == "Exit")
  140. this.Close();
  141. if (ToolbarKey == "Affrim")
  142. this.AffrimPrice();
  143. if (ToolbarKey == "AffrimOrg")
  144. this.AffrimOrgPrice();
  145. if (ToolbarKey == "UnAffrim")
  146. this.UnAffrimPrice();
  147. if (ToolbarKey == "UnAffrimOrg")
  148. this.UnAffrimOrgPrice();
  149. if (ToolbarKey == "ImpPrice")
  150. this.BatchUpdateOrderLinBalPrice();
  151. }
  152. private void SetOrderLnStatus()
  153. {
  154. if (this.combaseinfo == null)
  155. return;
  156. if (this.combaseinfo.Tables.Count == 0 || this.combaseinfo.Tables[0].Rows.Count == 0)
  157. return;
  158. foreach (DataRow dr in this.dsMain.Tables[0].Rows)
  159. {
  160. DataRow[] drs = combaseinfo.Tables[0].Select(string.Format(" BASECODE = '{0}' ", dr["ORDER_LN_STATUS"].ToString()));
  161. try
  162. {
  163. dr["ORDER_LN_STATUS"] = drs[0]["BASENAME"];
  164. }
  165. catch
  166. { }
  167. }
  168. }
  169. private void QueryOrgPrice()
  170. {
  171. DataSet ds = null;
  172. if (this.checkBox1.Checked)
  173. {
  174. ds = this.slmOrderBll.GetSlmOrderLineByCreateTime(this.dateTimePicker1.Value,
  175. this.dateTimePicker2.Value);
  176. }
  177. else
  178. {
  179. ds = this.slmOrderBll.GetSlmOrderLineByCreateTime(System.DateTime.Now.AddYears(-100),
  180. System.DateTime.Now.AddYears(100));
  181. }
  182. if (this.textBox1.Text.Length > 0)
  183. {
  184. ds = this.slmOrderBll.GetSlmOrderLineByOrderNoWithApproximateMatch(this.textBox1.Text.Trim());
  185. // ds = Util.UtilDataSet.GetDataSetWithRowFilterWithApproximateMatch(ds, "ORDER_NO", this.textBox1.Text.Trim());
  186. }
  187. // 数据权限
  188. ds = base.GetDataSetByFilterDeptId(ds, "CREATE_DEPT");
  189. if (this.radioButton2.Checked)
  190. {
  191. ds = Util.UtilDataSet.GetDataSetWithRowFilter(ds, "BALNCE_PRICE_ORG_STS", new string[] { "", "0" });
  192. }
  193. if (this.radioButton1.Checked)
  194. {
  195. ds = Util.UtilDataSet.GetDataSetWithRowFilter(ds, "BALNCE_PRICE_ORG_STS", new string[] { "1" });
  196. }
  197. Util.UtilDataSet.SetDataSetByMergeSameColumnName(ref this.dsMain, ds);
  198. SetOrderLnStatus();
  199. }
  200. private void Query()
  201. {
  202. DataSet ds = null;
  203. if (this.checkBox1.Checked)
  204. {
  205. ds = this.slmOrderBll.GetSlmOrderLineByCreateTime(this.dateTimePicker1.Value,
  206. this.dateTimePicker2.Value);
  207. }
  208. else
  209. {
  210. ds = this.slmOrderBll.GetSlmOrderLineByCreateTime(System.DateTime.Now.AddYears(-100),
  211. System.DateTime.Now.AddYears(100));
  212. }
  213. if (this.textBox1.Text.Length > 0)
  214. {
  215. ds = this.slmOrderBll.GetSlmOrderLineByOrderNoWithApproximateMatch(this.textBox1.Text.Trim());
  216. // ds = Util.UtilDataSet.GetDataSetWithRowFilterWithApproximateMatch(ds, "ORDER_NO", this.textBox1.Text.Trim());
  217. }
  218. // 数据权限
  219. ds = base.GetDataSetByFilterDeptId(ds, "CREATE_DEPT");
  220. if (this.radioButton2.Checked)
  221. {
  222. ds = Util.UtilDataSet.GetDataSetWithRowFilter(ds, "BALNCE_PRICE_STS", new string[] { "", "0" });
  223. }
  224. if (this.radioButton1.Checked)
  225. {
  226. ds = Util.UtilDataSet.GetDataSetWithRowFilter(ds, "BALNCE_PRICE_STS", new string[] { "1" });
  227. }
  228. if (!this.UserInfo.GetUserName().Equals("admin"))
  229. ds = base.GetDataSetByFilterDeptId(ds);
  230. Util.UtilDataSet.SetDataSetByMergeSameColumnName(ref this.dsMain, ds);
  231. SetOrderLnStatus();
  232. }
  233. protected override List<string> GetGridColumnListHidden()
  234. {
  235. if (GetOrgDiv() == "1")
  236. return new List<string>(GetBalPriceHIddenColumn());
  237. else
  238. return new List<string>(GetOrgBalPriceHIddenColumn());
  239. }
  240. private string[] GetBalPriceHIddenColumn()
  241. {
  242. return new string[] {ORD_PK ,this.ORD_LN_PK, "BALNCE_PRICE_STS",
  243. "BALNCE_PRICE_ORG_STS","BALNCE_PRICE_ORG" };
  244. }
  245. private string[] GetOrgBalPriceHIddenColumn()
  246. {
  247. return new string[] {ORD_PK ,this.ORD_LN_PK, "BALNCE_PRICE_STS",
  248. "BALNCE_PRICE_ORG_STS","BALNCE_PRICE" };
  249. }
  250. private string ORD_PK = "ORD_PK";
  251. private string ORD_LN_PK = "ORD_LN_PK";
  252. private void UpdatePrice()
  253. {
  254. this.ultraGrid1.UpdateData();
  255. Infragistics.Win.UltraWinGrid.UltraGridRow ugr = null;
  256. if (this.ultraGrid1.Rows.Count == 0)
  257. return;
  258. if (this.ultraGrid1.Rows.Count == 1)
  259. ugr = this.ultraGrid1.Rows[0];
  260. else
  261. ugr = this.ultraGrid1.ActiveRow;
  262. if (ugr == null)
  263. {
  264. MessageBox.Show("请选择修改的行");
  265. return;
  266. }
  267. if (Util.MessageUtil.ShowYesNoAndQuestion("是否确定修改合同行价格?") == DialogResult.No) return;
  268. if (Util.ConverObject.ConvertToDouble(ugr.Cells["BALNCE_PRICE"].Value) == 0)
  269. {
  270. MessageBox.Show("请输入正确价格");
  271. return;
  272. }
  273. string errMsg = "";
  274. this.slmOrderBll.UpdateFinallBalPrice(ugr.Cells[this.ORD_LN_PK].Value.ToString(),
  275. ugr.Cells["BALNCE_PRICE"].Value.ToString(),
  276. CoreFS.SA06.CoreUserInfo.UserInfo.GetUserName(), out errMsg
  277. );
  278. if (errMsg.Length == 0)
  279. {
  280. MessageBox.Show("操作成功");
  281. }
  282. }
  283. private void UpdateOrgPrice()
  284. {
  285. this.ultraGrid1.UpdateData();
  286. Infragistics.Win.UltraWinGrid.UltraGridRow ugr = null;
  287. if (this.ultraGrid1.Rows.Count == 0)
  288. return;
  289. if (this.ultraGrid1.Rows.Count == 1)
  290. ugr = this.ultraGrid1.Rows[0];
  291. else
  292. ugr = this.ultraGrid1.ActiveRow;
  293. if (ugr == null)
  294. {
  295. Util.MessageUtil.ShowError("请选择修改的行");
  296. return;
  297. }
  298. if (Util.MessageUtil.ShowYesNoAndQuestion("是否确定修改合同行价格?") == DialogResult.No) return;
  299. if (Util.ConverObject.ConvertToDouble(ugr.Cells["BALNCE_PRICE_ORG"].Value) == 0)
  300. {
  301. Util.MessageUtil.ShowError("请输入正确价格");
  302. return;
  303. }
  304. string errMsg = "";
  305. this.slmOrderBll.UpdateFinallBalPriceOrg(ugr.Cells[this.ORD_LN_PK].Value.ToString(),
  306. ugr.Cells["BALNCE_PRICE_ORG"].Value.ToString(),
  307. CoreFS.SA06.CoreUserInfo.UserInfo.GetUserName(), out errMsg
  308. );
  309. if (errMsg.Length == 0)
  310. {
  311. MessageBox.Show("操作成功");
  312. }
  313. }
  314. private void AffrimPrice()
  315. {
  316. this.ultraGrid1.UpdateData();
  317. Infragistics.Win.UltraWinGrid.UltraGridRow ugr = null;
  318. if (this.ultraGrid1.Rows.Count == 0)
  319. return;
  320. if (this.ultraGrid1.Rows.Count == 1)
  321. ugr = this.ultraGrid1.Rows[0];
  322. else
  323. ugr = this.ultraGrid1.ActiveRow;
  324. if (ugr == null)
  325. {
  326. MessageBox.Show("请选择确认的合同");
  327. return;
  328. }
  329. if (Util.MessageUtil.ShowYesNoAndQuestion("是否确定通过所选合同价格?") == DialogResult.No) return;
  330. ugr.Selected = true;
  331. ArrayList listorderno = new ArrayList();
  332. ArrayList listorderCanNotAffrim = new ArrayList();
  333. foreach (Infragistics.Win.UltraWinGrid.UltraGridRow ugrf in this.ultraGrid1.Selected.Rows)
  334. {
  335. string ord = ugrf.Cells[this.ORD_PK].Value.ToString();
  336. if (!listorderno.Contains(ord))
  337. {
  338. listorderno.Add(ord);
  339. }
  340. if (Util.ConverObject.ConvertToDouble(ugrf.Cells["BALNCE_PRICE"].Value) == 0)
  341. {
  342. if (!listorderCanNotAffrim.Contains(ord))
  343. {
  344. listorderCanNotAffrim.Add(ord);
  345. }
  346. }
  347. }
  348. foreach (Infragistics.Win.UltraWinGrid.UltraGridRow ugrf in this.ultraGrid1.Rows)
  349. {
  350. string ord = ugrf.Cells[this.ORD_PK].Value.ToString();
  351. if (listorderno.Contains(ord))
  352. {
  353. if (Util.ConverObject.ConvertToDouble(ugrf.Cells["BALNCE_PRICE"].Value) == 0)
  354. {
  355. MessageBox.Show("所选合同中有结算价格为0的行,请重新确认");
  356. return;
  357. }
  358. }
  359. }
  360. string msg = "";
  361. foreach (string sorder in listorderno)
  362. {
  363. if (listorderCanNotAffrim.Contains(sorder))
  364. continue;
  365. try
  366. {
  367. string errMsg = "";
  368. this.slmOrderBll.AffrimFinallBalPrice(sorder, CoreFS.SA06.CoreUserInfo.UserInfo.GetUserName(), out errMsg);
  369. if (errMsg.Length > 0)
  370. {
  371. msg += sorder + errMsg + "/";
  372. }
  373. }
  374. catch
  375. { }
  376. }
  377. if (msg.Length == 0)
  378. {
  379. MessageBox.Show("确认成功");
  380. }
  381. else
  382. {
  383. MessageBox.Show(msg);
  384. }
  385. this.Query();
  386. }
  387. private void UnAffrimPrice()
  388. {
  389. this.ultraGrid1.UpdateData();
  390. Infragistics.Win.UltraWinGrid.UltraGridRow ugr = null;
  391. if (this.ultraGrid1.Rows.Count == 0)
  392. return;
  393. if (this.ultraGrid1.Rows.Count == 1)
  394. ugr = this.ultraGrid1.Rows[0];
  395. else
  396. ugr = this.ultraGrid1.ActiveRow;
  397. if (ugr == null)
  398. {
  399. MessageBox.Show("请选择取消确认的合同");
  400. return;
  401. }
  402. if (Util.MessageUtil.ShowYesNoAndQuestion("是否确定取消所选合同价格?") == DialogResult.No) return;
  403. ugr.Selected = true;
  404. ArrayList listorderno = new ArrayList();
  405. ArrayList listorderCanNotAffrim = new ArrayList();
  406. foreach (Infragistics.Win.UltraWinGrid.UltraGridRow ugrf in this.ultraGrid1.Selected.Rows)
  407. {
  408. string ord = ugrf.Cells[this.ORD_PK].Value.ToString();
  409. if (!listorderno.Contains(ord))
  410. {
  411. listorderno.Add(ord);
  412. }
  413. }
  414. string msg = "";
  415. foreach (string sorder in listorderno)
  416. {
  417. try
  418. {
  419. string errMsg = "";
  420. this.slmOrderBll.UnAffrimFinallBalPrice(sorder, CoreFS.SA06.CoreUserInfo.UserInfo.GetUserName(), out errMsg);
  421. if (errMsg.Length > 0)
  422. {
  423. msg += sorder + errMsg + "/";
  424. }
  425. }
  426. catch
  427. { }
  428. }
  429. if (msg.Length == 0)
  430. {
  431. MessageBox.Show("取消确认成功");
  432. }
  433. else
  434. {
  435. MessageBox.Show(msg);
  436. }
  437. this.Query();
  438. }
  439. private void AffrimOrgPrice()
  440. {
  441. this.ultraGrid1.UpdateData();
  442. Infragistics.Win.UltraWinGrid.UltraGridRow ugr = null;
  443. if (this.ultraGrid1.Rows.Count == 0)
  444. return;
  445. if (this.ultraGrid1.Rows.Count == 1)
  446. ugr = this.ultraGrid1.Rows[0];
  447. else
  448. ugr = this.ultraGrid1.ActiveRow;
  449. if (ugr == null)
  450. {
  451. MessageBox.Show("请选择取消确认的合同");
  452. return;
  453. }
  454. if (Util.MessageUtil.ShowYesNoAndQuestion("是否确定取消所选合同价格?") == DialogResult.No) return;
  455. ugr.Selected = true;
  456. ArrayList listorderno = new ArrayList();
  457. ArrayList listorderCanNotAffrim = new ArrayList();
  458. foreach (Infragistics.Win.UltraWinGrid.UltraGridRow ugrf in this.ultraGrid1.Selected.Rows)
  459. {
  460. string ord = ugrf.Cells[this.ORD_PK].Value.ToString();
  461. if (!listorderno.Contains(ord))
  462. {
  463. listorderno.Add(ord);
  464. }
  465. }
  466. string msg = "";
  467. foreach (string sorder in listorderno)
  468. {
  469. try
  470. {
  471. string errMsg = "";
  472. this.slmOrderBll.AffrimFinallBalPriceOrg(sorder, CoreFS.SA06.CoreUserInfo.UserInfo.GetUserName(), out errMsg);
  473. if (errMsg.Length > 0)
  474. {
  475. msg += sorder + errMsg + "/";
  476. }
  477. }
  478. catch
  479. { }
  480. }
  481. if (msg.Length == 0)
  482. {
  483. this.Query();
  484. MessageBox.Show("确认成功");
  485. }
  486. else
  487. {
  488. MessageBox.Show(msg);
  489. }
  490. }
  491. private void UnAffrimOrgPrice()
  492. {
  493. this.ultraGrid1.UpdateData();
  494. Infragistics.Win.UltraWinGrid.UltraGridRow ugr = null;
  495. if (this.ultraGrid1.Rows.Count == 0)
  496. return;
  497. if (this.ultraGrid1.Rows.Count == 1)
  498. ugr = this.ultraGrid1.Rows[0];
  499. else
  500. ugr = this.ultraGrid1.ActiveRow;
  501. if (ugr == null)
  502. {
  503. Util.MessageUtil.ShowTips("请选择确认的合同");
  504. return;
  505. }
  506. if (Util.MessageUtil.ShowYesNoAndQuestion("是否确定通过所选合同价格?") == DialogResult.No) return;
  507. ugr.Selected = true;
  508. ArrayList listorderno = new ArrayList();
  509. ArrayList listorderCanNotAffrim = new ArrayList();
  510. foreach (Infragistics.Win.UltraWinGrid.UltraGridRow ugrf in this.ultraGrid1.Selected.Rows)
  511. {
  512. string ord = ugrf.Cells[this.ORD_PK].Value.ToString();
  513. if (!listorderno.Contains(ord))
  514. {
  515. listorderno.Add(ord);
  516. }
  517. if (Util.ConverObject.ConvertToDouble(ugrf.Cells["BALNCE_PRICE_ORG"].Value) == 0)
  518. {
  519. if (!listorderCanNotAffrim.Contains(ord))
  520. {
  521. listorderCanNotAffrim.Add(ord);
  522. }
  523. }
  524. }
  525. foreach (Infragistics.Win.UltraWinGrid.UltraGridRow ugrf in this.ultraGrid1.Rows)
  526. {
  527. string ord = ugrf.Cells[this.ORD_PK].Value.ToString();
  528. if (listorderno.Contains(ord))
  529. {
  530. if (Util.ConverObject.ConvertToDouble(ugrf.Cells["BALNCE_PRICE_ORG"].Value) == 0)
  531. {
  532. Util.MessageUtil.ShowTips("所选合同中有结算价格为0的行,请重新确认");
  533. return;
  534. }
  535. }
  536. }
  537. string msg = "";
  538. foreach (string sorder in listorderno)
  539. {
  540. if (listorderCanNotAffrim.Contains(sorder))
  541. continue;
  542. try
  543. {
  544. string errMsg = "";
  545. this.slmOrderBll.UnAffrimFinallBalPriceOrg(sorder, CoreFS.SA06.CoreUserInfo.UserInfo.GetUserName(), out errMsg);
  546. if (errMsg.Length > 0)
  547. {
  548. msg += sorder + errMsg + "/";
  549. }
  550. }
  551. catch
  552. { }
  553. }
  554. if (msg.Length == 0)
  555. {
  556. this.Query();
  557. Util.MessageUtil.ShowTips("确认成功");
  558. }
  559. else
  560. {
  561. Util.MessageUtil.ShowError(msg);
  562. }
  563. }
  564. private string[] GetDataStruct()
  565. {
  566. return new string[]
  567. {
  568. "BALNCE_PRICE",
  569. "BALNCE_PRICE_ORG",
  570. "BLA_PRICE",
  571. "CONTAIN_TAX",
  572. "ORDER_NO",
  573. "ORDER_SEQ",
  574. "ORDER_SPEC_DESC",
  575. "STEELNAME",
  576. "MODEL_DESC",
  577. "STD_NAME",
  578. "ORDER_LN_STATUS",
  579. "SPEC_NAME",
  580. "CUSTOMER_NM",
  581. "STLMT_UNIT_NM",
  582. "SALE_ORG_DESC",
  583. "SALE_AREA_DESC",
  584. "DIMATER",
  585. "HEIGHT",
  586. "LEN_DESC",
  587. "ORD_PK",
  588. "ORD_LN_PK",
  589. "BALNCE_PRICE_STS",
  590. "BALNCE_PRICE_ORG_STS"
  591. };
  592. }
  593. private Hashtable GetColumnCaption()
  594. {
  595. Hashtable hs = new Hashtable();
  596. hs.Add("BALNCE_PRICE", "结算价");
  597. hs.Add("BALNCE_PRICE_ORG", "结算价");
  598. hs.Add("BLA_PRICE", "订单价");
  599. hs.Add("CUSTOMER_NM", "订货单位");
  600. hs.Add("STLMT_UNIT_NM", "结算单位");
  601. hs.Add("ORDER_LN_STATUS", "合同状态");
  602. hs.Add("SALE_ORG_DESC", "销售组织");
  603. hs.Add("SALE_AREA_DESC", "区域");
  604. hs.Add("SPEC_NAME", "产品规格");
  605. hs.Add("ORDER_SPEC_DESC", "订货规格");
  606. hs.Add("STD_NAME", "标准");
  607. hs.Add("DIMATER", "外径");
  608. hs.Add("HEIGHT", "壁厚");
  609. hs.Add("MODEL_DESC", "扣型");
  610. hs.Add("LEN_DESC", "长度描述");
  611. hs.Add("ORDER_NO", "合同号");
  612. hs.Add("ORDER_SEQ", "行号");
  613. hs.Add("STEELNAME", "牌号");
  614. hs.Add("CONTAIN_TAX", "是否含税");
  615. return hs;
  616. }
  617. private Hashtable GetColumnDataType()
  618. {
  619. Hashtable hs = new Hashtable();
  620. hs.Add("FINAL_BALPRICE", "System.Decimal");
  621. return hs;
  622. }
  623. private void groupBox1_Enter(object sender, EventArgs e)
  624. {
  625. }
  626. private void button1_Click(object sender, EventArgs e)
  627. {
  628. this.BatchUpdateOrderLinBalPrice();
  629. }
  630. private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
  631. {
  632. if(e.KeyChar == 13)
  633. {
  634. if (this.GetOrgDiv() == "1")
  635. this.Query();
  636. else
  637. this.QueryOrgPrice();
  638. }
  639. }
  640. }
  641. }