FrmGlMoneyAsk.cs 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340
  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. namespace Core.StlMes.Client.GlBusiness.Dialog
  16. {
  17. public partial class FrmGlMoneyAsk : FrmBase
  18. {
  19. int indexche = 0; //付款类型ID
  20. private String ordPk = "";
  21. /// <summary>
  22. /// 合同头内部主键
  23. /// </summary>
  24. public String OrdPk
  25. {
  26. set { ordPk = value; }
  27. get { return ordPk; }
  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. public delegate void GetOrderMoneyAskHander(string stAll);
  39. public event GetOrderMoneyAskHander GetOrderMoneyAsk;
  40. private string askDesc = "";
  41. /// <summary>
  42. /// 付款要求
  43. /// </summary>
  44. public string AskDesc
  45. {
  46. get { return askDesc; }
  47. set { askDesc = value; }
  48. }
  49. public FrmGlMoneyAsk()
  50. {
  51. InitializeComponent();
  52. }
  53. private void ultraButtonClose_Click(object sender, EventArgs e)
  54. {
  55. this.Close();
  56. }
  57. private void MSBox_ValueChanged(object sender, EventArgs e)
  58. {
  59. if (this.MSBox.CheckedIndex != -1)
  60. {
  61. indexche = this.MSBox.CheckedIndex;
  62. }
  63. }
  64. private void MSBox_MouseCaptureChanged(object sender, EventArgs e)
  65. {
  66. if (this.MSBox.CheckedIndex != -1)
  67. {
  68. this.MSBox.CheckedIndex = -1;
  69. }
  70. }
  71. private void ultraButtonCom_Click(object sender, EventArgs e)
  72. {
  73. switch (indexche)
  74. {
  75. case 0:
  76. this.stringAll = this.MS001Lab.Text;
  77. break;
  78. case 1:
  79. //付%款排产,收余下款发货。
  80. if (Convert.ToInt32(MS002Editor1.Value) > 100)
  81. {
  82. MessageUtil.ShowWarning("填写的百分比不能大于100%。");
  83. break;
  84. }
  85. if (Convert.ToInt32(MS002Editor0.Value) == 0)
  86. {
  87. MessageUtil.ShowWarning("填写的合同签订XXX日内必须大于0");
  88. MS002Editor0.Focus();
  89. break;
  90. }
  91. this.stringAll = this.MS002Lab0.Text +this.MS002Editor0.Value.ToString()+ this.MS002Lab1.Text + this.MS002Editor1.Value.ToString() + this.MS002Lab2.Text;
  92. break;
  93. case 2:
  94. if (Convert.ToInt32(MS003Editor0.Value) == 0)
  95. {
  96. MessageUtil.ShowWarning("填写的合同签订XXX日内必须大于0");
  97. MS003Editor0.Focus();
  98. break;
  99. }
  100. this.stringAll = this.MS003Lab0.Text +this.MS003Editor0.Value.ToString()+this.MS003Lab1.Text;
  101. break;
  102. case 3:
  103. //支付%款后发货,发货以后多少天付款,付款比例不写。
  104. if (Convert.ToInt32(MS004Editor1.Value) > 100)
  105. {
  106. MessageUtil.ShowWarning("填写的百分比不能大于100%。");
  107. break;
  108. }
  109. if (Convert.ToInt32(MS004Editor0.Value) == 0)
  110. {
  111. MessageUtil.ShowWarning("填写的合同签订XXX日内必须大于0");
  112. MS004Editor0.Focus();
  113. break;
  114. }
  115. 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;
  116. break;
  117. case 4:
  118. //支付%款后发货,发货以后多少天付%款无付款比例,质保期多少个月付清余款有付款比例。
  119. if ((Convert.ToInt32(MS005Editor1.Value) + Convert.ToInt32(MS005Editor3.Value)) > 100)
  120. {
  121. MessageUtil.ShowWarning("填写的百分比不能大于100%。");
  122. break;
  123. }
  124. if (Convert.ToInt32(MS005Editor0.Value) == 0)
  125. {
  126. MessageUtil.ShowWarning("填写的合同签订XXX日内必须大于0");
  127. MS005Editor0.Focus();
  128. break;
  129. }
  130. 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;
  131. break;
  132. case 5:
  133. //支付%款后发货,发货以后多少天付清%款。
  134. if (Convert.ToInt32(MS006Editor1.Value) > 100)
  135. {
  136. MessageUtil.ShowWarning("填写的百分比不能大于100%。");
  137. break;
  138. }
  139. if (Convert.ToInt32(MS006Editor0.Value) == 0)
  140. {
  141. MessageUtil.ShowWarning("填写的合同签订XXX日内必须大于0");
  142. MS006Editor0.Focus();
  143. break;
  144. }
  145. 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;
  146. break;
  147. case 6:
  148. //支付%款后发货,发货收齐以后多少天付%款无付款比例,质保期多少个月付清余款有付款比例。
  149. if ((Convert.ToInt32(MS007Editor1.Value) + Convert.ToInt32(MS007Editor3.Value)) > 100)
  150. {
  151. MessageUtil.ShowWarning("填写的百分比不能大于100%。");
  152. break;
  153. }
  154. if (Convert.ToInt32(MS007Editor0.Value) == 0)
  155. {
  156. MessageUtil.ShowWarning("填写的合同签订XXX日内必须大于0");
  157. MS007Editor0.Focus();
  158. break;
  159. }
  160. 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;
  161. break;
  162. case 7:
  163. //支付%款后发货,余款发票开出后多少天付款,付款比例不写。
  164. if (Convert.ToInt32(MS008Editor1.Value) > 100)
  165. {
  166. MessageUtil.ShowWarning("填写的百分比不能大于100%。");
  167. break;
  168. }
  169. if (Convert.ToInt32(MS008Editor0.Value) == 0)
  170. {
  171. MessageUtil.ShowWarning("填写的合同签订XXX日内必须大于0");
  172. MS008Editor0.Focus();
  173. break;
  174. }
  175. 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;
  176. break;
  177. case 8:
  178. //支付%款后发货,余款发票开出后多少天付款,付款比例不写,质保期多少个月付清余款有付款比例。
  179. if ((Convert.ToInt32(MS009Editor1.Value) + Convert.ToInt32(MS009Editor3.Value)) > 100)
  180. {
  181. MessageUtil.ShowWarning("填写的百分比不能大于100%。");
  182. break;
  183. }
  184. if (Convert.ToInt32(MS009Editor0.Value) == 0)
  185. {
  186. MessageUtil.ShowWarning("填写的合同签订XXX日内必须大于0");
  187. MS009Editor0.Focus();
  188. break;
  189. }
  190. 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;
  191. break;
  192. case 9:
  193. //1:排产%付款,2.付款%多少发运。百分比:排产-付款前发运=发票开出后多少天付款比例。
  194. if ((Convert.ToInt32(MS010Editor1.Value) + Convert.ToInt32(MS010Editor2.Value)) > 100)
  195. {
  196. MessageUtil.ShowWarning("填写的百分比不能大于100%。");
  197. break;
  198. }
  199. if (Convert.ToInt32(MS010Editor0.Value) == 0)
  200. {
  201. MessageUtil.ShowWarning("填写的合同签订XXX日内必须大于0");
  202. MS010Editor0.Focus();
  203. break;
  204. }
  205. 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;
  206. break;
  207. case 10:
  208. //1:排产%付款,2.付款%多少发运。百分比:排产-付款前发运=发票开出后多少天付款比例,质保金需要比例。
  209. if ((Convert.ToInt32(MS011Editor1.Value) + Convert.ToInt32(MS011Editor2.Value) + Convert.ToInt32(MS011Editor4.Value)) > 100)
  210. {
  211. MessageUtil.ShowWarning("填写的百分比不能大于100%。");
  212. break;
  213. }
  214. if (Convert.ToInt32(MS011Editor0.Value) == 0)
  215. {
  216. MessageUtil.ShowWarning("填写的合同签订XXX日内必须大于0");
  217. MS011Editor0.Focus();
  218. break;
  219. }
  220. 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;
  221. break;
  222. case 11:
  223. //1:货到多少工作日付款
  224. if ((Convert.ToInt32(MS012Editor1.Value)) > 100)
  225. {
  226. MessageUtil.ShowWarning("填写的百分比不能大于100%。");
  227. break;
  228. }
  229. this.stringAll = this.MS012Lab1.Text + this.MS012Editor1.Value.ToString() + this.MS012Lab2.Text;
  230. break;
  231. case 12:
  232. //1:货到多少工作日付款,保质期都有比列
  233. if (Convert.ToInt32(MS013Editor2.Value) > 100)
  234. {
  235. MessageUtil.ShowWarning("填写的百分比不能大于100%。");
  236. break;
  237. }
  238. 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;
  239. break;
  240. case 13:
  241. //1:开票后出多少
  242. if (Convert.ToInt32(MS014Editor1.Value) > 100)
  243. {
  244. MessageUtil.ShowWarning("填写的百分比不能大于100%。");
  245. break;
  246. }
  247. this.stringAll = this.MS014Lab1.Text + this.MS014Editor1.Value.ToString() + this.MS014Label2.Text;
  248. break;
  249. case 14:
  250. //1:开票后出多少工作日付款,保质期都有比列
  251. if (Convert.ToInt32(MS015Editor2.Value) > 100)
  252. {
  253. MessageUtil.ShowWarning("填写的百分比不能大于100%。");
  254. break;
  255. }
  256. //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;
  257. //tableOrder.Rows.Add(manag_no, order_no, "MS015", "001", "121106", Convert.ToInt32(this.MS015Editor1.Value), "天", Convert.ToString(100 - Convert.ToInt32(this.MS015Editor2.Value)), stringAll);
  258. //tableOrder.Rows.Add(manag_no, order_no, "MS015", "002", "121107", 0, " ", this.MS015Editor2.Value.ToString(), stringAll);
  259. 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;
  260. break;
  261. case 15:
  262. this.stringAll = "/";
  263. break;
  264. case 16:
  265. this.stringAll = "即期";
  266. break;
  267. case 17:
  268. this.stringAll = "远期";
  269. break;
  270. case 18:
  271. if (MS018Editor1.Value == null || MS018Editor2.Value == null)
  272. {
  273. MessageUtil.ShowWarning("请填入百分比!");
  274. break;
  275. }
  276. if (Convert.ToDouble(MS018Editor1.Value) + Convert.ToDouble(MS018Editor2.Value) > 100)
  277. {
  278. MessageUtil.ShowWarning("填写的百分比不能大于100%。");
  279. break;
  280. }
  281. if (Convert.ToInt32(MS018Editor0.Value) == 0)
  282. {
  283. MessageUtil.ShowWarning("填写的合同签订XXX日内必须大于0");
  284. MS018Editor0.Focus();
  285. break;
  286. }
  287. stringAll = this.MS018Lab0.Text + this.MS018Editor0.Value.ToString() + MS018Lab2.Text + MS018Editor1.Value.ToString() + MS018Lab3.Text + MS018Editor2.Value.ToString() + MS018Lab4.Text;
  288. break;
  289. case 19:
  290. if (MS019Editor1.Value == null)
  291. {
  292. MessageUtil.ShowWarning("请输入天数!");
  293. break;
  294. }
  295. stringAll = MS019Lab1.Text + MS019Editor1.Value.ToString() + MS019Lab2.Text;
  296. break;
  297. case 20:
  298. this.stringAll = "按协议付款";
  299. break;
  300. case 21:
  301. this.stringAll = "持票付款";
  302. break;
  303. case 22:
  304. this.stringAll = "抹账购管";
  305. break;
  306. case 23:
  307. this.stringAll = "与坯料合同货款对冲后,带款提货";
  308. break;
  309. case 24:
  310. if (txtMemo.Text.Trim() == "")
  311. {
  312. MessageUtil.ShowWarning("请输入备注信息!");
  313. break;
  314. }
  315. this.stringAll = "见备注栏:" + txtMemo.Text.Trim();
  316. break;
  317. }
  318. //返回给主界面数据
  319. if (!stringAll.Trim().Equals(""))
  320. {
  321. GetOrderMoneyAsk(this.stringAll);
  322. this.Close();
  323. }
  324. }
  325. private void FrmOrderMoneyAsk_Load(object sender, EventArgs e)
  326. {
  327. }
  328. }
  329. }