FrmNoOrderSentence.cs 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  1. using Core.Mes.Client.Comm.Format;
  2. using Core.Mes.Client.Comm.Server;
  3. using Core.Mes.Client.Comm.Tool;
  4. using Core.StlMes.Client.PlnSaleOrd.炉计划.Entity;
  5. using CoreFS.CA06;
  6. using System;
  7. using System.Collections.Generic;
  8. using System.ComponentModel;
  9. using System.Data;
  10. using System.Drawing;
  11. using System.Linq;
  12. using System.Text;
  13. using System.Windows.Forms;
  14. namespace Core.StlMes.Client.PlnSaleOrd.炉计划.Tool
  15. {
  16. public partial class FrmNoOrderSentence : FrmBase
  17. {
  18. public string flag = "";
  19. private OpeBase _ob;
  20. private MatBcMEntityEnd matBcEntity = new MatBcMEntityEnd();
  21. public FrmNoOrderSentence(OpeBase ob,MatBcMEntityEnd matTity)
  22. {
  23. this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
  24. InitializeComponent();
  25. _ob = ob;
  26. matBcEntity = matTity;
  27. }
  28. private void ultraToolbarsManager1_ToolClick(object sender, Infragistics.Win.UltraWinToolbars.ToolClickEventArgs e)
  29. {
  30. switch (e.Tool.Key)
  31. {
  32. case "DoFrim":
  33. doFrim();
  34. break;
  35. case "Close":
  36. closeFrm();
  37. break;
  38. }
  39. }
  40. private void closeFrm()
  41. {
  42. flag = "0";
  43. this.Close();
  44. }
  45. /// <summary>
  46. /// 确认
  47. /// </summary>
  48. private void doFrim()
  49. {
  50. if(!checkData())return;
  51. matBcEntity.MaterialNo = this.TxtMaterial.Tag.ToString2();
  52. matBcEntity.MaterialNamenew = this.TxtMaterial.Text.ToString2();
  53. matBcEntity.Produccode = this.TxtProduc.Tag.ToString2();
  54. matBcEntity.Producnamenew = this.TxtProduc.Text.ToString2();
  55. matBcEntity.Steelcode = this.TxtSteelCode.Tag.ToString2();
  56. matBcEntity.Steelnamenew = this.TxtSteelCode.Text.ToString2();
  57. matBcEntity.SpecCode = this.TxtSpcName.Tag.ToString2();
  58. matBcEntity.SpecNamenew = this.TxtSpcName.Text.ToString2();
  59. matBcEntity.StdStyle = this.TxtStdStyle.Tag.ToString2();
  60. matBcEntity.StdStyleDescnew = this.TxtStdStyle.Text.ToString2();
  61. matBcEntity.ModelCode = this.TxtModel.Tag.ToString2();
  62. matBcEntity.ModelDescnew = this.TxtModel.Text.ToString2();
  63. string matEntity = JSONFormat.Format(matBcEntity);
  64. CoreClientParam ccp = new CoreClientParam();
  65. ccp.ServerName = "com.steering.pss.plnsaleord.planStove.FrmEndLibrary";
  66. ccp.MethodName = "doFrim";
  67. ccp.ServerParams = new object[] { matEntity };
  68. ccp = _ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  69. if (ccp.ReturnCode != -1)
  70. {
  71. if (ccp.ReturnInfo.Equals("改判成功!"))
  72. {
  73. flag = "1";
  74. this.Close();
  75. }
  76. }
  77. }
  78. private bool checkData()
  79. {
  80. if(this.TxtMaterial.Text == "")
  81. {
  82. MessageUtil.ShowTips("请选择物料码!");
  83. return false;
  84. }
  85. if(this.TxtSpcName.Text == "")
  86. {
  87. MessageUtil.ShowTips("请选择规格!");
  88. return false;
  89. }
  90. if(this.TxtProduc.Text == "")
  91. {
  92. MessageUtil.ShowTips("请选择品名!");
  93. return false;
  94. }
  95. if(this.TxtSteelCode.Text == "")
  96. {
  97. MessageUtil.ShowTips("请选择钢级!");
  98. return false;
  99. }
  100. return true;
  101. }
  102. private void TxtMaterial_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e)
  103. {
  104. DataTable dt = ServerHelper.GetData("com.steering.pss.ydm.base.BaseOperations.getProcessMaterial",
  105. new object[] { }, _ob);
  106. dt.Columns["BASENAME"].Caption = "物料名称";
  107. BaseInfoPopup baseInfo = new BaseInfoPopup(dt, "BASENAME", "BASECODE");
  108. baseInfo.Shown += new EventHandler((a, b) =>
  109. {
  110. var actRow = baseInfo.UltraGrid1.Rows.AsQueryable().Where(
  111. c => c.GetValue("BASECODE") == this.TxtMaterial.Tag.ToString2()).FirstOrDefault();
  112. if (actRow != null) actRow.Activate();
  113. });
  114. if (baseInfo.ShowDialog() == System.Windows.Forms.DialogResult.OK)
  115. {
  116. TxtMaterial.Tag = baseInfo.ChoicedRow.GetValue("BASECODE");
  117. TxtMaterial.Text = baseInfo.ChoicedRow.GetValue("BASENAME");
  118. }
  119. }
  120. private void TxtProduc_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e)
  121. {
  122. DataTable dt = ServerHelper.GetData("com.steering.pss.ydm.pipemanage.FrmPipeInventoryIn.getProcduce",
  123. new object[] { }, _ob);
  124. dt.Columns["BASENAME"].Caption = "品名";
  125. BaseInfoPopup baseInfo = new BaseInfoPopup(dt, "BASENAME", "BASECODE");
  126. baseInfo.Shown += new EventHandler((a, b) =>
  127. {
  128. var actRow = baseInfo.UltraGrid1.Rows.AsQueryable().Where(
  129. c => c.GetValue("BASECODE") == this.TxtProduc.Tag.ToString2()).FirstOrDefault();
  130. if (actRow != null) actRow.Activate();
  131. });
  132. if (baseInfo.ShowDialog() == System.Windows.Forms.DialogResult.OK)
  133. {
  134. TxtProduc.Tag = baseInfo.ChoicedRow.GetValue("BASECODE");
  135. TxtProduc.Text = baseInfo.ChoicedRow.GetValue("BASENAME");
  136. }
  137. }
  138. private void TxtSteelCode_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e)
  139. {
  140. DataTable dt = ServerHelper.GetData("com.steering.pss.ydm.pipemanage.FrmPipeInventoryIn.getSteel",
  141. new object[] { }, _ob);
  142. dt.Columns["BASENAME"].Caption = "钢级";
  143. BaseInfoPopup baseInfo = new BaseInfoPopup(dt, "BASENAME", "BASECODE");
  144. baseInfo.Shown += new EventHandler((a, b) =>
  145. {
  146. var actRow = baseInfo.UltraGrid1.Rows.AsQueryable().Where(
  147. c => c.GetValue("BASECODE") == this.TxtSteelCode.Tag.ToString2()).FirstOrDefault();
  148. if (actRow != null) actRow.Activate();
  149. });
  150. if (baseInfo.ShowDialog() == System.Windows.Forms.DialogResult.OK)
  151. {
  152. TxtSteelCode.Tag = baseInfo.ChoicedRow.GetValue("BASECODE");
  153. TxtSteelCode.Text = baseInfo.ChoicedRow.GetValue("BASENAME");
  154. }
  155. }
  156. private void TxtSpcName_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e)
  157. {
  158. DataTable dt = ServerHelper.GetData("com.steering.pss.ydm.pipemanage.FrmPipeInventoryIn.getSpec",
  159. new object[] { }, _ob);
  160. dt.Columns["BASENAME"].Caption = "规格";
  161. BaseInfoPopup baseInfo = new BaseInfoPopup(dt, "BASENAME", "BASECODE");
  162. baseInfo.Shown += new EventHandler((a, b) =>
  163. {
  164. var actRow = baseInfo.UltraGrid1.Rows.AsQueryable().Where(
  165. c => c.GetValue("BASECODE") == this.TxtSpcName.Tag.ToString2()).FirstOrDefault();
  166. if (actRow != null) actRow.Activate();
  167. });
  168. if (baseInfo.ShowDialog() == System.Windows.Forms.DialogResult.OK)
  169. {
  170. TxtSpcName.Tag = baseInfo.ChoicedRow.GetValue("BASECODE");
  171. TxtSpcName.Text = baseInfo.ChoicedRow.GetValue("BASENAME");
  172. }
  173. }
  174. private void TxtModel_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e)
  175. {
  176. DataTable dt = ServerHelper.GetData("com.steering.pss.ydm.pipemanage.FrmPipeInventoryIn.getModel",
  177. new object[] { }, _ob);
  178. dt.Columns["BASENAME"].Caption = "扣型";
  179. BaseInfoPopup baseInfo = new BaseInfoPopup(dt, "BASENAME", "BASECODE");
  180. baseInfo.Shown += new EventHandler((a, b) =>
  181. {
  182. var actRow = baseInfo.UltraGrid1.Rows.AsQueryable().Where(
  183. c => c.GetValue("BASECODE") == this.TxtModel.Tag.ToString2()).FirstOrDefault();
  184. if (actRow != null) actRow.Activate();
  185. });
  186. if (baseInfo.ShowDialog() == System.Windows.Forms.DialogResult.OK)
  187. {
  188. TxtModel.Tag = baseInfo.ChoicedRow.GetValue("BASECODE");
  189. TxtModel.Text = baseInfo.ChoicedRow.GetValue("BASENAME");
  190. }
  191. }
  192. private void FrmNoOrderSentence_Load(object sender, EventArgs e)
  193. {
  194. StoveHelper.InitDropStdSty(TxtStdStyle, _ob);
  195. }
  196. }
  197. }