1b36416030ee92b351ce6ff5396b2cb5eb61ef59.svn-base 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  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 Infragistics.Win.UltraWinGrid;
  11. namespace Core.LZMes.Client.UIM
  12. {
  13. public partial class UIM010190 : FrmBase
  14. {
  15. private string COIL_NO = "";
  16. public UIM010190()
  17. {
  18. InitializeComponent();
  19. }
  20. public override void ToolBar_Click(object sender, string ToolbarKey)
  21. {
  22. switch (ToolbarKey)
  23. {
  24. case "Query":
  25. this.DoQuery();
  26. break;
  27. case "Save":
  28. this.DoSave();
  29. break;
  30. case "Exit":
  31. this.Close();
  32. break;
  33. }
  34. }
  35. /// <summary>
  36. /// 查询钢卷信息
  37. /// </summary>
  38. private void DoQuery()
  39. {
  40. try
  41. {
  42. string coilNo = this.textBox1.Text.Trim();
  43. this.dataSet1.Tables[0].Clear();
  44. COIL_NO = coilNo;
  45. CoreClientParam ccp = new CoreClientParam();
  46. ccp.ServerName = "UIM.UIM010190";
  47. ccp.MethodName = "queryCoilInfo";
  48. ccp.ServerParams = new object[] { coilNo };
  49. ccp.SourceDataTable = this.dataSet1.Tables[0];
  50. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  51. }
  52. catch (Exception EX)
  53. {
  54. MessageBox.Show(EX.ToString());
  55. }
  56. }
  57. /// <summary>
  58. /// 盘入盘出操作
  59. /// </summary>
  60. private void DoSave()
  61. {
  62. try
  63. {
  64. if (this.dataTable1.Rows.Count < 1)
  65. {
  66. MessageBox.Show("钢卷信息不能为空,请先查询出钢卷信息再进行盘入盘出操作!");
  67. return;
  68. }
  69. Infragistics.Win.UltraWinGrid.RowsCollection rs = null;
  70. rs = this.ultraGrid1.Rows;
  71. string wdlivno = "";
  72. foreach (UltraGridRow ugr in rs)
  73. {
  74. wdlivno = rs[0].Cells["wdlivno"].Text.ToString(); //获取提货单号
  75. }
  76. //string yardName = "2";
  77. string yardName = ultraComboEditor8.Text.Trim().ToUpper();
  78. string row_fl = textBox2.Text.Trim().ToUpper();
  79. string col = textBox3.Text.Trim();
  80. if (checkBox1.Checked && (row_fl.Length < 2 || (!row_fl.EndsWith("A") && !row_fl.EndsWith("B") && !row_fl.EndsWith("C")) || col.Length < 1))
  81. {
  82. MessageBox.Show("垛位输入不正确,请按照2-01A-01的格式输入!");
  83. this.textBox2.Focus();
  84. return;
  85. }
  86. if (row_fl.Length == 2)
  87. {
  88. row_fl = "0" + row_fl;
  89. }
  90. if (col.Length == 1)
  91. {
  92. col = "0" + col;
  93. }
  94. string curLoadLoc = yardName+"-"+row_fl+"-"+col;
  95. int type = 0;
  96. if (checkBox2.Checked)
  97. {
  98. type = 1;
  99. }
  100. else if (checkBox3.Checked || checkBox4.Checked)
  101. {
  102. type = 2;//外卖或者废钢
  103. }
  104. else if(!checkBox1.Checked)
  105. {
  106. MessageBox.Show("请选择盘入盘出类型!");
  107. return;
  108. }
  109. else if ("".Equals(curLoadLoc))
  110. {
  111. MessageBox.Show("盘入操作需要垛位信息,请输入相应的垛位信息!");
  112. return;
  113. }
  114. else if ("".Equals(wdlivno) && (checkBox3.Checked || checkBox4.Checked))
  115. {
  116. MessageBox.Show("外卖或者废钢提货单号不能为空!");
  117. return;
  118. }
  119. string coilInReg = this.UserInfo.GetUserID();
  120. CoreClientParam ccp = new CoreClientParam();
  121. ccp.ServerName = "UIM.UIM010190";
  122. ccp.MethodName = "save";
  123. ccp.ServerParams = new object[] { type, COIL_NO, curLoadLoc, coilInReg, UserInfo.GetUserOrder(), UserInfo.GetUserGroup(),wdlivno };
  124. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  125. this.DoQuery();
  126. }
  127. catch (Exception EX)
  128. {
  129. MessageBox.Show(EX.ToString());
  130. }
  131. }
  132. private void checkBox1_CheckedChanged(object sender, EventArgs e)
  133. {
  134. if (this.checkBox1.Checked)
  135. {
  136. this.checkBox2.Checked = false;
  137. this.checkBox3.Checked = false;
  138. this.checkBox4.Checked = false;
  139. }
  140. }
  141. private void checkBox2_CheckedChanged(object sender, EventArgs e)
  142. {
  143. if (this.checkBox2.Checked)
  144. {
  145. this.checkBox1.Checked = false;
  146. this.checkBox3.Checked = false;
  147. this.checkBox4.Checked = false;
  148. }
  149. }
  150. private void textBox2_KeyPress(object sender, KeyPressEventArgs e)
  151. {
  152. if (e.KeyChar == (char)Keys.Enter)
  153. {
  154. this.textBox3.Focus();
  155. return;
  156. }
  157. }
  158. private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
  159. {
  160. if (e.KeyChar == (char)Keys.Enter)
  161. {
  162. this.DoQuery();
  163. return;
  164. }
  165. }
  166. private void textBox3_KeyPress(object sender, KeyPressEventArgs e)
  167. {
  168. if (e.KeyChar == (char)Keys.Enter)
  169. {
  170. this.DoSave();
  171. return;
  172. }
  173. }
  174. private void checkBox1_MouseEnter(object sender, EventArgs e)
  175. {
  176. this.toolTip1.Show("盘入操作需要垛位信息,请输入相应的垛位信息", this.checkBox1);
  177. }
  178. private void checkBox1_MouseLeave(object sender, EventArgs e)
  179. {
  180. this.toolTip1.Hide(this.checkBox1);
  181. }
  182. private void checkBox3_CheckedChanged(object sender, EventArgs e)
  183. {
  184. this.checkBox1.Checked = false;
  185. this.checkBox2.Checked = false;
  186. this.checkBox4.Checked = false;
  187. }
  188. private void checkBox4_CheckedChanged(object sender, EventArgs e)
  189. {
  190. this.checkBox1.Checked = false;
  191. this.checkBox2.Checked = false;
  192. this.checkBox3.Checked = false;
  193. }
  194. private void UIM010190_Load(object sender, EventArgs e)
  195. {
  196. ultraComboEditor8.SelectedIndex = 0;
  197. }
  198. }
  199. }