| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Text;
- using System.Windows.Forms;
- using CoreFS.CA06;
- using Core.Mes.Client.Common;
- using System.Collections;
- using Core.LgMes.Client.Comm;
- namespace Core.LgMes.Client.LgDeviceManager
- {
- public partial class frmsendpot : FrmLgDevFunctions
- {
- public DataSet _ds;
- public string strHeatprocessNo = "";
- private string strInitID = "";
- public frmsendpot(string strInitID, OpeBase oba)
- {
- InitializeComponent();
- ob = oba;
- this.strInitID = strInitID;
- }
- public frmsendpot()
- { }
- private void frmsendpot_Load(object sender, EventArgs e)
- {
- if (this._ds == null) return;
- _ds.Tables[0].DefaultView.RowFilter = "STATUS='待用'";
- cmbNoLadle.Items.Clear();
- for (int i = 0; i < _ds.Tables[0].DefaultView.Count; i++)
- {
- cmbNoLadle.Items.Add(_ds.Tables[0].DefaultView[i]["LADLEID"].ToString());
- }
- cmbNoLadle.Text = strInitID;
- GetCVTHeatno();
- }
- /// <summary>
- /// 转炉号加载
- /// </summary>
- private void GetCVTHeatno()
- {
- try
- {
- this.txtCVT1.Text = "";
- this.txtCVT2.Text = "";
- this.txtCVT3.Text = "";
- string strErr = "";
- ArrayList arry = new ArrayList();
- arry.Add("frmsendpot_Query1");
- CommonClientToServer ccs = new CommonClientToServer();
- ccs.ob = this.ob;
- DataSet ds = ccs.ExecuteQueryFunctions("Core.LgMes.Server.Common.ComDBQuery", "doSimpleQuery", arry, out strErr);
- if (strErr == "")
- {
- if (ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
- {
- for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
- {
- string v_LH = "";
- string v_POS = ds.Tables[0].Rows[i]["objectid"].ToString().Substring(0, 1);
- string v_POSID = ds.Tables[0].Rows[i]["objectpos"].ToString().Substring(3, (int)OBJLEN.nDevCode);
- if (v_POS == "C")
- {
- v_LH = (ds.Tables[0].Rows[i]["objectid"].ToString().Substring(5, (int)OBJLEN.nHeatNo));
- strHeatprocessNo = ds.Tables[0].Rows[i]["objectid"].ToString();
- if (v_POSID == "01")
- this.txtCVT1.Text = v_LH;
- if (v_POSID == "02")
- this.txtCVT2.Text = v_LH;
- if (v_POSID == "03")
- this.txtCVT3.Text = v_LH;
- }
- }
- }
- }
- this.radcvt1.Checked = true;
- if (this.txtCVT1.Text.Trim().Length > 0) return;
- if (this.txtCVT2.Text.Trim().Length > 0)
- {
- this.radcvt2.Checked = true;
- return;
- }
- if (this.txtCVT3.Text.Trim().Length > 0)
- {
- this.radcvt3.Checked = true;
- return;
- }
- }
- catch { }
- }
- /// <summary>
- /// 钢包配送
- /// </summary>
- private void proc_OK()
- {
- if (this.cmbNoLadle.Text.Trim().Length == 0)
- {
- MessageBox.Show("请选择钢包号!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
- return;
- }
- string cvtheatno = "";
- if (this.radcvt1.Checked) cvtheatno = txtCVT1.Text;
- if (this.radcvt2.Checked) cvtheatno = txtCVT2.Text;
- if (this.radcvt3.Checked) cvtheatno = txtCVT3.Text;
- if (cvtheatno == "") return;
- string strError = "";
- string strErr = "";
- ArrayList arry = new ArrayList();
- arry.Add("frmsendpot_Query2");
- CommonClientToServer ccs = new CommonClientToServer();
- ccs.ob = this.ob;
- arry.Add(this.cmbNoLadle.Text);
- DataSet ds = ccs.ExecuteQueryFunctions("Core.LgMes.Server.Common.ComDBQuery", "doSimpleQuery", arry, out strErr);
- if (!(strError == "" && ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0))
- {
- this.label2.ForeColor = Color.Red;
- this.label2.Text = this.cmbNoLadle.Text.Trim() + "号钢包发送失败!";
- Application.DoEvents();
- System.Threading.Thread.Sleep(1000);
- this.label2.Text = "";
- return;
- }
- string strStatus = Convert.ToString(ds.Tables[0].Rows[0]["STATUS"].ToString().Trim());
- if (strStatus != "待用")
- {
- this.label2.ForeColor = Color.Red;
- this.label2.Text = this.cmbNoLadle.Text.Trim() + "号钢包当前状态为[" + strStatus + "],不能发送!";
- Application.DoEvents();
- System.Threading.Thread.Sleep(1000);
- this.label2.Text = "";
- return;
- }
- int iTimes = Convert.ToInt32(ds.Tables[0].Rows[0]["SLEEKTIMES"]);
- string strDo = "0";
- if (iTimes >= 3)
- {
- DialogResult dr = MessageBox.Show("[" + this.cmbNoLadle.Text.Trim() + "]号钢包当前滑板次数已经到达[" + iTimes.ToString() + "]次。\r\n"
- + "点击按钮[是]系统将滑板次数清零并发送钢包;\r\n"
- + "点击按钮[否]系统以当前次数加一并发送钢包;\r\n"
- + "点击按钮[取消]将不发送当前钢包。", "提示", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question);
- if (dr == DialogResult.Cancel) return;
- if (dr == DialogResult.Yes)
- strDo = "1";
- else if (dr == DialogResult.No)
- strDo = "0";
- }
- strError = "";
- string[] strParams = new string[4] { cmbNoLadle.Text, cvtheatno, strDo, strHeatprocessNo };
- string Mse = "";
- ProcedureZ("Core.LgMes.Server.DEV.Methods.DEVPublicMethods", "procedure", new object[] { "STL_DEV_Info.STL_GBILSend", strParams }, ob, out strError, out Mse);
- if (Convert.ToInt32(strError) > 0)
- {
- this.label2.ForeColor = Color.Green;
- this.label2.Text = this.cmbNoLadle.Text.Trim() + "号钢包发送成功!";
- Application.DoEvents();
- System.Threading.Thread.Sleep(800);
- FrmPotMgt frm = new FrmPotMgt();
- frm.Tag = this.Tag;
- frm.Getpotbasedata();
- this.Close();
- }
- else
- {
- this.label2.ForeColor = Color.Red;
- this.label2.Text = this.cmbNoLadle.Text.Trim() + strError;
- Application.DoEvents();
- System.Threading.Thread.Sleep(1000);
- this.label2.Text = "";
- }
- }
- private void toolStrip1_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
- {
- switch (e.ClickedItem.Name)
- {
- case "OK":
- this.proc_OK();
- break;
- case "CANCEL":
- this.Close();
- break;
- default:
- break;
- }
- }
- private void button5_Click(object sender, EventArgs e)
- {
- this.proc_OK();
- }
- private void button4_Click(object sender, EventArgs e)
- {
- this.Close();
- }
- }
- }
|