FrmOrderMoneyAsk.cs 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9. using CoreFS.CA06;
  10. using Core.Mes.Client.Comm.Server;
  11. using Infragistics.Win.UltraWinGrid;
  12. using System.Collections;
  13. using Core.Mes.Client.Comm.Tool;
  14. using Core.Mes.Client.Comm.Control;
  15. using Core.StlMes.Client.SaleOrder;
  16. namespace Core.StlMes.Client.SaleOrder
  17. {
  18. public partial class FrmOrderMoneyAsk : FrmBase
  19. {
  20. int indexche = 0; //付款类型ID
  21. private DataTable order_pk = new DataTable();
  22. /// <summary>
  23. /// 合同头内部主键
  24. /// </summary>
  25. public DataTable Order_pk
  26. {
  27. set { order_pk = value; }
  28. }
  29. string manag_no = ""; //管理卡号
  30. string order_no = ""; //合同号
  31. string balnce_mny_no = "";//结算付款编号
  32. string balnce_mny_seq = "";//结算付款序号
  33. string payment_node = ""; //付款节点
  34. string term = "";//期限
  35. string term_unit = "";//日期单位(天/工作日/月)
  36. string payment_ratio = "";//付款比率(%)
  37. string stringAll = "";//返回拼接字符串
  38. DataTable tableOrder = new DataTable("SLM_ORDER_BALNCE_MNY");//返回给主界面
  39. public delegate void GetOrderMoneyAskHander(string stAll, DataTable retunData);
  40. public event GetOrderMoneyAskHander GetOrderMoneyAsk;
  41. private string askDesc = "";
  42. /// <summary>
  43. /// 付款要求
  44. /// </summary>
  45. public string AskDesc
  46. {
  47. get { return askDesc; }
  48. set { askDesc = value; }
  49. }
  50. public FrmOrderMoneyAsk()
  51. {
  52. InitializeComponent();
  53. }
  54. public FrmOrderMoneyAsk(string managName, string orderName)
  55. {
  56. manag_no = managName;
  57. order_no = orderName;
  58. InitializeComponent();
  59. }
  60. private void ultraButtonClose_Click(object sender, EventArgs e)
  61. {
  62. this.Close();
  63. }
  64. private void MSBox_ValueChanged(object sender, EventArgs e)
  65. {
  66. if (this.MSBox.CheckedIndex != -1)
  67. {
  68. indexche = this.MSBox.CheckedIndex;
  69. }
  70. }
  71. private void MSBox_MouseCaptureChanged(object sender, EventArgs e)
  72. {
  73. if (this.MSBox.CheckedIndex != -1)
  74. {
  75. this.MSBox.CheckedIndex = -1;
  76. }
  77. }
  78. private void ultraButtonCom_Click(object sender, EventArgs e)
  79. {
  80. tableOrder.Clear();
  81. switch (indexche)
  82. {
  83. case 0:
  84. this.stringAll = this.MS001Lab.Text;
  85. tableOrder.Rows.Add(manag_no, order_no, "MS001", "001", "121101", 0, " ", "100", stringAll); //付全款排产
  86. break;
  87. case 1:
  88. //付%款排产,收余下款发货。
  89. if (Convert.ToInt32(MS002Editor1.Value) > 100)
  90. {
  91. MessageUtil.ShowWarning("填写的百分比不能大于100%。");
  92. break;
  93. }
  94. if (Convert.ToInt32(MS002Editor0.Value) == 0)
  95. {
  96. MessageUtil.ShowWarning("填写的合同签订XXX日内必须大于0");
  97. MS002Editor0.Focus();
  98. break;
  99. }
  100. this.stringAll = this.MS002Lab0.Text +this.MS002Editor0.Value.ToString()+ this.MS002Lab1.Text + this.MS002Editor1.Value.ToString() + this.MS002Lab2.Text;
  101. tableOrder.Rows.Add(manag_no, order_no, "MS002", "001", "121101", 0, " ", this.MS002Editor1.Value.ToString(), stringAll);
  102. tableOrder.Rows.Add(manag_no, order_no, "MS002", "002", "121102", 0, " ", Convert.ToString(100 - Convert.ToInt32(this.MS002Editor1.Value)), stringAll);
  103. break;
  104. case 2:
  105. if (Convert.ToInt32(MS003Editor0.Value) == 0)
  106. {
  107. MessageUtil.ShowWarning("填写的合同签订XXX日内必须大于0");
  108. MS003Editor0.Focus();
  109. break;
  110. }
  111. this.stringAll = this.MS003Lab0.Text +this.MS003Editor0.Value.ToString()+this.MS003Lab1.Text;
  112. tableOrder.Rows.Add(manag_no, order_no, "MS003", "001", "121102", 0, " ", "100", stringAll); //付全款发货
  113. break;
  114. case 3:
  115. //支付%款后发货,发货以后多少天付款,付款比例不写。
  116. if (Convert.ToInt32(MS004Editor1.Value) > 100)
  117. {
  118. MessageUtil.ShowWarning("填写的百分比不能大于100%。");
  119. break;
  120. }
  121. if (Convert.ToInt32(MS004Editor0.Value) == 0)
  122. {
  123. MessageUtil.ShowWarning("填写的合同签订XXX日内必须大于0");
  124. MS004Editor0.Focus();
  125. break;
  126. }
  127. this.stringAll = this.MS004Lab0.Text + this.MS004Editor0.Value.ToString() + this.MS004Lab1.Text + this.MS004Editor1.Value.ToString() + this.MS004Lab2.Text + this.MS004Editor2.Value.ToString() + this.MS004Lab3.Text;
  128. tableOrder.Rows.Add(manag_no, order_no, "MS004", "001", "121102", 0, " ", this.MS004Editor1.Value.ToString(), stringAll);
  129. tableOrder.Rows.Add(manag_no, order_no, "MS004", "002", "121103", Convert.ToInt32(this.MS004Editor2.Value), "天", Convert.ToString(100 - Convert.ToInt32(this.MS004Editor1.Value)), stringAll);
  130. break;
  131. case 4:
  132. //支付%款后发货,发货以后多少天付%款无付款比例,质保期多少个月付清余款有付款比例。
  133. if ((Convert.ToInt32(MS005Editor1.Value) + Convert.ToInt32(MS005Editor3.Value)) > 100)
  134. {
  135. MessageUtil.ShowWarning("填写的百分比不能大于100%。");
  136. break;
  137. }
  138. if (Convert.ToInt32(MS005Editor0.Value) == 0)
  139. {
  140. MessageUtil.ShowWarning("填写的合同签订XXX日内必须大于0");
  141. MS005Editor0.Focus();
  142. break;
  143. }
  144. this.stringAll = this.MS005Lab0.Text + this.MS005Editor0.Value.ToString() + this.MS005Lab1.Text + this.MS005Editor1.Value.ToString() + this.MS005Lab2.Text + this.MS005Editor2.Value.ToString() + this.MS005Lab3.Text + this.MS005Editor3.Value.ToString() + this.MS005Lab4.Text + this.MS005Editor4.Value.ToString() + this.MS005Label5.Text;
  145. tableOrder.Rows.Add(manag_no, order_no, "MS005", "001", "121102", 0, " ", this.MS005Editor1.Value.ToString(), stringAll);
  146. tableOrder.Rows.Add(manag_no, order_no, "MS005", "002", "121103", Convert.ToInt32(this.MS005Editor2.Value), "天", Convert.ToString(100 - Convert.ToInt32(this.MS005Editor1.Value)), stringAll);
  147. tableOrder.Rows.Add(manag_no, order_no, "MS005", "003", "121107", Convert.ToInt32(this.MS005Editor4.Value), "月", Convert.ToString(this.MS005Editor3.Value), stringAll);
  148. break;
  149. case 5:
  150. //支付%款后发货,发货以后多少天付清%款。
  151. if (Convert.ToInt32(MS006Editor1.Value) > 100)
  152. {
  153. MessageUtil.ShowWarning("填写的百分比不能大于100%。");
  154. break;
  155. }
  156. if (Convert.ToInt32(MS006Editor0.Value) == 0)
  157. {
  158. MessageUtil.ShowWarning("填写的合同签订XXX日内必须大于0");
  159. MS006Editor0.Focus();
  160. break;
  161. }
  162. this.stringAll = this.MS006Lab0.Text + this.MS006Editor0.Value.ToString() + this.MS006Lab1.Text + this.MS006Editor1.Value.ToString() + this.MS006Lab2.Text + this.MS006Editor2.Value.ToString() + this.MS006Lab3.Text;
  163. tableOrder.Rows.Add(manag_no, order_no, "MS006", "001", "121102", 0, " ", this.MS006Editor1.Value.ToString(), stringAll);
  164. tableOrder.Rows.Add(manag_no, order_no, "MS006", "002", "121103", Convert.ToInt32(this.MS006Editor2.Value), "天", Convert.ToString(100 - Convert.ToInt32(this.MS006Editor1.Value)), stringAll);
  165. break;
  166. case 6:
  167. //支付%款后发货,发货收齐以后多少天付%款无付款比例,质保期多少个月付清余款有付款比例。
  168. if ((Convert.ToInt32(MS007Editor1.Value) + Convert.ToInt32(MS007Editor3.Value)) > 100)
  169. {
  170. MessageUtil.ShowWarning("填写的百分比不能大于100%。");
  171. break;
  172. }
  173. if (Convert.ToInt32(MS007Editor0.Value) == 0)
  174. {
  175. MessageUtil.ShowWarning("填写的合同签订XXX日内必须大于0");
  176. MS007Editor0.Focus();
  177. break;
  178. }
  179. this.stringAll = this.MS007Lab0.Text + this.MS007Editor0.Value.ToString() + this.MS007Lab1.Text + this.MS007Editor1.Value.ToString() + this.MS007Lab2.Text + this.MS007Editor2.Value.ToString() + this.MS007Lab3.Text + this.MS007Editor3.Value.ToString() + this.MS007Lab4.Text + this.MS007Editor4.Value.ToString() + this.MS007Lab5.Text;
  180. tableOrder.Rows.Add(manag_no, order_no, "MS007", "001", "121102", 0, " ", this.MS007Editor1.Value.ToString(), stringAll);
  181. tableOrder.Rows.Add(manag_no, order_no, "MS007", "002", "121104", Convert.ToInt32(this.MS007Editor2.Value), "天", 0, stringAll);
  182. tableOrder.Rows.Add(manag_no, order_no, "MS007", "003", "121107", Convert.ToInt32(this.MS007Editor4.Value), "月", Convert.ToString(this.MS007Editor3.Value), stringAll);
  183. break;
  184. case 7:
  185. //支付%款后发货,余款发票开出后多少天付款,付款比例不写。
  186. if (Convert.ToInt32(MS008Editor1.Value) > 100)
  187. {
  188. MessageUtil.ShowWarning("填写的百分比不能大于100%。");
  189. break;
  190. }
  191. if (Convert.ToInt32(MS008Editor0.Value) == 0)
  192. {
  193. MessageUtil.ShowWarning("填写的合同签订XXX日内必须大于0");
  194. MS008Editor0.Focus();
  195. break;
  196. }
  197. this.stringAll = this.MS008Lab0.Text + this.MS008Editor0.Value.ToString() + this.MS008Lab1.Text + this.MS008Editor1.Value.ToString() + this.MS008Lab2.Text + this.MS008Editor2.Value.ToString() + this.MS008Lab3.Text;
  198. tableOrder.Rows.Add(manag_no, order_no, "MS008", "001", "121102", 0, " ", this.MS008Editor1.Value.ToString(), stringAll);
  199. tableOrder.Rows.Add(manag_no, order_no, "MS008", "002", "121105", Convert.ToInt32(this.MS008Editor2.Value), "天", 0, stringAll);
  200. break;
  201. case 8:
  202. //支付%款后发货,余款发票开出后多少天付款,付款比例不写,质保期多少个月付清余款有付款比例。
  203. if ((Convert.ToInt32(MS009Editor1.Value) + Convert.ToInt32(MS009Editor3.Value)) > 100)
  204. {
  205. MessageUtil.ShowWarning("填写的百分比不能大于100%。");
  206. break;
  207. }
  208. if (Convert.ToInt32(MS009Editor0.Value) == 0)
  209. {
  210. MessageUtil.ShowWarning("填写的合同签订XXX日内必须大于0");
  211. MS009Editor0.Focus();
  212. break;
  213. }
  214. this.stringAll = this.MS009Lab0.Text + this.MS009Editor0.Value.ToString() + this.MS009Lab1.Text + this.MS009Editor1.Value.ToString() + this.MS009Lab2.Text + this.MS009Editor2.Value.ToString() + this.MS009Lab3.Text + this.MS009Editor3.Value.ToString() + this.MS009Lab4.Text + this.MS009Editor4.Value.ToString() + this.MS009Lab5.Text;
  215. tableOrder.Rows.Add(manag_no, order_no, "MS009", "001", "121102", 0, " ", this.MS009Editor1.Value.ToString(), stringAll);
  216. tableOrder.Rows.Add(manag_no, order_no, "MS009", "002", "121105", Convert.ToInt32(this.MS009Editor2.Value), "天", 0, stringAll);
  217. tableOrder.Rows.Add(manag_no, order_no, "MS009", "003", "121107", Convert.ToInt32(this.MS009Editor4.Value), "月", Convert.ToString(this.MS009Editor3.Value), stringAll);
  218. break;
  219. case 9:
  220. //1:排产%付款,2.付款%多少发运。百分比:排产-付款前发运=发票开出后多少天付款比例。
  221. if ((Convert.ToInt32(MS010Editor1.Value) + Convert.ToInt32(MS010Editor2.Value)) > 100)
  222. {
  223. MessageUtil.ShowWarning("填写的百分比不能大于100%。");
  224. break;
  225. }
  226. if (Convert.ToInt32(MS010Editor0.Value) == 0)
  227. {
  228. MessageUtil.ShowWarning("填写的合同签订XXX日内必须大于0");
  229. MS010Editor0.Focus();
  230. break;
  231. }
  232. this.stringAll = this.MS010Lab0.Text + this.MS010Editor0.Value.ToString() + this.MS010Lab1.Text + this.MS010Editor1.Value.ToString() + this.MS010Lab2.Text + this.MS010Editor2.Value.ToString() + this.MS010Lab3.Text + this.MS010Editor3.Value.ToString() + this.MS010Lab4.Text;
  233. tableOrder.Rows.Add(manag_no, order_no, "MS010", "001", "121101", 0, " ", this.MS010Editor1.Value.ToString(), stringAll);
  234. tableOrder.Rows.Add(manag_no, order_no, "MS010", "002", "121102", 0, " ", this.MS010Editor2.Value.ToString(), stringAll);
  235. tableOrder.Rows.Add(manag_no, order_no, "MS010", "003", "121105", this.MS010Editor3.Value.ToString(), "天", Convert.ToString(100 - (Convert.ToInt32(this.MS010Editor1.Value) + Convert.ToInt32(this.MS010Editor2.Value))), stringAll);
  236. break;
  237. case 10:
  238. //1:排产%付款,2.付款%多少发运。百分比:排产-付款前发运=发票开出后多少天付款比例,质保金需要比例。
  239. if ((Convert.ToInt32(MS011Editor1.Value) + Convert.ToInt32(MS011Editor2.Value) + Convert.ToInt32(MS011Editor4.Value)) > 100)
  240. {
  241. MessageUtil.ShowWarning("填写的百分比不能大于100%。");
  242. break;
  243. }
  244. if (Convert.ToInt32(MS011Editor0.Value) == 0)
  245. {
  246. MessageUtil.ShowWarning("填写的合同签订XXX日内必须大于0");
  247. MS011Editor0.Focus();
  248. break;
  249. }
  250. this.stringAll = this.MS011Lab0.Text + this.MS011Editor0.Value.ToString() + this.MS011Lab1.Text + this.MS011Editor1.Value.ToString() + this.MS011Label2.Text + this.MS011Editor2.Value.ToString() + this.MS011Lab3.Text + this.MS011Editor3.Value.ToString() + this.MS011Lab4.Text + this.MS011Editor4.Value.ToString() + this.MS011Lab5.Text + this.MS011Editor5.Value.ToString() + this.MS011Label6.Text;
  251. tableOrder.Rows.Add(manag_no, order_no, "MS011", "001", "121101", 0, " ", this.MS011Editor1.Value.ToString(), stringAll);
  252. tableOrder.Rows.Add(manag_no, order_no, "MS011", "002", "121102", 0, " ", this.MS011Editor2.Value.ToString(), stringAll);
  253. tableOrder.Rows.Add(manag_no, order_no, "MS011", "003", "121105", this.MS011Editor3.Value.ToString(), "天", Convert.ToString(100 - (Convert.ToInt32(this.MS011Editor1.Value) + Convert.ToInt32(this.MS011Editor2.Value) + Convert.ToInt32(this.MS011Editor4.Value))), stringAll);
  254. //tableOrder.Rows.Add(manag_no, order_no, "MS011", "004", "121107", this.MS011Editor5.Value.ToString(), "月", Convert.ToString(this.MS011Editor5.Value), stringAll);
  255. tableOrder.Rows.Add(manag_no, order_no, "MS011", "004", "121107", this.MS011Editor5.Value.ToString(), "月", Convert.ToString(this.MS011Editor4.Value), stringAll);
  256. break;
  257. case 11:
  258. //1:货到多少工作日付款
  259. if ((Convert.ToInt32(MS012Editor1.Value)) > 100)
  260. {
  261. MessageUtil.ShowWarning("填写的百分比不能大于100%。");
  262. break;
  263. }
  264. this.stringAll = this.MS012Lab1.Text + this.MS012Editor1.Value.ToString() + this.MS012Lab2.Text;
  265. tableOrder.Rows.Add(manag_no, order_no, "MS012", "001", "121106", Convert.ToInt32(this.MS012Editor1.Value), "天", "100", stringAll);
  266. break;
  267. case 12:
  268. //1:货到多少工作日付款,保质期都有比列
  269. if (Convert.ToInt32(MS013Editor2.Value) > 100)
  270. {
  271. MessageUtil.ShowWarning("填写的百分比不能大于100%。");
  272. break;
  273. }
  274. this.stringAll = this.MS013Lab1.Text + this.MS013Editor1.Value.ToString() + this.MS013Label2.Text + this.MS013Editor2.Value.ToString() + this.MS013Lab3.Text + this.MS013Editor3.Value.ToString() + this.MS013Lab4.Text;
  275. tableOrder.Rows.Add(manag_no, order_no, "MS013", "001", "121106", Convert.ToInt32(this.MS013Editor1.Value), "天", Convert.ToString(100 - (Convert.ToInt32(this.MS013Editor2.Value))), stringAll);
  276. tableOrder.Rows.Add(manag_no, order_no, "MS013", "002", "121107", this.MS013Editor3.Value.ToString(), "月", this.MS013Editor2.Value.ToString(), stringAll);
  277. break;
  278. case 13:
  279. //1:开票后出多少
  280. //if (Convert.ToInt32(MS014Editor1.Value) > 100)
  281. //{
  282. // MessageUtil.ShowWarning("填写的百分比不能大于100%。");
  283. // break;
  284. //}
  285. this.stringAll = this.MS014Lab1.Text + this.MS014Editor1.Value.ToString() + this.MS014Label2.Text;
  286. tableOrder.Rows.Add(manag_no, order_no, "MS014", "001", "121105", Convert.ToInt32(this.MS014Editor1.Value), "天", "100", stringAll);
  287. break;
  288. case 14:
  289. //1:开票后出多少工作日付款,保质期都有比列
  290. if (Convert.ToInt32(MS015Editor2.Value) > 100)
  291. {
  292. MessageUtil.ShowWarning("填写的百分比不能大于100%。");
  293. break;
  294. }
  295. //this.stringAll = this.MS015Lab1.Text + this.MS015Editor1.Value.ToString() + this.MS015Lab2.Text + this.MS015Editor2.Value.ToString() + this.MS015Lab3.Text + this.MS015Editor3.Value.ToString() + this.MS015Lab4.Text;
  296. //tableOrder.Rows.Add(manag_no, order_no, "MS015", "001", "121106", Convert.ToInt32(this.MS015Editor1.Value), "天", Convert.ToString(100 - Convert.ToInt32(this.MS015Editor2.Value)), stringAll);
  297. //tableOrder.Rows.Add(manag_no, order_no, "MS015", "002", "121107", 0, " ", this.MS015Editor2.Value.ToString(), stringAll);
  298. this.stringAll = this.MS015Lab1.Text + this.MS015Editor1.Value.ToString() + this.MS015Lab2.Text + this.MS015Editor2.Value.ToString() + this.MS015Lab3.Text + this.MS015Editor3.Value.ToString() + this.MS015Lab4.Text;
  299. tableOrder.Rows.Add(manag_no, order_no, "MS015", "001", "121106", Convert.ToInt32(this.MS015Editor1.Value), "天", Convert.ToString(100 - Convert.ToInt32(this.MS015Editor2.Value)), stringAll);
  300. tableOrder.Rows.Add(manag_no, order_no, "MS015", "002", "121107", Convert.ToInt32(this.MS015Editor3.Value), "月", this.MS015Editor2.Value.ToString(), stringAll);
  301. break;
  302. case 15:
  303. this.stringAll = "/";
  304. break;
  305. case 16:
  306. this.stringAll = "即期";
  307. break;
  308. case 17:
  309. this.stringAll = "远期";
  310. break;
  311. case 18:
  312. if (MS018Editor1.Value == null || MS018Editor2.Value == null)
  313. {
  314. MessageUtil.ShowWarning("请填入百分比!");
  315. break;
  316. }
  317. if (Convert.ToDouble(MS018Editor1.Value) + Convert.ToDouble(MS018Editor2.Value) > 100)
  318. {
  319. MessageUtil.ShowWarning("填写的百分比不能大于100%。");
  320. break;
  321. }
  322. if (Convert.ToInt32(MS018Editor0.Value) == 0)
  323. {
  324. MessageUtil.ShowWarning("填写的合同签订XXX日内必须大于0");
  325. MS018Editor0.Focus();
  326. break;
  327. }
  328. stringAll = this.MS018Lab0.Text + this.MS018Editor0.Value.ToString() + MS018Lab2.Text + MS018Editor1.Value.ToString() + MS018Lab3.Text + MS018Editor2.Value.ToString() + MS018Lab4.Text;
  329. tableOrder.Rows.Add(manag_no, order_no, "MS016", "001", "121102", 0, "", this.MS018Editor1.Value.ToString(), stringAll);
  330. tableOrder.Rows.Add(manag_no, order_no, "MS016", "002", "121102", 0, "", this.MS018Editor2.Value.ToString(), stringAll);
  331. break;
  332. case 19:
  333. if (MS019Editor1.Value == null)
  334. {
  335. MessageUtil.ShowWarning("请输入天数!");
  336. break;
  337. }
  338. stringAll = MS019Lab1.Text + MS019Editor1.Value.ToString() + MS019Lab2.Text;
  339. tableOrder.Rows.Add(manag_no, order_no, "MS017", "001", "121108", Convert.ToInt16(this.MS019Editor1.Value.ToString()), "天", "", stringAll);
  340. break;
  341. case 20:
  342. this.stringAll = "按协议付款";
  343. break;
  344. case 21:
  345. this.stringAll = "持票付款";
  346. break;
  347. case 22:
  348. this.stringAll = "抹账购管";
  349. break;
  350. case 23:
  351. this.stringAll = "与坯料合同货款对冲后,带款提货";
  352. break;
  353. case 24:
  354. this.stringAll = "当月开票货款,当月全部结清";
  355. break;
  356. case 25:
  357. if (MS025Editor1.Value == null || MS025Editor2.Value == null)
  358. {
  359. MessageUtil.ShowWarning("请输入天数!");
  360. break;
  361. }
  362. stringAll = MS025Lab1.Text + MS025Editor1.Value.ToString() + MS025Lab2.Text + MS025Editor2.Value.ToString() + MS025Lab3.Text;
  363. //tableOrder.Rows.Add(manag_no, order_no, "MS017", "001", "121108", Convert.ToInt16(this.MS019Editor1.Value.ToString()), "天", "", stringAll);
  364. break;
  365. case 26:
  366. if (txtMemo.Text.Trim() == "")
  367. {
  368. MessageUtil.ShowWarning("请输入备注信息!");
  369. break;
  370. }
  371. this.stringAll = "见备注栏:" + txtMemo.Text.Trim();
  372. break;
  373. }
  374. //返回给主界面数据
  375. if (!stringAll.Trim().Equals(""))
  376. {
  377. GetOrderMoneyAsk(this.stringAll, this.tableOrder);
  378. this.Close();
  379. }
  380. }
  381. private void orderAskLoad_Call(DataTable table)
  382. {
  383. string balncemnyno = table.Rows.Count > 0 ? table.Rows[0]["BALNCE_MNY_NO"].ToString() : "MS000";
  384. switch (balncemnyno)
  385. {
  386. case "MS001":
  387. indexche = 0;
  388. this.MSBox.Items[0].ValueList.SelectedIndex = 0;
  389. break;
  390. case "MS002":
  391. indexche = 1;
  392. //付%款排产,收余下款发货。
  393. this.MSBox.Items[0].ValueList.SelectedIndex = 1;
  394. this.MS002Editor1.Value = table.Rows[0]["PAYMENT_RATIO"].ToString();
  395. break;
  396. case "MS003":
  397. indexche = 2;
  398. this.MSBox.Items[0].ValueList.SelectedIndex = 2;
  399. break;
  400. case "MS004":
  401. indexche = 3;
  402. //支付%款后发货,发货以后多少天付款,付款比例不写。
  403. this.MSBox.Items[0].ValueList.SelectedIndex = 3;
  404. this.MS004Editor1.Value = table.Rows[0]["PAYMENT_RATIO"].ToString();
  405. this.MS004Editor2.Value = table.Rows[1]["PAYMENT_RATIO"].ToString();
  406. break;
  407. case "MS005":
  408. indexche = 4;
  409. //支付%款后发货,发货以后多少天付%款无付款比例,质保期多少个月付清余款有付款比例。
  410. this.MSBox.Items[0].ValueList.SelectedIndex = 4;
  411. this.MS005Editor1.Value = table.Rows[0]["PAYMENT_RATIO"].ToString();
  412. this.MS005Editor2.Value = table.Rows[1]["TERM"].ToString();
  413. this.MS005Editor3.Value = table.Rows[2]["PAYMENT_RATIO"].ToString();
  414. this.MS005Editor4.Value = table.Rows[2]["TERM"].ToString();
  415. break;
  416. case "MS006":
  417. indexche = 5;
  418. //支付%款后发货,发货以后多少天付清%款。
  419. this.MSBox.Items[0].ValueList.SelectedIndex = 5;
  420. this.MS006Editor1.Value = table.Rows[0]["PAYMENT_RATIO"].ToString();
  421. this.MS006Editor2.Value = table.Rows[1]["TERM"].ToString();
  422. break;
  423. case "MS007":
  424. indexche = 6;
  425. //支付%款后发货,发货收齐以后多少天付%款无付款比例,质保期多少个月付清余款有付款比例。
  426. this.MSBox.Items[0].ValueList.SelectedIndex = 6;
  427. this.MS007Editor1.Value = table.Rows[0]["PAYMENT_RATIO"].ToString();
  428. this.MS007Editor2.Value = table.Rows[1]["TERM"].ToString();
  429. this.MS007Editor3.Value = table.Rows[2]["TERM"].ToString();
  430. this.MS007Editor4.Value = table.Rows[2]["PAYMENT_RATIO"].ToString();
  431. break;
  432. case "MS008":
  433. indexche = 7;
  434. //支付%款后发货,余款发票开出后多少天付款,付款比例不写。
  435. this.MSBox.Items[0].ValueList.SelectedIndex = 7;
  436. this.MS008Editor1.Value = table.Rows[0]["PAYMENT_RATIO"].ToString();
  437. this.MS008Editor2.Value = table.Rows[1]["TERM"].ToString();
  438. break;
  439. case "MS009":
  440. indexche = 8;
  441. //支付%款后发货,余款发票开出后多少天付款,付款比例不写,质保期多少个月付清余款有付款比例。
  442. this.MSBox.Items[0].ValueList.SelectedIndex = 8;
  443. this.MS009Editor1.Value = table.Rows[0]["PAYMENT_RATIO"].ToString();
  444. this.MS009Editor2.Value = table.Rows[1]["TERM"].ToString();
  445. this.MS009Editor3.Value = table.Rows[2]["PAYMENT_RATIO"].ToString();
  446. this.MS009Editor4.Value = table.Rows[2]["TERM"].ToString();
  447. break;
  448. case "MS010":
  449. indexche = 9;
  450. //1:排产%付款,2.付款%多少发运。百分比:排产-付款前发运=发票开出后多少天付款比例。
  451. this.MSBox.Items[0].ValueList.SelectedIndex = 9;
  452. this.MS010Editor1.Value = table.Rows[0]["PAYMENT_RATIO"].ToString();
  453. this.MS010Editor2.Value = table.Rows[1]["PAYMENT_RATIO"].ToString();
  454. this.MS010Editor3.Value = table.Rows[2]["TERM"].ToString();
  455. break;
  456. case "MS011":
  457. indexche = 10;
  458. //1:排产%付款,2.付款%多少发运。百分比:排产-付款前发运=发票开出后多少天付款比例,质保金需要比例。
  459. this.MSBox.Items[0].ValueList.SelectedIndex = 10;
  460. this.MS011Editor1.Value = table.Rows[0]["PAYMENT_RATIO"].ToString();
  461. this.MS011Editor2.Value = table.Rows[1]["PAYMENT_RATIO"].ToString();
  462. this.MS011Editor3.Value = table.Rows[2]["PAYMENT_RATIO"].ToString();
  463. this.MS011Editor4.Value = table.Rows[3]["PAYMENT_RATIO"].ToString();
  464. this.MS011Editor5.Value = table.Rows[3]["TERM"].ToString();
  465. break;
  466. case "MS012":
  467. indexche = 11;
  468. //1:货到多少工作日付款
  469. this.MSBox.Items[0].ValueList.SelectedIndex = 11;
  470. this.MS012Editor1.Value = table.Rows[0]["PAYMENT_RATIO"].ToString();
  471. break;
  472. case "MS013":
  473. indexche = 12;
  474. //1:货到多少工作日付款,保质期都有比列
  475. this.MSBox.Items[0].ValueList.SelectedIndex = 12;
  476. this.MS013Editor1.Value = table.Rows[0]["TERM"].ToString();
  477. this.MS013Editor2.Value = table.Rows[1]["PAYMENT_RATIO"].ToString();
  478. this.MS013Editor3.Value = table.Rows[1]["TERM"].ToString();
  479. break;
  480. case "MS014":
  481. indexche = 13;
  482. //1:开票后出多少
  483. this.MSBox.Items[0].ValueList.SelectedIndex = 13;
  484. this.MS014Editor1.Value = table.Rows[0]["TERM"].ToString();
  485. break;
  486. case "MS015":
  487. indexche = 14;
  488. //1:开票后出多少工作日付款,保质期都有比列
  489. this.MSBox.Items[0].ValueList.SelectedIndex = 14;
  490. this.MS015Editor1.Value = table.Rows[0]["TERM"].ToString();
  491. this.MS015Editor2.Value = table.Rows[1]["PAYMENT_RATIO"].ToString();
  492. this.MS015Editor3.Value = table.Rows[1]["TERM"].ToString();
  493. break;
  494. case "MS016":
  495. indexche = 18;
  496. this.MSBox.Items[0].ValueList.SelectedIndex = 18;
  497. MS018Editor1.Value = table.Rows[0]["PAYMENT_RATIO"].ToString();
  498. MS018Editor2.Value = table.Rows[1]["PAYMENT_RATIO"].ToString();
  499. break;
  500. case "MS017":
  501. indexche = 19;
  502. this.MSBox.Items[0].ValueList.SelectedIndex = 19;
  503. MS019Editor1.Value = table.Rows[0]["TERM"].ToString();
  504. break;
  505. default:
  506. indexche = 15;
  507. this.MSBox.Items[0].ValueList.SelectedIndex = 15;
  508. break;
  509. }
  510. }
  511. private void FrmOrderMoneyAsk_Load(object sender, EventArgs e)
  512. {
  513. tableOrder.Columns.Add("MANAG_NO", typeof(System.String));
  514. tableOrder.Columns.Add("ORDER_NO", typeof(System.String));
  515. tableOrder.Columns.Add("BALNCE_MNY_NO", typeof(System.String));
  516. tableOrder.Columns.Add("BALNCE_MNY_SEQ", typeof(System.String));
  517. tableOrder.Columns.Add("PAYMENT_NODE", typeof(System.String));
  518. tableOrder.Columns.Add("TERM", typeof(System.Int32));
  519. tableOrder.Columns.Add("TERM_UNIT", typeof(System.String));
  520. tableOrder.Columns.Add("PAYMENT_RATIO", typeof(System.String));
  521. tableOrder.Columns.Add("MEMO", typeof(System.String));
  522. //定位已存在的资金要求
  523. this.orderAskLoad_Call(order_pk);
  524. if(this.AskDesc.Contains("见备注栏"))
  525. {
  526. int startIndex = AskDesc.IndexOf(":") + 1;
  527. int length = AskDesc.Length - AskDesc.IndexOf(":")-1;
  528. txtMemo.Text = AskDesc.Substring(startIndex, length);
  529. this.MSBox.Items[0].ValueList.SelectedIndex = 24;
  530. }
  531. }
  532. }
  533. }