using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Collections;
using System.Reflection;
using CoreFS.CA06;
namespace Core.LgMes.Client.LgDeviceManager
{
public partial class FrmTundishManage : FrmLgDevFunctions
{
public FrmTundishManage()
{
InitializeComponent();
}
private void FrmTundishManage_Load(object sender, EventArgs e)
{
udteStart.DateTime = DateTime.Today;
udteEnd.DateTime = DateTime.Today;
InitializeFactory();
DataSet dsSteel = LadleCommonClass.GetSteelData("");
//增加Grid单位字段数据集
ugrdUseInfo.DisplayLayout.ValueLists.Add("SteelCode");
//绑定单位
ugrdUseInfo.DisplayLayout.Bands[0].Columns["GRUDE"].ValueList = ugrdUseInfo.DisplayLayout.ValueLists["SteelCode"];
QueryZJBData("", "");
}
///
/// 工具栏
///
///
///
public override void ToolBar_Click(object sender, string ToolbarKey)
{
switch (ToolbarKey)
{
case "BasicInfo"://基本信息
FrmTDBaseInfo frmTdbi = new FrmTDBaseInfo(ob);
frmTdbi.Tag = this;
if (ugrdBaseInfo.ActiveRow != null)
{
frmTdbi.strBH = Convert.ToString(ugrdBaseInfo.ActiveRow.Cells["TUNDISHID"].Value);
frmTdbi.strCCM = Convert.ToString(ugrdBaseInfo.ActiveRow.Cells["CCM_ID"].Value);
frmTdbi.strPID = Convert.ToString(ugrdBaseInfo.ActiveRow.Cells["ID"].Value);
}
frmTdbi.ShowDialog();
break;
case "Query":
this.QueryZJBbaseInfo("", "");
break;
case"Update":
ModifyZJBUseDetail();
break;
case"Delete":
DelZJBUseDetail();
break;
case "exit":
this.Close();
break;
}
}
private void chkQTundishName_CheckedChanged(object sender, EventArgs e)
{
ucmeID.Enabled = chkID.Checked;
}
private void chkQPositionID_CheckedChanged(object sender, EventArgs e)
{
ucmeZJH.Enabled = chkZJH.Checked;
proc_LoadCLID();
}
private void proc_LoadCLID()
{
try
{
string strErr = "";
string strSql = "";
if (chkZJH.Checked && ucmeZJH.SelectedIndex > -1)
{
if (ucmeZJH.Text.Trim() == "1#连铸机" || ucmeZJH.Text.Trim() == "2#连铸机" )
{
strSql = "select TUNDISHID from DEV_ZJB_BASE_INFO where CCM_ID = '1#连铸机' or CCM_ID = '2#连铸机' order by TUNDISHID";
}
else
strSql = "select TUNDISHID from DEV_ZJB_BASE_INFO where CCM_ID = '" + ucmeZJH.Text.Trim() + "' order by TUNDISHID";
}
else
strSql = "select distinct TUNDISHID from DEV_ZJB_BASE_INFO order by TUNDISHID";
CoreClientParam ccp = new CoreClientParam();
ccp.ServerName = "Core.LgMes.Server.DEV.Methods.DEVPublicMethods";
ccp.MethodName = "QueryMethods";
ccp.ServerParams = new Object[] { strSql };
DataTable dt = new DataTable();
ccp.SourceDataTable = dt;
ob.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
DataSet ds = new DataSet();
ds.Tables.Add(dt);
if (strErr != "" || !(ds != null && ds.Tables.Count > 0))
{
MessageBox.Show("中间包号加载失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
if (MessageBox.Show("是否重新加载中间包号?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
proc_LoadCLID();
return;
}
ucmeID.Items.Clear();
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
{
ucmeID.Items.Add(ds.Tables[0].Rows[i][0]);
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "提示");
}
}
public void QueryZJBData(string strCCMID, string strZJBNO)
{
proc_LoadCLID();
QueryZJBbaseInfo(strCCMID, strZJBNO);
}
private void InitializeFactory()
{
GetStickFactory();
GetPaintFactory();
GetWaterFactory();
GetSteel();
ucmeStickFactory.SelectedIndex = -1;
ucmeDopeFactory.SelectedIndex = -1;
ucmeSlidegateNozzleFactory.SelectedIndex = -1;
ucmeUpNozzleFactory.SelectedIndex = -1;
ucmeDownNozzleFactory.SelectedIndex = -1;
ucmeGrude.SelectedIndex = -1;
}
//中间包基础信息
private void QueryZJBbaseInfo(string strCCMID, string strZJBNO)
{
//string err = "";
string strWhere = "";
try
{
if (chkZJH.Checked && ucmeZJH.Text.Trim().Length > 0)
{
strWhere = " and CCM_ID = '" + ucmeZJH.Text.Trim() + "' ";
}
if (chkID.Checked && ucmeID.Text.Trim().Length > 0)
{
strWhere += " and TUNDISHID = '" + ucmeID.Text.Trim() + "' ";
}
CoreClientParam ccp = new CoreClientParam();
ccp.ServerName = "Core.LgMes.Server.LgDeviceManager.LadleManager";
ccp.MethodName = "QueryZJBbaseInfo";
ccp.ServerParams = new Object[]{strWhere};
DataTable dt = new DataTable();
ccp.SourceDataTable = dt;
ExecuteQueryToDataTable(ccp,CoreInvokeType.Internal);
DataSet ds = new DataSet();
ds.Tables.Add(dt);
try
{
((DataTable)ugrdBaseInfo.DataSource).Rows.Clear();
((DataSet)ugrdUseInfo.DataSource).Tables[0].Rows.Clear();
}
catch (Exception)
{
}
if (ds.Tables[0].Rows.Count > 0)
{
ugrdBaseInfo.DataSource = ds;
ugrdBaseInfo.DataSource = ds.Tables[0];
SetLeftTableRowColor();
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
///
/// 中间包使用信息
///
///
private void QueryZJBUseInfo(string strID)
{
string strWhere = "";//, err = "";
try
{
if (strID.Length > 0)
strWhere = "and t1.TUNDISHID = '" + strID + "' ";
if (chkDate.Checked)
{
strWhere += "and to_char(t1.UPLADLETIME,'yyyy-MM-dd') between '" + udteStart.DateTime.ToString("yyyy-MM-dd") + "' and '" + udteEnd.DateTime.ToString("yyyy-MM-dd") + "'";
}
else
{
strWhere += "and (t1.TUNDISHID,t1.CYCID) in (select TUNDISHID,CYCID from (select row_number() over (partition by x.TUNDISHID order by x.CYCID desc) xh, x.* from DEV_ZJB_USE_DETAIL x) where xh < 3)";
}
CoreClientParam ccp = new CoreClientParam();
ccp.ServerName = "Core.LgMes.Server.LgDeviceManager.LadleManager";
ccp.MethodName = "QueryZJBUseInfo";
ccp.ServerParams = new Object[] { strWhere };
DataTable dt = new DataTable();
ccp.SourceDataTable = dt;
ExecuteQueryToDataTable(ccp,CoreInvokeType.Internal);
DataSet ds = new DataSet();
ds.Tables.Add(dt);
try
{
((DataSet)ugrdUseInfo.DataSource).Tables[0].Rows.Clear();
}
catch (Exception)
{
}
if (ds != null && ds.Tables[0].Rows.Count > 0)
{
ugrdUseInfo.DataSource = ds;
SetRightTableRowColor();
if (ds.Tables[0].Rows.Count == 0)
proc_ResetEditArea();
}
else
{
proc_ResetEditArea();
return;
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
///
/// 删除选中行记录
///
private void DelZJBUseDetail()
{
try
{
if (ugrdUseInfo.Rows.Count == 0)
return;
if (ugrdUseInfo.ActiveRow == null)
{
MessageBox.Show("请选择要删除的使用记录!", "提示");
return;
}
if (MessageBox.Show("确定要删除当前中间包使用记录吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
return;
string strCCMID = Convert.ToString(this.ugrdUseInfo.ActiveRow.Cells["NOWPOSITION"].Value);
string strZJBNO = Convert.ToString(this.ugrdUseInfo.ActiveRow.Cells["TUNDISHID"].Value);
string[] strParams = new string[2] { "", "" };
strParams[0] = this.ugrdUseInfo.ActiveRow.Cells["ID"].Value.ToString();
strParams[1] = this.ugrdUseInfo.ActiveRow.Cells["CYCID"].Value.ToString();
string strErr = "";
string msg = "";
ProcedureFunctions("Core.LgMes.Server.DEV.Methods.DEVPublicMethods", "procedure", new object[] { "RES_LG_TOOLMANAGE.ZJBUSEINFO_DEL",strParams }, out strErr, out msg);
if (Convert.ToInt32(strErr) > 0)
{
QueryZJBData(strCCMID, strZJBNO);
MessageBox.Show(msg, "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
}
else
MessageBox.Show(msg, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
///
///修改一条中间包使用记录
///
///
///
private void ModifyZJBUseDetail()
{
try
{
if (ugrdUseInfo.Rows.Count == 0)
return;
if (ugrdUseInfo.ActiveRow == null)
{
MessageBox.Show("请选择要修改的使用记录!", "提示");
return;
}
if (MessageBox.Show("确定要修改当前中间包使用记录吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
return;
UInt32 iAge = 0;
if (!UInt32.TryParse(txtAge.Text.Trim(), out iAge))
{
MessageBox.Show("包龄输入不正确!", "提示");
txtAge.Focus();
return;
}
string strKJBB = "", strSBBB = "";
switch (ucmeUpClass.SelectedIndex)
{
case 0:
{
strSBBB = "1";
break;
}
case 1:
{
strSBBB = "2";
break;
}
case 2:
{
strSBBB = "3";
break;
}
case 3:
{
strSBBB = "4";
break;
}
default:
break;
}
switch (ucmeClass.SelectedIndex)
{
case 0:
{
strKJBB = "1";
break;
}
case 1:
{
strKJBB = "2";
break;
}
case 2:
{
strKJBB = "3";
break;
}
case 3:
{
strKJBB = "4";
break;
}
default:
break;
}
string strCCMID = Convert.ToString(this.ugrdUseInfo.ActiveRow.Cells["NOWPOSITION"].Value);
string strZJBNO = Convert.ToString(this.ugrdUseInfo.ActiveRow.Cells["TUNDISHID"].Value);
string[] strArgs = new string[24]
{
"","","","","","",
"","","","","","",
"","","","","","",
"","","","","",""
};
int i = 0;
strArgs[i++] = ugrdUseInfo.ActiveRow.Cells["ID"].Value.ToString();
strArgs[i++] = txtAge.Text.Trim();
strArgs[i++] = txtLadlelId.Text.Trim();
strArgs[i++] = strSBBB;
strArgs[i++] = uldtpUpLableDate.Text.Trim();
strArgs[i++] = ucmeGrude.Text.Trim();
strArgs[i++] = txtMouldID.Text.Trim();
strArgs[i++] = strKJBB;
strArgs[i++] = uldtpBeginDate.Text.Trim();
strArgs[i++] = udtpEndTime.Text.Trim();
strArgs[i++] = ucmeReason.Text.Trim();
strArgs[i++] = txtCheckName.Text.Trim();
strArgs[i++] = txtTundidhUse.Text.Trim();
strArgs[i++] = txtFactoryName.Text.Trim();
strArgs[i++] = ucmeSlidegateNozzleFactory.Text.Trim();
strArgs[i++] = ucmeDopeFactory.Text.Trim();
strArgs[i++] = ucmeUpNozzleFactory.Text.Trim();
strArgs[i++] = ucmeStickFactory.Text.Trim();
strArgs[i++] = ucmeDownNozzleFactory.Text.Trim();
strArgs[i++] = txtMemo.Text.Trim();
strArgs[i++] = udteMinFireBeginTime.Text.Trim();
strArgs[i++] = udteMiddleFireBeginTime.Text.Trim();
strArgs[i++] = udteMaxFireBeginTime.Text.Trim();
strArgs[i++] = ugrdUseInfo.ActiveRow.Cells["CYCID"].Value.ToString();
string strErr = "";
string msg="";
ProcedureFunctions("Core.LgMes.Server.DEV.Methods.DEVPublicMethods", "procedure", new object[] { "RES_LG_TOOLMANAGE.ZJBUSEINFO_EDIT", strArgs }, out strErr, out msg);
if (Convert.ToInt32(strErr) > 0)
{
QueryZJBData(strCCMID, strZJBNO);
MessageBox.Show(msg, "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
}
else
MessageBox.Show(msg, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
///
/// 从基础表中选择中间包上线
///
///
///
private void ulgridBaseInfo_DoubleClickRow(object sender, Infragistics.Win.UltraWinGrid.DoubleClickRowEventArgs e)
{
try
{
if (ugrdBaseInfo.ActiveRow == null)
return;
Infragistics.Win.UltraWinGrid.UltraGridRow ulgRow = ugrdBaseInfo.ActiveRow;
FrmTD frm = new FrmTD(ob);
frm.Tag = this;
frm.strID = Convert.ToString(ugrdBaseInfo.ActiveRow.Cells["ID"].Value);
frm.strNO = Convert.ToString(ugrdBaseInfo.ActiveRow.Cells["TUNDISHID"].Value);
frm.strCCM = Convert.ToString(ugrdBaseInfo.ActiveRow.Cells["CCM_ID"].Value);
frm.strPOS = Convert.ToString(ugrdBaseInfo.ActiveRow.Cells["STATIONS"].Value);
frm.strSTATUS = Convert.ToString(ugrdBaseInfo.ActiveRow.Cells["STATUS"].Value);
frm.ShowDialog();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
///
/// 清空编辑区
///
private void proc_ResetEditArea()
{
try
{
txtTundishName1.Text = "";
txtAge.Text = "";
cmbStatus.Text = "";
cmbCcmPositionID.Text = "";
txtLadlelId.Text = "";
ucmeUpClass.Text = "";
cmbPositionId.Text="";
uldtpUpLableDate.Text = "";
ucmeGrude.Text = "";
txtMouldID.Text = "";
ucmeClass.Text = "";
uldtpBeginDate.Text = "";
udtpEndTime.Text = "";
ucmeReason.Text = "";
txtCheckName.Text = "";
txtTundidhUse.Text = "";
txtFactoryName.Text = "";
ucmeSlidegateNozzleFactory.Text = "";
ucmeDopeFactory.Text = "";
ucmeUpNozzleFactory.Text = "";
ucmeStickFactory.Text = "";
ucmeDownNozzleFactory.Text = "";
txtMemo.Text = "";
txtTundishName.Text = "";
udteMinFireBeginTime.Text = "";
udteMiddleFireBeginTime.Text = "";
udteMaxFireBeginTime.Text = "";
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
///
/// 选中基础表中的一行,根据行中的 中间包编号 查询所对应的使用记录
///
private void ulgridBaseInfo_AfterRowActivate(object sender, EventArgs e)
{
try
{
if (this.ugrdBaseInfo.ActiveRow == null)
return;
string strZJBBH = Convert.ToString(ugrdBaseInfo.ActiveRow.Cells["ID"].Value);
QueryZJBUseInfo(strZJBBH);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
#region " 烘烤事件 "
private void btn_MinFire_Click(object sender, EventArgs e)//小火烘烤开始
{
if (ugrdUseInfo.Rows.Count == 0)
return;
if (ugrdUseInfo.ActiveRow == null)
{
MessageBox.Show("请选择中包使用记录!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
return;
}
if (this.udteMinFireBeginTime.Value == null)
this.udteMinFireBeginTime.DateTime = DateTime.Now;
string strZJBNO = Convert.ToString(ugrdUseInfo.ActiveRow.Cells["TUNDISHID"].Value);//中间包编号
string strCCMID = Convert.ToString(ugrdUseInfo.ActiveRow.Cells["NOWPOSITION"].Value);//铸机号
string strId = ugrdUseInfo.ActiveRow.Cells["ID"].Value.ToString();
string strPeriodCode = this.ugrdUseInfo.ActiveRow.Cells["CYCID"].Value.ToString();//周期编号
string strMinFireBeginTime = udteMinFireBeginTime.Value.ToString();
string strErr = "";
CoreClientParam ccp = new CoreClientParam();
ccp.ServerName = "Core.LgMes.Server.LgDeviceManager.LadleManager";
ccp.MethodName = "btn_MinFire_Click";
ccp.ServerParams = new Object[] { strId, strPeriodCode, strMinFireBeginTime };
ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
if (strErr != "")
{
MessageBox.Show("小火开始烘烤失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
}
else
{
QueryZJBbaseInfo(strCCMID, strZJBNO);
MessageBox.Show("小火开始烘烤成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
}
}
private void btn_MiddleFire_Click(object sender, EventArgs e)//中火烘烤开始
{
if (ugrdUseInfo.Rows.Count == 0)
return;
if (ugrdUseInfo.ActiveRow == null)
{
MessageBox.Show("请选择中包使用记录!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
return;
}
if (this.udteMiddleFireBeginTime.Value == null)
this.udteMiddleFireBeginTime.DateTime = DateTime.Now;
string strZJBNO = Convert.ToString(ugrdUseInfo.ActiveRow.Cells["TUNDISHID"].Value);
string strCCMID = Convert.ToString(ugrdUseInfo.ActiveRow.Cells["NOWPOSITION"].Value);
string strId = ugrdUseInfo.ActiveRow.Cells["ID"].Value.ToString();
string strPeriodCode = this.ugrdUseInfo.ActiveRow.Cells["CYCID"].Value.ToString();
string strMiddleFireBeginTime = udteMiddleFireBeginTime.Value.ToString();
string strErr = "";
CoreClientParam ccp = new CoreClientParam();
ccp.ServerName = "Core.LgMes.Server.LgDeviceManager.LadleManager";
ccp.MethodName = "btn_MiddleFire_Click";
ccp.ServerParams = new Object[] { strMiddleFireBeginTime,strId, strPeriodCode };
ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
if (strErr != "")
{
MessageBox.Show("中火开始烘烤失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
}
else
{
QueryZJBbaseInfo(strCCMID, strZJBNO);
MessageBox.Show("中火开始烘烤成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
}
}
private void btn_MaxFire_Click(object sender, EventArgs e)//大火烘烤开始
{
if (ugrdUseInfo.Rows.Count == 0)
return;
if (ugrdUseInfo.ActiveRow == null)
{
MessageBox.Show("请选择中包使用记录!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
return;
}
if (this.udteMaxFireBeginTime.Value == null)
this.udteMaxFireBeginTime.DateTime = DateTime.Now;
string strZJBNO = Convert.ToString(ugrdUseInfo.ActiveRow.Cells["TUNDISHID"].Value);
string strCCMID = Convert.ToString(ugrdUseInfo.ActiveRow.Cells["NOWPOSITION"].Value);
string strId = ugrdUseInfo.ActiveRow.Cells["ID"].Value.ToString();
string strPeriodCode = this.ugrdUseInfo.ActiveRow.Cells["CYCID"].Value.ToString();
string strMaxFireBeginTime = udteMaxFireBeginTime.Value.ToString();
string strErr = "";
CoreClientParam ccp = new CoreClientParam();
ccp.ServerName = "Core.LgMes.Server.LgDeviceManager.LadleManager";
ccp.MethodName = "btn_MaxFire_Click";
ccp.ServerParams = new Object[] { strMaxFireBeginTime, strId, strPeriodCode };
ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
if (strErr != "")
{
MessageBox.Show("大火开始烘烤失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
}
else
{
QueryZJBbaseInfo(strCCMID, strZJBNO);
MessageBox.Show("大火开始烘烤成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
}
}
#endregion
///
/// 设置中间包使用表相应状态的颜色
///
private void SetRightTableRowColor()
{
for (int i = 0; i < this.ugrdUseInfo.Rows.Count; i++)
{
switch (this.ugrdUseInfo.Rows[i].Cells["STATUS"].Text.Trim())
{
case "浇铸位"://浇铸位
this.ugrdUseInfo.Rows[i].Appearance.BackColor = Color.LightGreen;
break;
case "等待位"://等待位
this.ugrdUseInfo.Rows[i].Appearance.BackColor = Color.LightBlue;
break;
case "未知"://未知
this.ugrdUseInfo.Rows[i].Appearance.BackColor = Color.LightCyan;
break;
default:
this.ugrdUseInfo.Rows[i].Appearance.BackColor = Color.LightYellow;
break;
}
}
}
///
/// 设置中间包基本表相应状态的颜色
///
private void SetLeftTableRowColor()
{
for (int i = 0; i < this.ugrdBaseInfo.Rows.Count; i++)
{
switch (this.ugrdBaseInfo.Rows[i].Cells["STATUS"].Text.Trim())
{
case "浇铸位"://浇铸位
this.ugrdBaseInfo.Rows[i].Appearance.BackColor = Color.LightGreen;
break;
case "等待位"://等待位
this.ugrdBaseInfo.Rows[i].Appearance.BackColor = Color.LightBlue;
break;
case "未知"://未知
this.ugrdBaseInfo.Rows[i].Appearance.BackColor = Color.LightCyan;
break;
default:
this.ugrdBaseInfo.Rows[i].Appearance.BackColor = Color.LightYellow;
break;
}
}
}
///
/// 获取钢种【没有牌号表】
///
private void GetSteel()
{
try
{
string strsql = "Select SteelCode, steel steelname from scm_steel where LARGEFLAG='1' ORDER BY SteelCode";
CoreClientParam ccp = new CoreClientParam();
ccp.ServerName = "Core.LgMes.Server.DEV.Methods.DEVPublicMethods";
ccp.MethodName = "QueryMethods";
ccp.ServerParams = new Object[] { strsql };
DataTable dt = new DataTable();
ccp.SourceDataTable = dt;
ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
DataSet ds = new DataSet();
ds.Tables.Add(dt);
this.ucmeGrude.Items.Clear();
for (int i = 0; i < ds.Tables[0].Rows.Count; i++) //遍历所有行的信息
{
this.ucmeGrude.Items.Add(ds.Tables[0].Rows[i][0]);//显示第一列的所有行的信息
ucmeGrude.DisplayMember = "steelname";
ucmeGrude.ValueMember = "steelcode";
}
}
catch { }
}
#region " 塞棒、水口、涂料的厂家 "
///
/// 获取塞棒厂家
///
private void GetStickFactory()
{
try
{
ArrayList ar = new ArrayList();
ar.Add(LadleCommonClass.strStickFactoryCode);
ar.Add("");
ar.Add("order by BASENAME");
DataSet ds = QueryArray("Core.LgMes.Server.LgDeviceManager.LadleManager", "GetFactory", new object[]{ar});
if ( ds != null)
{
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
{
this.ucmeStickFactory.Items.Add(ds.Tables[i].Rows[i][1]);
}
}
}
catch { }
}
///
/// 获取涂料厂家
///
private void GetPaintFactory()
{
try
{
ArrayList ar = new ArrayList();
ar.Add(LadleCommonClass.strPaintFactoryCode);
ar.Add("");
ar.Add("order by BASENAME");
DataSet ds = QueryArray("Core.LgMes.Server.LgDeviceManager.LadleManager", "GetFactory", new object[] { ar });
if (ds != null)
{
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
{
this.ucmeDopeFactory.Items.Add(ds.Tables[i].Rows[i][1]);
}
}
}
catch { }
}
///
/// 取水口厂家
///
private void GetWaterFactory()
{
try
{
ArrayList ar = new ArrayList();
ar.Add(LadleCommonClass.strWaterFactoryCode);
ar.Add("");
ar.Add("order by BASENAME");
DataSet ds = QueryArray("Core.LgMes.Server.LgDeviceManager.LadleManager", "GetFactory", new object[] { ar });
if (ds != null)
{
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
{
this.ucmeSlidegateNozzleFactory.Items.Add(ds.Tables[0].Rows[i][1]);//滑动水口
this.ucmeUpNozzleFactory.Items.Add(ds.Tables[0].Rows[i][1]);//上水口
this.ucmeDownNozzleFactory.Items.Add(ds.Tables[0].Rows[i][1]);//下水口
}
}
}
catch { }
}
#endregion
///
/// 编辑区赋值
///
///
///
private void ulgridUseInfo_AfterRowActivate(object sender, EventArgs e)
{
try
{
if (ugrdUseInfo.ActiveRow == null)
{
proc_ResetEditArea();
return;
}
Infragistics.Win.UltraWinGrid.UltraGridRow aRow = ugrdUseInfo.ActiveRow;
txtTundishName1.Text = Convert.ToString(aRow.Cells["TUNDISHID"].Value.ToString().Trim());
txtAge.Text = Convert.ToString(aRow.Cells["AGE"].Value.ToString().Trim());
cmbStatus.Text = Convert.ToString(aRow.Cells["STATUS"].Value.ToString().Trim());
cmbCcmPositionID.Text = Convert.ToString(aRow.Cells["NOWPOSITION"].Value.ToString().Trim());
txtLadlelId.Text = Convert.ToString(aRow.Cells["LADLELIDID"].Value.ToString().Trim());
ucmeUpClass.Text = Convert.ToString(aRow.Cells["ONCLASS"].Value.ToString().Trim());
cmbPositionId.Text = Convert.ToString(aRow.Cells["STATIONS"].Value.ToString().Trim());///
uldtpUpLableDate.Text = Convert.ToString(aRow.Cells["UPLADLETIME"].Value.ToString().Trim());
ucmeGrude.Text = Convert.ToString(aRow.Cells["GRUDE"].Value.ToString().Trim());
txtMouldID.Text = Convert.ToString(aRow.Cells["MOULDID"].Value.ToString().Trim());
ucmeClass.Text = Convert.ToString(aRow.Cells["OPENWCLASS"].Value.ToString().Trim());
uldtpBeginDate.Text = Convert.ToString(aRow.Cells["BEGINTIME"].Value.ToString().Trim());
udtpEndTime.Text = Convert.ToString(aRow.Cells["ENDTIME"].Value.ToString().Trim());
ucmeReason.Text = Convert.ToString(aRow.Cells["REASON"].Value.ToString().Trim());
txtCheckName.Text = Convert.ToString(aRow.Cells["CHECKNAME"].Value.ToString().Trim());
txtTundidhUse.Text = Convert.ToString(aRow.Cells["TUNDISHUSE"].Value.ToString().Trim());
txtFactoryName.Text = Convert.ToString(aRow.Cells["FACTORYNAME"].Value.ToString().Trim());
ucmeSlidegateNozzleFactory.Text = Convert.ToString(aRow.Cells["SLIDEGATENOZZLEFACTROY"].Value.ToString().Trim());
ucmeDopeFactory.Text = Convert.ToString(aRow.Cells["DOPEFACTROY"].Value.ToString().Trim());
ucmeUpNozzleFactory.Text = Convert.ToString(aRow.Cells["UPNOZZLEFACTROY"].Value.ToString().Trim());
ucmeStickFactory.Text = Convert.ToString(aRow.Cells["STICKFACTROY"].Value.ToString().Trim());
ucmeDownNozzleFactory.Text = Convert.ToString(aRow.Cells["DOWNNOZZLEFACTROY"].Value.ToString().Trim());
txtMemo.Text = Convert.ToString(aRow.Cells["MEMO"].Value.ToString().Trim());
txtTundishName.Text = Convert.ToString(aRow.Cells["TUNDISHID"].Value.ToString().Trim());
udteMinFireBeginTime.Text = Convert.ToString(aRow.Cells["MINFIREBEGINTIME"].Value.ToString().Trim());
udteMiddleFireBeginTime.Text = Convert.ToString(aRow.Cells["MIDDLEFIREBEGINTIME"].Value.ToString().Trim());
udteMaxFireBeginTime.Text = Convert.ToString(aRow.Cells["MAXBEGINTIME"].Value.ToString().Trim());
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
private void cbbZJH_SelectedIndexChanged(object sender, EventArgs e)
{
proc_LoadCLID();
}
private void cbDate_CheckedChanged(object sender, EventArgs e)
{
udteStart.Enabled = chkDate.Checked;
udteEnd.Enabled = chkDate.Checked;
}
//小火烘烤清除
private void btnClrMin_Click(object sender, EventArgs e)
{
try
{
if (ugrdUseInfo.Rows.Count == 0)
return;
if (ugrdUseInfo.ActiveRow == null)
{
MessageBox.Show("请选择中包使用记录!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
return;
}
string strZJBNO = Convert.ToString(ugrdUseInfo.ActiveRow.Cells["TUNDISHID"].Value);
string strCCMID = Convert.ToString(ugrdUseInfo.ActiveRow.Cells["NOWPOSITION"].Value);
string strId = ugrdUseInfo.ActiveRow.Cells["ID"].Value.ToString();
string strPeriodCode = this.ugrdUseInfo.ActiveRow.Cells["CYCID"].Value.ToString();
CoreClientParam ccp = new CoreClientParam();
ccp.ServerName = "Core.LgMes.Server.LgDeviceManager.LadleManager";
ccp.MethodName = "btnClrMin_Click";
ccp.ServerParams = new Object[] { strId, strPeriodCode };
ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
QueryZJBbaseInfo(strCCMID, strZJBNO);
MessageBox.Show("小火开始时间清除成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
//中火开始时间清除成功
private void btnClrMid_Click(object sender, EventArgs e)
{
try
{
if (ugrdUseInfo.Rows.Count == 0)
return;
if (ugrdUseInfo.ActiveRow == null)
{
MessageBox.Show("请选择中包使用记录!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
return;
}
string strZJBNO = Convert.ToString(ugrdUseInfo.ActiveRow.Cells["TUNDISHID"].Value);
string strCCMID = Convert.ToString(ugrdUseInfo.ActiveRow.Cells["NOWPOSITION"].Value);
string strId = ugrdUseInfo.ActiveRow.Cells["ID"].Value.ToString();
string strPeriodCode = this.ugrdUseInfo.ActiveRow.Cells["CYCID"].Value.ToString();
CoreClientParam ccp = new CoreClientParam();
ccp.ServerName = "Core.LgMes.Server.LgDeviceManager.LadleManager";
ccp.MethodName = "btnClrMid_Click";
ccp.ServerParams = new Object[] { strId, strPeriodCode };
ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
QueryZJBbaseInfo(strCCMID, strZJBNO);
MessageBox.Show("中火开始时间清除成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
//大火开始时间清除成功
private void btnClrMax_Click(object sender, EventArgs e)
{
try
{
if (ugrdUseInfo.Rows.Count == 0)
return;
if (ugrdUseInfo.ActiveRow == null)
{
MessageBox.Show("请选择中包使用记录!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
return;
}
string strZJBNO = Convert.ToString(ugrdUseInfo.ActiveRow.Cells["TUNDISHID"].Value);
string strCCMID = Convert.ToString(ugrdUseInfo.ActiveRow.Cells["NOWPOSITION"].Value);
string strId = ugrdUseInfo.ActiveRow.Cells["ID"].Value.ToString();
string strPeriodCode = this.ugrdUseInfo.ActiveRow.Cells["CYCID"].Value.ToString();
CoreClientParam ccp = new CoreClientParam();
ccp.ServerName = "Core.LgMes.Server.LgDeviceManager.LadleManager";
ccp.MethodName = "btnClrMax_Click";
ccp.ServerParams = new Object[] { strId, strPeriodCode };
ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
QueryZJBbaseInfo(strCCMID, strZJBNO);
MessageBox.Show("大火开始时间清除成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
}
}