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