using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using CoreFS.CA06;
using Core.Mes.Client.Common;
namespace Core.LgMes.Client.LgDeviceManager
{
public partial class FrmEAFBaseInfo : FrmLgDevFunctions
{
//OpeBase ob = null;
public DataSet _ds;
public FrmEAFBaseInfo(OpeBase oba)
{
InitializeComponent();
cmbLKBH.SelectedIndex = 1;
ob = oba;
}
/// <菜单栏>
/// 菜单栏
///
///
///
private void toolStrip1_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
{
switch (e.ClickedItem.Name)
{
case "ADD":
{
this.proc_Add();
break;
}
case "EDIT":
{
this.proc_Edit();
break;
}
case "DEL":
{
this.proc_Del();
break;
}
case "CLOSE":
{
this.Close();
break;
}
default:
break;
}
}
/// <电炉炉壳基本信息新增>
/// 电炉炉壳基本信息新增
///
private void proc_Add()
{
try
{
string LKBH = cmbLKBH.Text.Trim().ToString();
string LH = cmbLH.Text.Trim().ToString();
string JHBH = cmbPlan.Text.Trim().ToString();
//string BB = cBxclass.Text.Trim().ToString();
string BL = txtBL.Text.Trim().ToString();
string BJ = txtBJ.Text.Trim().ToString();
string CS = txtCS.Text.Trim().ToString();
string LJ = txtLJ.Text.Trim().ToString();
string MEMO = txtMEMO.Text.Trim().ToString();
string SLKSYCS = txtSLKCS.Text.Trim().ToString();
string[] strParams = new string[9] { LKBH, LH, JHBH, BL, BJ, CS, LJ, MEMO, SLKSYCS };
string strErr = "";
string msg = "";
ProcedureZ("Core.LgMes.Server.DEV.Methods.DEVPublicMethods", "procedure", new object[] { "STL_DEV_Info.EafToolAdd", strParams },ob,out strErr, out msg);
if (Convert.ToInt32(strErr) > 0)
{
FrmSteelBagManage FRMST = (FrmSteelBagManage)this.Tag;//获取主界面方法
FRMST.EAFInfo();//主界面基本信息查询
MessageBox.Show(msg, "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
this.Close();
}
else
MessageBox.Show(msg, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
///
/// 电炉炉壳基本信息修改
///
private void proc_Edit()
{
try
{
string LKBH = cmbLKBH.Text.Trim().ToString();
string LH = cmbLH.Text.Trim().ToString();
string JHBH = cmbPlan.Text.Trim().ToString();
string riqi = dTPkdate.Value.ToString("yyyy-MM-dd");
string BL = txtBL.Text.Trim().ToString();
string BJ = txtBJ.Text.Trim().ToString();
string CS = txtCS.Text.Trim().ToString();
string LJ = txtLJ.Text.Trim().ToString();
string MEMO = txtMEMO.Text.Trim().ToString();
string SLKSYCS = txtSLKCS.Text.Trim().ToString();
string[] strParams = new string[10] { LKBH, LH, JHBH, riqi, BL, BJ, CS, LJ, MEMO, SLKSYCS };
string strErr = "";
string msg = "";
ProcedureZ("Core.LgMes.Server.DEV.Methods.DEVPublicMethods", "procedure", new object[] { "STL_DEV_Info.EafToolExit", strParams }, ob, out strErr, out msg);
if (Convert.ToInt32(strErr) > 0)
{
FrmSteelBagManage FRMST = (FrmSteelBagManage)this.Tag;//获取主界面方法
FRMST.EAFInfo();//主界面基本信息查询
MessageBox.Show(msg, "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
this.Close();
}
else
MessageBox.Show(msg, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
///
/// 删除
///
private void proc_Del()
{
try
{
string LKBH = cmbLKBH.Text.Trim().ToString();
string[] strParams = new string[1] { LKBH};
string strErr = "";
string msg = "";
ProcedureZ("Core.LgMes.Server.DEV.Methods.DEVPublicMethods", "procedure", new object[] { "STL_DEV_Info.EafToolDEL", strParams }, ob, out strErr, out msg);
if (Convert.ToInt32(strErr) > 0)
{
FrmSteelBagManage FRMST = (FrmSteelBagManage)this.Tag;//获取主界面方法
FRMST.EAFInfo();//主界面基本信息查询
MessageBox.Show(msg, "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
this.Close();
}
else
MessageBox.Show(msg, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
private void FrmEAFBaseInfo_Load(object sender, EventArgs e)
{
//绑定炉壳编号
loadquery();
//绑定包龄包级~~~
LKBHquery();
}
//绑定炉壳编号
private void loadquery()
{
if (this._ds == null) return;
for (int i = 0; i < _ds.Tables[0].Rows.Count; i++)
{
cmbLKBH.Items.Add(_ds.Tables[0].Rows[i]["EAFSHELLID"].ToString());//炉壳编号
cmbLH.Items.Add(_ds.Tables[0].Rows[i]["HEATNO"].ToString());//炉号
cmbPlan.Items.Add(_ds.Tables[0].Rows[i]["PLANID"].ToString());//计划编号
}
}
//绑定包龄包级~~~
///
/// 绑定包龄包级
///
private void LKBHquery()
{
string sqlstr="select B.EAFSHELLID,B.HEATNO,B.EAFSHELLLVL,B.EAFSHELLAGE,"
+ "B.EAFSHELLSTATUS,B.STEELACCOUNT,B.USETIMES,B.PLANID,B.BUYDATE,B.NOZZLEOUTFITUSETIMES,B.BRICKFACTORY,MEMO,ONFUACEVIEWS "
+ "from dev_eafshell_base_info B where EAFSHELLID='" + cmbLKBH.Text.Trim()+ "'";
DataSet ds = QueryFixedFunions(sqlstr, ob);
if (ds.Tables[0].Rows.Count > 0)
{
txtBL.Text = ds.Tables[0].Rows[0]["EAFSHELLAGE"].ToString();
txtBJ.Text = ds.Tables[0].Rows[0]["EAFSHELLLVL"].ToString();
cmbLH.Text = ds.Tables[0].Rows[0]["HEATNO"].ToString();
cmbPlan.Text = ds.Tables[0].Rows[0]["PLANID"].ToString();
dTPkdate.Text = ds.Tables[0].Rows[0]["BUYDATE"].ToString();
txtCS.Text = ds.Tables[0].Rows[0]["USETIMES"].ToString();
txtLJ.Text = ds.Tables[0].Rows[0]["STEELACCOUNT"].ToString();
txtMEMO.Text = ds.Tables[0].Rows[0]["MEMO"].ToString();
txtSLKCS.Text = ds.Tables[0].Rows[0]["ONFUACEVIEWS"].ToString();
}
}
private void cBxLKBH_SelectionChanged(object sender, EventArgs e)
{
LKBHquery();
}
}
}