63403ae46a488cddef6515053774dc7a058d447e.svn-base 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  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.Collections;
  9. using System.Windows.Forms;
  10. using CoreFS.CA06;
  11. namespace Core.LZMes.Client.UIJ
  12. {
  13. public partial class UIJ050040 : FrmBase
  14. {
  15. public UIJ050040()
  16. {
  17. InitializeComponent();
  18. }
  19. private void UIJ050040_Load(object sender, EventArgs e)
  20. {
  21. }
  22. public override void ToolBar_Click(object sender, string ToolbarKey)
  23. {
  24. switch (ToolbarKey)
  25. {
  26. case "Query":
  27. this.DoQuery();
  28. break;
  29. case "Save":
  30. this.DoSave();
  31. break;
  32. case "Exit":
  33. this.Close();
  34. break;
  35. }
  36. }
  37. private void DoQuery()
  38. {
  39. if (null == this.ultraDateTimeEditor1.Value)
  40. {
  41. MessageBox.Show("发货指示的开始时间不能为空,请选择相应的发货指示开始时间!");
  42. return;
  43. }
  44. if (null == this.ultraDateTimeEditor2.Value)
  45. {
  46. MessageBox.Show("发货指示的结束时间不能为空,请选择相应的发货指示结束时间!");
  47. return;
  48. }
  49. if (0 > this.ultraComboEditor1.SelectedIndex)
  50. {
  51. MessageBox.Show("运输方式不能为空,请选择相应的运输方式!");
  52. return;
  53. }
  54. string fromDate = this.ultraDateTimeEditor1.DateTime.ToString("yyyyMMdd");
  55. string toDate = this.ultraDateTimeEditor2.DateTime.ToString("yyyyMMdd");
  56. string dlivTp = this.ultraComboEditor1.Value.ToString();
  57. string dlivDirNo = this.textBox3.Text.Trim();
  58. string isCancel = "0";
  59. this.dataSet1.Tables[0].Clear();
  60. CoreClientParam ccp = new CoreClientParam();
  61. ccp.ServerName = "UIJ.UIJ05.UIJ050010";
  62. ccp.MethodName = "queryDlivPlanLt";
  63. ccp.ServerParams = new Object[] { fromDate, toDate, dlivTp, dlivDirNo, isCancel };
  64. ccp.SourceDataTable = this.dataSet1.Tables[0];
  65. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  66. Infragistics.Win.UltraWinGrid.RowsCollection rs = this.ultraGrid1.Rows;
  67. for (int i = 0; i < rs.Count; i++)
  68. {
  69. rs[i].Cells["CHK"].Value = false;
  70. }
  71. }
  72. private void label3_Click(object sender, EventArgs e)
  73. {
  74. if (null == this.ultraDateTimeEditor1.Value)
  75. {
  76. MessageBox.Show("发货指示的开始时间不能为空,请选择相应的发货指示开始时间!");
  77. return;
  78. }
  79. if (null == this.ultraDateTimeEditor2.Value)
  80. {
  81. MessageBox.Show("发货指示的结束时间不能为空,请选择相应的发货指示结束时间!");
  82. return;
  83. }
  84. if (0 > this.ultraComboEditor1.SelectedIndex)
  85. {
  86. MessageBox.Show("运输方式不能为空,请选择相应的运输方式!");
  87. return;
  88. }
  89. string fromDate = this.ultraDateTimeEditor1.DateTime.ToString("yyyyMMdd");
  90. string toDate = this.ultraDateTimeEditor2.DateTime.ToString("yyyyMMdd");
  91. string dlivTp = this.ultraComboEditor1.Value.ToString();
  92. string dlivDirNo = this.textBox3.Text.Trim();
  93. string isCancel = "1";
  94. this.dataSet1.Tables[0].Clear();
  95. CoreClientParam ccp = new CoreClientParam();
  96. ccp.ServerName = "UIJ.UIJ05.UIJ050010";
  97. ccp.MethodName = "queryDlivPlanLt";
  98. ccp.ServerParams = new Object[] { fromDate, toDate, dlivTp, dlivDirNo, isCancel };
  99. ccp.SourceDataTable = this.dataSet1.Tables[0];
  100. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  101. Infragistics.Win.UltraWinGrid.RowsCollection rs = this.ultraGrid1.Rows;
  102. for (int i = 0; i < rs.Count; i++)
  103. {
  104. rs[i].Cells["CHK"].Value = false;
  105. }
  106. }
  107. /// <summary>
  108. /// 发运计划回退
  109. /// </summary>
  110. private void DoSave()
  111. {
  112. string isCancel = null;
  113. ArrayList list = new ArrayList();
  114. Infragistics.Win.UltraWinGrid.RowsCollection rs = this.ultraGrid1.Rows;
  115. for (int i = 0; i < rs.Count; i++)
  116. {
  117. if ("TRUE".Equals(rs[i].Cells["CHK"].Text.ToUpperInvariant()))
  118. {
  119. if (null == isCancel)
  120. {
  121. isCancel = rs[i].Cells["ISCANCEL"].Text;
  122. }
  123. list.Add(rs[i].Cells["DLIV_DIRNO"].Text);
  124. }
  125. }
  126. if (list.Count < 1)
  127. {
  128. MessageBox.Show("没有选中发运计划,不能进行保存操作!");
  129. return;
  130. }
  131. else
  132. {
  133. if ("1".Equals(isCancel))
  134. {
  135. MessageBox.Show("已经回退的计划,不能进行保存操作!");
  136. return;
  137. }
  138. else
  139. {
  140. string regId = this.UserInfo.GetUserID();
  141. CoreClientParam ccp = new CoreClientParam();
  142. ccp.ServerName = "UIJ.UIJ05.UIJ050010";
  143. ccp.MethodName = "returnShipDirLt";
  144. ccp.ServerParams = new Object[] { regId, list };
  145. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  146. if (0 != ccp.ReturnCode)
  147. {
  148. return;
  149. }
  150. this.DoQuery();
  151. }
  152. }
  153. }
  154. }
  155. }