FrmSetHeatidQuery.cs 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308
  1. using System;
  2. using System.Data;
  3. using System.Drawing;
  4. using System.Collections;
  5. using System.ComponentModel;
  6. using System.Windows.Forms;
  7. using System.Threading;
  8. using Core.Mes.ClientFrameWork;
  9. using Core.Mes.ServerFrameWork;
  10. using Infragistics.Win.UltraWinGrid;
  11. using Core.Mes.IBaseInterface;
  12. namespace Core.LgMes.Client.LgJobMgt
  13. {
  14. /// <summary>
  15. /// Form1 的摘要说明。
  16. /// </summary>
  17. public class FrmSetHeatidQuery : FrmBase//System.Windows.Forms.Form
  18. {
  19. private System.Windows.Forms.Label label1;
  20. private System.Windows.Forms.Label label5;
  21. private System.Windows.Forms.TextBox txt_setheatno;
  22. private System.Windows.Forms.Button btn_enter;
  23. public string Ccmno="";
  24. public string Heatno="";
  25. private System.Windows.Forms.Label label2;
  26. private System.Windows.Forms.TextBox cbo_ccmno;
  27. /// <summary>
  28. /// 必需的设计器变量。
  29. /// </summary>
  30. private System.ComponentModel.Container components = null;
  31. private System.Windows.Forms.Label label3;
  32. private System.Windows.Forms.Label label4;
  33. private System.Windows.Forms.TextBox txt_weight;
  34. private System.Windows.Forms.TextBox txt_mostate;
  35. //private remotingHelp = null;
  36. // private ClientCommon._RemotingHelp remotingHelp=null;
  37. public FrmSetHeatidQuery()
  38. {
  39. //
  40. // Windows 窗体设计器支持所必需的
  41. //
  42. InitializeComponent();
  43. //
  44. // TODO: 在 InitializeComponent 调用后添加任何构造函数代码
  45. //
  46. //remotingHelp = remoteHelp;
  47. }
  48. /// <summary>
  49. /// 清理所有正在使用的资源。
  50. /// </summary>
  51. protected override void Dispose( bool disposing )
  52. {
  53. if( disposing )
  54. {
  55. if(components != null)
  56. {
  57. components.Dispose();
  58. }
  59. }
  60. base.Dispose( disposing );
  61. }
  62. #region Windows 窗体设计器生成的代码
  63. /// <summary>
  64. /// 设计器支持所需的方法 - 不要使用代码编辑器修改
  65. /// 此方法的内容。
  66. /// </summary>
  67. private void InitializeComponent()
  68. {
  69. this.label1 = new System.Windows.Forms.Label();
  70. this.txt_setheatno = new System.Windows.Forms.TextBox();
  71. this.label5 = new System.Windows.Forms.Label();
  72. this.btn_enter = new System.Windows.Forms.Button();
  73. this.label2 = new System.Windows.Forms.Label();
  74. this.cbo_ccmno = new System.Windows.Forms.TextBox();
  75. this.label3 = new System.Windows.Forms.Label();
  76. this.label4 = new System.Windows.Forms.Label();
  77. this.txt_weight = new System.Windows.Forms.TextBox();
  78. this.txt_mostate = new System.Windows.Forms.TextBox();
  79. this.SuspendLayout();
  80. //
  81. // label1
  82. //
  83. this.label1.Location = new System.Drawing.Point(12, 12);
  84. this.label1.Name = "label1";
  85. this.label1.Size = new System.Drawing.Size(320, 20);
  86. this.label1.TabIndex = 0;
  87. this.label1.Text = "功能:将当前切割炉号设置为手动输入的炉号";
  88. //
  89. // txt_setheatno
  90. //
  91. this.txt_setheatno.BackColor = System.Drawing.Color.LightCyan;
  92. this.txt_setheatno.CharacterCasing = System.Windows.Forms.CharacterCasing.Upper;
  93. this.txt_setheatno.Location = new System.Drawing.Point(12, 96);
  94. this.txt_setheatno.MaxLength = 9;
  95. this.txt_setheatno.Name = "txt_setheatno";
  96. this.txt_setheatno.Size = new System.Drawing.Size(92, 21);
  97. this.txt_setheatno.TabIndex = 7;
  98. this.txt_setheatno.TextChanged += new System.EventHandler(this.txt_setheatno_TextChanged);
  99. //
  100. // label5
  101. //
  102. this.label5.Location = new System.Drawing.Point(12, 40);
  103. this.label5.Name = "label5";
  104. this.label5.Size = new System.Drawing.Size(320, 48);
  105. this.label5.TabIndex = 6;
  106. this.label5.Text = "手动设置炉号,例如06Z205678.在设置炉号前,请检查被设置的炉的坯是否已经置是,如有是,请先将是改为否.并检查该炉浇钢重量";
  107. //
  108. // btn_enter
  109. //
  110. this.btn_enter.Location = new System.Drawing.Point(116, 96);
  111. this.btn_enter.Name = "btn_enter";
  112. this.btn_enter.Size = new System.Drawing.Size(76, 23);
  113. this.btn_enter.TabIndex = 8;
  114. this.btn_enter.Text = "确定";
  115. this.btn_enter.Click += new System.EventHandler(this.btn_enter_Click);
  116. //
  117. // label2
  118. //
  119. this.label2.Location = new System.Drawing.Point(120, 136);
  120. this.label2.Name = "label2";
  121. this.label2.Size = new System.Drawing.Size(64, 20);
  122. this.label2.TabIndex = 10;
  123. this.label2.Text = "铸机号";
  124. //
  125. // cbo_ccmno
  126. //
  127. this.cbo_ccmno.CharacterCasing = System.Windows.Forms.CharacterCasing.Upper;
  128. this.cbo_ccmno.Location = new System.Drawing.Point(12, 128);
  129. this.cbo_ccmno.MaxLength = 9;
  130. this.cbo_ccmno.Name = "cbo_ccmno";
  131. this.cbo_ccmno.ReadOnly = true;
  132. this.cbo_ccmno.Size = new System.Drawing.Size(92, 21);
  133. this.cbo_ccmno.TabIndex = 11;
  134. //
  135. // label3
  136. //
  137. this.label3.Location = new System.Drawing.Point(196, 100);
  138. this.label3.Name = "label3";
  139. this.label3.Size = new System.Drawing.Size(80, 20);
  140. this.label3.TabIndex = 12;
  141. this.label3.Text = "该炉浇钢重量";
  142. //
  143. // label4
  144. //
  145. this.label4.Location = new System.Drawing.Point(196, 136);
  146. this.label4.Name = "label4";
  147. this.label4.Size = new System.Drawing.Size(80, 20);
  148. this.label4.TabIndex = 13;
  149. this.label4.Text = "末坯状态为";
  150. //
  151. // txt_weight
  152. //
  153. this.txt_weight.CharacterCasing = System.Windows.Forms.CharacterCasing.Upper;
  154. this.txt_weight.Location = new System.Drawing.Point(272, 96);
  155. this.txt_weight.MaxLength = 9;
  156. this.txt_weight.Name = "txt_weight";
  157. this.txt_weight.ReadOnly = true;
  158. this.txt_weight.Size = new System.Drawing.Size(60, 21);
  159. this.txt_weight.TabIndex = 14;
  160. //
  161. // txt_mostate
  162. //
  163. this.txt_mostate.CharacterCasing = System.Windows.Forms.CharacterCasing.Upper;
  164. this.txt_mostate.Location = new System.Drawing.Point(272, 132);
  165. this.txt_mostate.MaxLength = 9;
  166. this.txt_mostate.Name = "txt_mostate";
  167. this.txt_mostate.ReadOnly = true;
  168. this.txt_mostate.Size = new System.Drawing.Size(60, 21);
  169. this.txt_mostate.TabIndex = 15;
  170. //
  171. // FrmSetHeatid
  172. //
  173. this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
  174. this.BackColor = System.Drawing.Color.Gainsboro;
  175. this.ClientSize = new System.Drawing.Size(340, 166);
  176. this.Controls.Add(this.txt_mostate);
  177. this.Controls.Add(this.txt_weight);
  178. this.Controls.Add(this.label4);
  179. this.Controls.Add(this.label3);
  180. this.Controls.Add(this.cbo_ccmno);
  181. this.Controls.Add(this.label2);
  182. this.Controls.Add(this.btn_enter);
  183. this.Controls.Add(this.txt_setheatno);
  184. this.Controls.Add(this.label5);
  185. this.Controls.Add(this.label1);
  186. this.MaximizeBox = false;
  187. this.MinimizeBox = false;
  188. this.Name = "FrmSetHeatid";
  189. this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
  190. this.Text = "切割炉号重置界面";
  191. this.WindowState = System.Windows.Forms.FormWindowState.Normal;
  192. this.Load += new System.EventHandler(this.FrmSetHeatid_Load);
  193. this.ResumeLayout(false);
  194. this.PerformLayout();
  195. }
  196. #endregion
  197. private void btn_enter_Click(object sender, System.EventArgs e)
  198. {
  199. if (txt_setheatno.Text.Length<9)
  200. {
  201. MessageBox.Show("炉号输入错误!");
  202. return;
  203. }
  204. if (cbo_ccmno.Text=="")
  205. {
  206. MessageBox.Show("连铸机号错误!");
  207. return;
  208. }
  209. if (txt_mostate.Text=="是")
  210. {
  211. MessageBox.Show("请将此炉的末块置为'否'后再更改炉号!!");
  212. return;
  213. }
  214. UpdateHeatid();
  215. }
  216. private void FrmSetHeatid_Load(object sender, System.EventArgs e)
  217. {
  218. cbo_ccmno.Text=Ccmno;
  219. txt_setheatno.Text=Heatno;
  220. }
  221. public void UpdateHeatid()
  222. {
  223. string strHeatNo = "";
  224. strHeatNo = Convert.ToString(this.txt_setheatno.Text);
  225. //CallingMessage par = new CallingMessage();
  226. //par.ServerName = "Craft";
  227. //par.AssemblyName = "Core.Sglg.CraftBusiness";
  228. //par.ClassName = "Core.Sglg.CraftBusiness.ReadDataClass";
  229. //par.MethodName = "resetheatno";
  230. //par.args = new object[]{strHeatNo,Convert.ToInt32(Ccmno)};
  231. string strOut = "";
  232. //object obj = this.remotingHelp.ExecuteMethod(par, out strOut);
  233. object obj = ClientCommon._RemotingHelp.ExecuteMethod("lgJobMgt", "Core.LgMes.Server.lgJobMgt.classCutJob", "resetheatno", new object[] { strHeatNo, Convert.ToInt32(Ccmno) } , out strOut);
  234. if (strOut != "")
  235. {
  236. MessageBox.Show("数据更新失败! " + strOut);
  237. }
  238. else
  239. {
  240. MessageBox.Show("炉号设置成功!");
  241. }
  242. }
  243. private void txt_setheatno_TextChanged(object sender, System.EventArgs e)
  244. {
  245. if (txt_setheatno.TextLength==9)
  246. {
  247. Hashtable cutHash = new Hashtable();
  248. string strHeatNo = "";
  249. strHeatNo = Convert.ToString(this.txt_setheatno.Text);
  250. try
  251. {
  252. //CallingMessage par = new CallingMessage();
  253. //par.ServerName = "Craft";
  254. //par.AssemblyName = "Core.Sglg.CraftBusiness";
  255. //par.ClassName = "Core.Sglg.CraftBusiness.ReadDataClass";
  256. //par.MethodName = "readweightyn";
  257. //par.args = new object[]{strHeatNo};
  258. string strOut = "";
  259. object obj = ClientCommon._RemotingHelp.ExecuteMethod("lgJobMgt", "Core.LgMes.Server.lgJobMgt.classCutJob", "readweightyn", new object[] { strHeatNo } , out strOut);
  260. if (strOut == "")
  261. {
  262. cutHash = (Hashtable)obj;
  263. }
  264. else
  265. {
  266. cutHash.Clear();
  267. }
  268. txt_weight.Text=cutHash[0].ToString();
  269. txt_mostate.Text=cutHash[1].ToString();
  270. }
  271. catch (Exception ee)
  272. {
  273. Console.WriteLine(ee.Message);
  274. cutHash.Clear();
  275. }
  276. }
  277. }
  278. }
  279. }