| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Text;
- using System.Windows.Forms;
- using Core.LgMes.Client.lgClassModel;
- using System.Collections;
- using CoreFS.CA06;
- namespace Core.LgMes.Client.LgJobMgt
- {
- public partial class frmCCMPlanTemperaTure : Core.Mes.Client.Common.frmStyleBase
- {
- private string strBOF01_ObjectId = "";
- private string strBOF02_ObjectId = "";
- private string strBOF03_ObjectId = "";
- public frmCCMPlanTemperaTure()
- {
- InitializeComponent();
- }
- private void frmCCMPlanTemperaTure_Load(object sender, EventArgs e)
- {
- GetCVTHeatNo_CcmPlanTempt(); //获取正在生产的炉号
- InitControlVisible();
- ZL1.CheckedChanged += new EventHandler(ZL_CheckedChanged);
- ZL2.CheckedChanged += new EventHandler(ZL_CheckedChanged);
- ZL3.CheckedChanged += new EventHandler(ZL_CheckedChanged);
- txtLH1.ReadOnly = true;
- txtLH2.ReadOnly = true;
- txtLH3.ReadOnly = true;
- }
- private void InitControlVisible()
- {
- if (strBOF03_ObjectId != "")
- {
- this.ZL1.Checked = false;
- this.ZL2.Checked = false;
- this.ZL3.Checked = true;
- }
- if (strBOF02_ObjectId != "")
- {
- this.ZL1.Checked = false;
- this.ZL2.Checked = true;
- this.ZL3.Checked = false;
- }
- if (strBOF01_ObjectId != "")
- {
- this.ZL1.Checked = true;
- this.ZL2.Checked = false;
- this.ZL3.Checked = false;
- }
- txtLH1.Enabled = ZL1.Checked;
- txtLH2.Enabled = ZL2.Checked;
- txtLH3.Enabled = ZL3.Checked;
- txtTemp1.Enabled = ZL1.Checked;
- txtTemp2.Enabled = ZL2.Checked;
- txtTemp3.Enabled = ZL3.Checked;
- }
-
- /// <summary>
- /// 检测数据的有效性
- /// </summary>
- /// <returns></returns>
- private bool CheckIsValid()
- {
- if (ZL1.Checked == false && ZL2.Checked == false && ZL3.Checked == false)
- {
- MessageBox.Show("炉号未加载,连铸机要温不能确认!");
- return false;
- }
- if ((ZL1.Checked && txtLH1.Text.Trim() == "")
- || (ZL2.Checked && txtLH2.Text.Trim() == "")
- || (ZL3.Checked && txtLH3.Text.Trim() == ""))
- {
- MessageBox.Show("炉号未加载,连铸机要温不能确认!");
- return false;
- }
- return true;
- }
- private void ZL_CheckedChanged(object sender, EventArgs e)
- {
- txtLH1.Enabled = ZL1.Checked;
- txtLH2.Enabled = ZL2.Checked;
- txtLH3.Enabled = ZL3.Checked;
- txtTemp1.Enabled = ZL1.Checked;
- txtTemp2.Enabled = ZL2.Checked;
- txtTemp3.Enabled = ZL3.Checked;
- }
- private void SetPotInfo(string szLH)
- {
-
- }
- /// <summary>
- /// 获取冶炼炉号
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- ///
- private void GetCVTHeatNo_CcmPlanTempt()
- {
- try
- {
- this.txtLH1.Text = "";
- this.txtLH2.Text = "";
- this.txtLH3.Text = "";
- string strError = "";
- DataSet ds = null;// (DataSet)Core.Mes.ClientFrameWork.ClientCommon._RemotingHelp.ExecuteMethod("lgJobMgt",
- //"Core.LgMes.Server.lgJobMgt.classCcmJob",
- //"GetCVTHeatNo_CcmPlanTempt", new object[] {}, out strError);
- if (strError == "")
- {
- if (ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
- {
- for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
- {
- if (ds.Tables[0].Rows[i]["objectid"].ToString().Length > 0)
- {
- string v_LH = "";
- string v_POSID = ds.Tables[0].Rows[i]["objectpos"].ToString().Substring(3, 2);
- v_LH = (ds.Tables[0].Rows[i]["objectid"].ToString().Substring(5, 8));
- if (v_POSID == "01")
- {
- strBOF01_ObjectId = ds.Tables[0].Rows[i]["objectid"].ToString();
- this.txtLH1.Text = v_LH;
- this.txtTemp1.Text = ds.Tables[0].Rows[i]["ccmplantempt"].ToString();
- }
- if (v_POSID == "02")
- {
- strBOF02_ObjectId = ds.Tables[0].Rows[i]["objectid"].ToString();
- this.txtLH2.Text = v_LH;
- this.txtTemp2.Text = ds.Tables[0].Rows[i]["ccmplantempt"].ToString();
- }
- if (v_POSID == "03")
- {
- strBOF03_ObjectId = ds.Tables[0].Rows[i]["objectid"].ToString();
- this.txtLH3.Text = v_LH;
- this.txtTemp3.Text = ds.Tables[0].Rows[i]["ccmplantempt"].ToString();
- }
- }
- }
- }
- }
- }
- catch (Exception EE)
- {
- }
- }
- private void btnOk_Click(object sender, EventArgs e)
- {
- string strError = "";
- string strPlanTempt="";
- string strHeatNo="";
- string strStationCode="";
- string strDisposalTime="";
- // GetCVTHeatNo_CcmPlanTempt();
- if (!CheckIsValid())
- return;
- try
- {
- if (ZL1.Checked && strBOF01_ObjectId.Length>0)
- {
- strHeatNo = strBOF01_ObjectId.Substring(5, 8);
- strStationCode = strBOF01_ObjectId.Substring(1, 2);
- strDisposalTime = strBOF01_ObjectId.Substring(3, 2);
- strPlanTempt = txtTemp1.Text;
- }
- else if (ZL2.Checked && strBOF02_ObjectId.Length > 0)
- {
- strHeatNo = strBOF02_ObjectId.Substring(5, 8);
- strStationCode = strBOF02_ObjectId.Substring(1, 2);
- strDisposalTime = strBOF02_ObjectId.Substring(3, 2);
- strPlanTempt = txtTemp2.Text;
- }
- else if (ZL3.Checked && strBOF03_ObjectId.Length > 0)
- {
- strHeatNo = strBOF03_ObjectId.Substring(5, 8);
- strStationCode = strBOF03_ObjectId.Substring(1, 2);
- strDisposalTime = strBOF03_ObjectId.Substring(3, 2);
- strPlanTempt = txtTemp3.Text;
- }
- else
- {
- MessageBox.Show("没有选择要设置铸机要温的炉号!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
- return;
- }
- if (Convert.ToDouble(strPlanTempt) <= 1400 || Convert.ToDouble(strPlanTempt) >= 1800)
- {
- MessageBox.Show("输入的铸机要温无效,有效范围(1400~1800)℃", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
- return;
- }
- object obj =null;// ClientCommon._RemotingHelp.ExecuteMethod("lgJobMgt",
- // "Core.LgMes.Server.lgJobMgt.classCcmJob",
- // "SetCcmPlanTempt", new object[] { strPlanTempt,strHeatNo,strStationCode,strDisposalTime }, out strError);
- if (strError != "")
- {
- MessageBox.Show("连铸机计划要温设置不成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
- return;
- }
- }
- catch (Exception ex)
- {
- string Msg = ex.Message;
- }
- this.Close();
- }
- private void btnNo_Click(object sender, EventArgs e)
- {
- this.Close();
- }
- private void txtTemp1_KeyPress(object sender, KeyPressEventArgs e)
- {
- if (!(Char.IsNumber(e.KeyChar) || e.KeyChar == '\b'))
- {
- e.Handled = true;
- }
- }
-
- }
- }
|