using System;
using System.Data;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Threading;
using Core.Mes.ClientFrameWork;
using Core.Mes.ServerFrameWork;
using Infragistics.Win.UltraWinGrid;
using Core.Mes.IBaseInterface;
namespace Core.LgMes.Client.LgJobMgt
{
///
/// Form1 的摘要说明。
///
public class FrmSetHeatidQuery : FrmBase//System.Windows.Forms.Form
{
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.TextBox txt_setheatno;
private System.Windows.Forms.Button btn_enter;
public string Ccmno="";
public string Heatno="";
private System.Windows.Forms.Label label2;
private System.Windows.Forms.TextBox cbo_ccmno;
///
/// 必需的设计器变量。
///
private System.ComponentModel.Container components = null;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.TextBox txt_weight;
private System.Windows.Forms.TextBox txt_mostate;
//private remotingHelp = null;
// private ClientCommon._RemotingHelp remotingHelp=null;
public FrmSetHeatidQuery()
{
//
// Windows 窗体设计器支持所必需的
//
InitializeComponent();
//
// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
//
//remotingHelp = remoteHelp;
}
///
/// 清理所有正在使用的资源。
///
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows 窗体设计器生成的代码
///
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
///
private void InitializeComponent()
{
this.label1 = new System.Windows.Forms.Label();
this.txt_setheatno = new System.Windows.Forms.TextBox();
this.label5 = new System.Windows.Forms.Label();
this.btn_enter = new System.Windows.Forms.Button();
this.label2 = new System.Windows.Forms.Label();
this.cbo_ccmno = new System.Windows.Forms.TextBox();
this.label3 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.txt_weight = new System.Windows.Forms.TextBox();
this.txt_mostate = new System.Windows.Forms.TextBox();
this.SuspendLayout();
//
// label1
//
this.label1.Location = new System.Drawing.Point(12, 12);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(320, 20);
this.label1.TabIndex = 0;
this.label1.Text = "功能:将当前切割炉号设置为手动输入的炉号";
//
// txt_setheatno
//
this.txt_setheatno.BackColor = System.Drawing.Color.LightCyan;
this.txt_setheatno.CharacterCasing = System.Windows.Forms.CharacterCasing.Upper;
this.txt_setheatno.Location = new System.Drawing.Point(12, 96);
this.txt_setheatno.MaxLength = 9;
this.txt_setheatno.Name = "txt_setheatno";
this.txt_setheatno.Size = new System.Drawing.Size(92, 21);
this.txt_setheatno.TabIndex = 7;
this.txt_setheatno.TextChanged += new System.EventHandler(this.txt_setheatno_TextChanged);
//
// label5
//
this.label5.Location = new System.Drawing.Point(12, 40);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(320, 48);
this.label5.TabIndex = 6;
this.label5.Text = "手动设置炉号,例如06Z205678.在设置炉号前,请检查被设置的炉的坯是否已经置是,如有是,请先将是改为否.并检查该炉浇钢重量";
//
// btn_enter
//
this.btn_enter.Location = new System.Drawing.Point(116, 96);
this.btn_enter.Name = "btn_enter";
this.btn_enter.Size = new System.Drawing.Size(76, 23);
this.btn_enter.TabIndex = 8;
this.btn_enter.Text = "确定";
this.btn_enter.Click += new System.EventHandler(this.btn_enter_Click);
//
// label2
//
this.label2.Location = new System.Drawing.Point(120, 136);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(64, 20);
this.label2.TabIndex = 10;
this.label2.Text = "铸机号";
//
// cbo_ccmno
//
this.cbo_ccmno.CharacterCasing = System.Windows.Forms.CharacterCasing.Upper;
this.cbo_ccmno.Location = new System.Drawing.Point(12, 128);
this.cbo_ccmno.MaxLength = 9;
this.cbo_ccmno.Name = "cbo_ccmno";
this.cbo_ccmno.ReadOnly = true;
this.cbo_ccmno.Size = new System.Drawing.Size(92, 21);
this.cbo_ccmno.TabIndex = 11;
//
// label3
//
this.label3.Location = new System.Drawing.Point(196, 100);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(80, 20);
this.label3.TabIndex = 12;
this.label3.Text = "该炉浇钢重量";
//
// label4
//
this.label4.Location = new System.Drawing.Point(196, 136);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(80, 20);
this.label4.TabIndex = 13;
this.label4.Text = "末坯状态为";
//
// txt_weight
//
this.txt_weight.CharacterCasing = System.Windows.Forms.CharacterCasing.Upper;
this.txt_weight.Location = new System.Drawing.Point(272, 96);
this.txt_weight.MaxLength = 9;
this.txt_weight.Name = "txt_weight";
this.txt_weight.ReadOnly = true;
this.txt_weight.Size = new System.Drawing.Size(60, 21);
this.txt_weight.TabIndex = 14;
//
// txt_mostate
//
this.txt_mostate.CharacterCasing = System.Windows.Forms.CharacterCasing.Upper;
this.txt_mostate.Location = new System.Drawing.Point(272, 132);
this.txt_mostate.MaxLength = 9;
this.txt_mostate.Name = "txt_mostate";
this.txt_mostate.ReadOnly = true;
this.txt_mostate.Size = new System.Drawing.Size(60, 21);
this.txt_mostate.TabIndex = 15;
//
// FrmSetHeatid
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.BackColor = System.Drawing.Color.Gainsboro;
this.ClientSize = new System.Drawing.Size(340, 166);
this.Controls.Add(this.txt_mostate);
this.Controls.Add(this.txt_weight);
this.Controls.Add(this.label4);
this.Controls.Add(this.label3);
this.Controls.Add(this.cbo_ccmno);
this.Controls.Add(this.label2);
this.Controls.Add(this.btn_enter);
this.Controls.Add(this.txt_setheatno);
this.Controls.Add(this.label5);
this.Controls.Add(this.label1);
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "FrmSetHeatid";
this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
this.Text = "切割炉号重置界面";
this.WindowState = System.Windows.Forms.FormWindowState.Normal;
this.Load += new System.EventHandler(this.FrmSetHeatid_Load);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private void btn_enter_Click(object sender, System.EventArgs e)
{
if (txt_setheatno.Text.Length<9)
{
MessageBox.Show("炉号输入错误!");
return;
}
if (cbo_ccmno.Text=="")
{
MessageBox.Show("连铸机号错误!");
return;
}
if (txt_mostate.Text=="是")
{
MessageBox.Show("请将此炉的末块置为'否'后再更改炉号!!");
return;
}
UpdateHeatid();
}
private void FrmSetHeatid_Load(object sender, System.EventArgs e)
{
cbo_ccmno.Text=Ccmno;
txt_setheatno.Text=Heatno;
}
public void UpdateHeatid()
{
string strHeatNo = "";
strHeatNo = Convert.ToString(this.txt_setheatno.Text);
//CallingMessage par = new CallingMessage();
//par.ServerName = "Craft";
//par.AssemblyName = "Core.Sglg.CraftBusiness";
//par.ClassName = "Core.Sglg.CraftBusiness.ReadDataClass";
//par.MethodName = "resetheatno";
//par.args = new object[]{strHeatNo,Convert.ToInt32(Ccmno)};
string strOut = "";
//object obj = this.remotingHelp.ExecuteMethod(par, out strOut);
object obj = ClientCommon._RemotingHelp.ExecuteMethod("lgJobMgt", "Core.LgMes.Server.lgJobMgt.classCutJob", "resetheatno", new object[] { strHeatNo, Convert.ToInt32(Ccmno) } , out strOut);
if (strOut != "")
{
MessageBox.Show("数据更新失败! " + strOut);
}
else
{
MessageBox.Show("炉号设置成功!");
}
}
private void txt_setheatno_TextChanged(object sender, System.EventArgs e)
{
if (txt_setheatno.TextLength==9)
{
Hashtable cutHash = new Hashtable();
string strHeatNo = "";
strHeatNo = Convert.ToString(this.txt_setheatno.Text);
try
{
//CallingMessage par = new CallingMessage();
//par.ServerName = "Craft";
//par.AssemblyName = "Core.Sglg.CraftBusiness";
//par.ClassName = "Core.Sglg.CraftBusiness.ReadDataClass";
//par.MethodName = "readweightyn";
//par.args = new object[]{strHeatNo};
string strOut = "";
object obj = ClientCommon._RemotingHelp.ExecuteMethod("lgJobMgt", "Core.LgMes.Server.lgJobMgt.classCutJob", "readweightyn", new object[] { strHeatNo } , out strOut);
if (strOut == "")
{
cutHash = (Hashtable)obj;
}
else
{
cutHash.Clear();
}
txt_weight.Text=cutHash[0].ToString();
txt_mostate.Text=cutHash[1].ToString();
}
catch (Exception ee)
{
Console.WriteLine(ee.Message);
cutHash.Clear();
}
}
}
}
}