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 Infragistics.Win.UltraWinEditors;
using System.Threading;
using System.Diagnostics;
using System.IO;
using System.Collections;
using Core.LgMes.Client.Comm;
using Core.Mes.Client.Common;
using Core.LgMes.Client.LgResMgt;
namespace Core.LgMes.Client.LgResMgt
{
public partial class frmVdResults : CoreFS.CA06.FrmBase
{
private System.Threading.Thread myThread;
private bool threadGoOn = true;
private bool m_bJJBFlag = false, m_bDelay = false;
private string DEVICE_POSITION = ""; //指定是哪个精炼炉
private int DEVICE_POS = 1;
private DataSet m_dsLFSCZXX = new DataSet();
private string m_szJRCLH = "", m_szLH = "", m_strDisposaTime = "";
string datetime = System.DateTime.Now.ToString("HH:mm:ss");
private Hashtable _htRhsJobInfo; // 用于作业信息的表字段数据
private Hashtable _UpdateBefore; //修改之前值
private Hashtable _UpdateAfter; //修改之后值
private Hashtable _UpdateColumnName; //修改字段名
public frmVdResults()
{
InitializeComponent();
CheckForIllegalCrossThreadCalls = false;
}
///
/// 如果加热处理号的第五位不为1的话,该行的背景色设为red
///
private void SetColumnRGB()
{
try
{
if (this.udLH != null && udLH.Rows.Count > 0)
{
foreach (Infragistics.Win.UltraWinGrid.UltraGridRow row in this.udLH.Rows)
{
if (row.Cells["DisposalTime"].Value.ToString() != "01")
{
row.Appearance.BackColor = Color.Red;
}
else
{
row.Appearance.BackColor = Color.White;
}
if (row.Cells["HEATPROCESSNO"].Value.ToString() == m_szJRCLH)
{
if(udLH.ActiveRow !=null)
udLH.ActiveRow = row;
}
}
}
}
catch
{
}
}
private void frmRhsCollect_Load(object sender, EventArgs e)
{
string strErr = "";
ultraDateTimeEditor3.Enabled = false;
ultraDateTimeEditor4.Enabled = false;
SetUserControlDelegate();
//获取牌号信息
ArrayList arrySteel = new ArrayList();
arrySteel.Add("GetSteelInfo.select");
CommonClientToServer cctos = new CommonClientToServer();
cctos.ob = this.ob;
DataSet ds = cctos.ExecuteQueryFunctions("Core.LgMes.Server.Common.ComDBQuery",
"doSimpleQuery", arrySteel, out strErr);
if (strErr == "" && ds != null)
{
Core.Mes.Client.Common.Globals.FillUltraComboItems(urlCb_steelNo, ds);
}
//初始化
ultraDataSource1.Rows.Add(new object[] { null });
_htRhsJobInfo = new Hashtable();
_UpdateAfter = new Hashtable();
_UpdateBefore = new Hashtable();
_UpdateColumnName = new Hashtable();
if (this.Tag != null)
{
DEVICE_POSITION = "VDS0" + this.Tag.ToString().Substring(0, 1);
DEVICE_POS = Convert.ToInt32(this.Tag.ToString().Substring(0, 1));
}
else
{
DEVICE_POSITION = this.CustomInfo.ToString();
DEVICE_POS = Convert.ToInt32(this.CustomInfo.Substring(this.CustomInfo.Length - 1, 1));
}
this.ultraDateTimeEditor4.Value = System.DateTime.Now;
this.ultraDateTimeEditor3.Value = System.DateTime.Now;
// 初始化吹氩站信息
dsLfs.Tables["dtbLfs"].Rows.Add(new object[] { "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" });
dsLfs_AddItives.Tables["dtbLfs_AddItives"].Rows.Add(new object[] { "", "", "", "", "", "", "", "", "", "", "", "" });
//打开窗口时,自动给班次赋初值为:全部
this.cbbBC.Text = this.cbbBC.Items[cbbBC.Items.Count - 1].ToString();
RefreshStoveInfo(DateTime.Now.ToString("yyyy-MM-dd"), DateTime.Now.ToString("yyyy-MM-dd"), " where 1=1");
ucAdditives1.ob = this.ob;
ucAdditives1.GetMaterialData();
ucAdditives1.SetHopperInfo(DEVICE_POSITION);
//给炉号ultragrid绑定列
//SetCaption();
SetColumnRGB();
//取送电档位数据信息
GetRhsOxygenblowingInfo("", "", "");
//绑定送电档位ultragrid列
//SetSDCaption();
//判断是否交班
JudgeIfChangeClass();
}
private void checkBox1_CheckedChanged(object sender, EventArgs e)
{
if (this.checkBox1.Checked == true)
{
threadGoOn = false;
this.btn_QueryStove.Enabled = true;
this.ultraDateTimeEditor4.Enabled = true;
this.ultraDateTimeEditor3.Enabled = true;
}
else
{
threadGoOn = true;
this.btn_QueryStove.Enabled = false;
this.ultraDateTimeEditor4.Enabled = false;
this.ultraDateTimeEditor3.Enabled = false;
QueryLHInfo();
}
}
///
/// 判断是否交班
///
private void JudgeIfChangeClass()
{
try
{
myThread = new Thread(new ThreadStart(QueryClass));
myThread.Priority = ThreadPriority.Normal;
myThread.Start();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
private void QueryClass()
{
try
{
int i = 0, scanLH = 5;
System.Windows.Forms.Control.CheckForIllegalCrossThreadCalls = false;
while (true)
{
if (!this.On_Off_Thread)//!this.On_Off_Thread
{
System.Threading.Thread.Sleep(40000);
continue;
}
Thread.Sleep(4000);
string strError = "";
DateTime currTime = DateTime.Now;
if (strError == "")
{
datetime = currTime.ToString("HH:mm:ss");
}
string Z1 = "07:45:00", Z2 = "08:16:00", Z3 = "15:45:00", Z4 = "16:16:00", Z5 = "23:45:00", Z6 = "23:59:59", Z7 = "00:00:00", Z8 = "00:00:16";
if ((string.Compare(datetime, Z1) >= 0 && string.Compare(datetime, Z2) < 0)
|| (string.Compare(datetime, Z3) >= 0 && string.Compare(datetime, Z4) < 0)
|| (string.Compare(datetime, Z5) >= 0 && string.Compare(datetime, Z6) < 0)
|| (string.Compare(datetime, Z7) >= 0 && string.Compare(datetime, Z8) < 0))
{
ucPlan1.ultraGrid1.Rows[0].Cells["cue"].Value = "交接班时间到!";
ucPlan1.ultraGrid1.Rows[0].Cells["cue"].Appearance.FontData.SizeInPoints = 15;
ucPlan1.ultraGrid1.Rows[0].Cells["cue"].Appearance.FontData.Bold = Infragistics.Win.DefaultableBoolean.True;
switch (i)
{
case 0:
ucPlan1.ultraGrid1.Rows[0].Cells["cue"].Appearance.ForeColor = Color.Blue;
break;
case 1:
ucPlan1.ultraGrid1.Rows[0].Cells["cue"].Appearance.ForeColor = Color.Red;
break;
case 2:
ucPlan1.ultraGrid1.Rows[0].Cells["cue"].Appearance.ForeColor = Color.SeaGreen;
break;
case 3:
ucPlan1.ultraGrid1.Rows[0].Cells["cue"].Appearance.ForeColor = Color.Green;
break;
case 4:
ucPlan1.ultraGrid1.Rows[0].Cells["cue"].Appearance.ForeColor = Color.Gray;
break;
default:
ucPlan1.ultraGrid1.Rows[0].Cells["cue"].Appearance.ForeColor = Color.LightSeaGreen;
i = -1;
break;
}
i++;
if (ubJJB.Enabled == false)
ubJJB.Enabled = true;
}
else
{
if (ubJJB.Enabled == true)
ubJJB.Enabled = false;
m_bJJBFlag = false;
m_bDelay = false;
//label49.Text = "";
}
scanLH++;
if (scanLH == 6)
{
scanLH = 0;
//刷新炉号信息
QueryLHInfo();
}
}
}
catch
{
myThread.Abort();
}
}
public override void ToolBar_Click(object sender, string ToolbarKey)
{
switch (ToolbarKey)
{
case "Relieve":
foreach (Form mdiChild in this.MdiParent.MdiChildren)
{
if (mdiChild.Text == DEVICE_POS + "#炼钢转炉交接班管理")
{
mdiChild.Activate();
return;
}
}
frmCcmMgt frm = new frmCcmMgt(DEVICE_POSITION);
frm.Text = DEVICE_POS + "#炼钢转炉交接班管理";
frm.MdiParent = this.MdiParent;
frm.AutoSize = true;
frm.Show();
break;
case "Refresh":
DialogResult result = DialogResult.No;
result = MessageBox.Show(this, "刷新将撤消界面上所做的修改,继续?", "提示", MessageBoxButtons.YesNo,
MessageBoxIcon.Question, MessageBoxDefaultButton.Button1);
if (result == DialogResult.Yes)
{
RefreshData();
}
break;
case "Save"://新增
udLH.Select(); //释放焦点
Save();
break;
case "Exit":
this.Close();
break;
default:
break;
}
}
///
/// 刷新炉号信息
///
private void QueryLHInfo()
{
if (threadGoOn)
{
RefreshStoveInfo(DateTime.Now.ToString("yyyy-MM-dd"), DateTime.Now.ToString("yyyy-MM-dd"), " where 1=1");
SetColumnRGB();
}
}
///
/// 取当前班次
///
private string GetClassCode()
{
#region "取班次编码"
string szCurrClass = "";
return (szCurrClass);
#endregion
}
///
/// 刷新炉号信息
///
private void RefreshStoveInfo(string szDate1, string szDate2, string szAnd)
{
try
{
string strErr = "", szWhere = "";
szWhere = szAnd + " and STATIONCODE='0" + DEVICE_POS.ToString() + "' and to_char(OPTDATE,'yyyy-MM-dd')>='" + szDate1 + "' and to_char(OPTDATE,'yyyy-MM-dd')<='" + szDate2 + "'";
ArrayList arry = new ArrayList();
arry.Add("GetVDStoveInfo_Load.select");
arry.Add(DEVICE_POS);
arry.Add(szDate1);
arry.Add(szDate2);
arry.Add(DEVICE_POS);
arry.Add(szDate1);
arry.Add(szDate2);
CommonClientToServer cctos = new CommonClientToServer();
cctos.ob = this.ob;
DataSet ds = cctos.ExecuteQueryFunctions("Core.LgMes.Server.Common.ComDBQuery",
"doSimpleQuery", arry, out strErr);
if (strErr == "")
{
DataTable dt = ds.Tables[0];
if (dt != null)
{
dsLH.Tables[0].Clear();
dsLH.Tables[0].Merge(ds.Tables[0]);
dt.TableName = "LHXX";
if (m_dsLFSCZXX.Tables.Contains("LHXX"))
m_dsLFSCZXX.Tables["LHXX"].Clear();
m_dsLFSCZXX.Merge(dt);
}
}
else
{
MessageBox.Show("查询失败!!!", "提示");
dsLH.Clear();
}
}
catch
{
}
}
///
/// 给炉号ultragrid绑定列
///
private void SetCaption()
{
try
{
//HEATPROCESSNO:加热处理号
//HEATNO:熔炼号(炉号)
if (m_dsLFSCZXX.Tables["LHXX"] != null && m_dsLFSCZXX.Tables["LHXX"].Rows != null)
{
this.udLH.DataSource = m_dsLFSCZXX.Tables["LHXX"];
this.udLH.DisplayLayout.Bands[0].Columns["HEATNO"].Width = 140;
this.udLH.DisplayLayout.Bands[0].Columns["HEATNO"].Header.Caption = "熔炼号";
this.udLH.DisplayLayout.Bands[0].Columns["HEATNO"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
this.udLH.DisplayLayout.Bands[0].Columns["HEATNO"].SortIndicator = Infragistics.Win.UltraWinGrid.SortIndicator.Descending;
this.udLH.DisplayLayout.Bands[0].Columns["HEATPROCESSNO"].Hidden = true;
this.udLH.DisplayLayout.Bands[0].Columns["DisposalTime"].Hidden = true;
}
}
catch
{ }
}
///
/// 取吹氧数据
///
///
private void GetRhsOxygenblowingInfo(string strHeatNo, string strStationCode, string strDisposalTime)
{
try
{
string strErr = "", strHNo = "", strSCode = "", strDTime = "";
strHNo = strHeatNo;
strSCode = strStationCode;
strDTime = strDisposalTime;
ArrayList arry = new ArrayList();
arry.Add("GetVDsObInfo.select");
arry.Add(strHNo);
arry.Add(strHNo);
arry.Add(strSCode);
arry.Add(strSCode);
arry.Add(strDTime);
arry.Add(strDTime);
arry.Add(strHNo);
arry.Add(strHNo);
arry.Add(strSCode);
arry.Add(strSCode);
arry.Add(strDTime);
arry.Add(strDTime);
CommonClientToServer cctos = new CommonClientToServer();
cctos.ob = this.ob;
DataSet ds = cctos.ExecuteQueryFunctions("Core.LgMes.Server.Common.ComDBQuery",
"doSimpleQuery", arry, out strErr);
if (strErr == "")
{
DataTable dt = ds.Tables[0];
dt.TableName = "O2INFO";
if (m_dsLFSCZXX.Tables.Contains("O2INFO"))
m_dsLFSCZXX.Tables["O2INFO"].Clear();
m_dsLFSCZXX.Merge(dt);
SetSDCaption();
}
}
catch (Exception ex)
{
string sss = ex.Message;
}
}
///
/// 吹氧ultragrid的列绑定
///
private void SetSDCaption()
{
this.udSDDW.DataSource = m_dsLFSCZXX.Tables["O2INFO"];
this.udSDDW.DisplayLayout.Bands[0].Columns["O2NUMID"].Width = 52;
this.udSDDW.DisplayLayout.Bands[0].Columns["O2NUMID"].Header.Caption = "吹氧";
this.udSDDW.DisplayLayout.Bands[0].Columns["O2NUMID"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
this.udSDDW.DisplayLayout.Bands[0].Columns["O2STARTTIME"].Width = 70;
this.udSDDW.DisplayLayout.Bands[0].Columns["O2STARTTIME"].Header.Caption = "吹氧开始";
this.udSDDW.DisplayLayout.Bands[0].Columns["O2STARTTIME"].MaskInput = "hh:mm:ss";
this.udSDDW.DisplayLayout.Bands[0].Columns["O2STARTTIME"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
this.udSDDW.DisplayLayout.Bands[0].Columns["O2ENDTIME"].Width = 70;
this.udSDDW.DisplayLayout.Bands[0].Columns["O2ENDTIME"].Header.Caption = "吹氧结束";
this.udSDDW.DisplayLayout.Bands[0].Columns["O2ENDTIME"].MaskInput = "hh:mm:ss";
this.udSDDW.DisplayLayout.Bands[0].Columns["O2ENDTIME"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
this.udSDDW.DisplayLayout.Bands[0].Columns["O2TIME"].Header.Caption = "吹氧时间";
this.udSDDW.DisplayLayout.Bands[0].Columns["O2TIME"].Width = 70;
this.udSDDW.DisplayLayout.Bands[0].Columns["O2TIME"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
this.udSDDW.DisplayLayout.Bands[0].Columns["O2CONSUME"].Header.Caption = "氧气耗量";
this.udSDDW.DisplayLayout.Bands[0].Columns["O2CONSUME"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
this.udSDDW.DisplayLayout.Bands[0].Columns["O2CONSUME"].Width = 70;
this.udSDDW.DisplayLayout.Bands[0].Columns["HEATPROCESSNO"].Hidden = true;
this.udSDDW.DisplayLayout.Bands[0].Columns["STATIONCODE"].Hidden = true;
this.udSDDW.DisplayLayout.Bands[0].Columns["DISPOSALTIME"].Hidden = true;
this.udSDDW.DisplayLayout.Bands[0].Columns["HEATNO"].Hidden = true;
}
private void btn_QueryStove_Click(object sender, EventArgs e)
{
if (checkBox1.Checked)
{
string strShifcode = "", strPsteel = "", strHeatNo = "";
if (this.cbbBC.Text != "全部")
{
int numBC = this.cbbBC.SelectedIndex + 1;
strShifcode = numBC.ToString();
}
if (this.urlCb_steelNo.Text.Trim() != "")
strPsteel = urlCb_steelNo.Text.ToString();
if (this.utLH.Text.Trim() != "")
strHeatNo = utLH.Text.Trim();
QueryStoveInfo(Convert.ToDateTime(this.ultraDateTimeEditor4.Value.ToString()).ToString("yyyy-MM-dd"), Convert.ToDateTime(ultraDateTimeEditor3.Value.ToString()).ToString("yyyy-MM-dd"), strShifcode, strPsteel, strHeatNo);
SetColumnRGB();
//SetCaption();
}
else
{
MessageBox.Show("请选择起止日期!", "提示");
}
}
///
/// 查询炉号信息
///
///
///
///
private void QueryStoveInfo(string szDate1, string szDate2, string strShifcode, string strPsteel, string strHeatNo)
{
string strErr = "";
ArrayList arry = new ArrayList();
arry.Add("GetVDStoveInfo.select");
arry.Add(DEVICE_POS);
arry.Add(strShifcode);
arry.Add(strShifcode);
arry.Add(strPsteel);
arry.Add(strPsteel);
arry.Add(strHeatNo);
arry.Add(strHeatNo);
arry.Add(szDate1);
arry.Add(szDate2);
arry.Add(DEVICE_POS);
arry.Add(strShifcode);
arry.Add(strShifcode);
arry.Add(strPsteel);
arry.Add(strPsteel);
arry.Add(strHeatNo);
arry.Add(strHeatNo);
arry.Add(szDate1);
arry.Add(szDate2);
CommonClientToServer cctos = new CommonClientToServer();
cctos.ob = this.ob;
DataSet ds = cctos.ExecuteQueryFunctions("Core.LgMes.Server.Common.ComDBQuery",
"doSimpleQuery", arry, out strErr);
if (strErr == "" && ds != null)
{
dsLH.Tables[0].Clear();
dsLH.Tables[0].Merge(ds.Tables[0]);
DataTable dt = ds.Tables[0];
dt.TableName = "LHXX";
if (m_dsLFSCZXX.Tables.Contains("LHXX"))
m_dsLFSCZXX.Tables["LHXX"].Clear();
m_dsLFSCZXX.Merge(dt);
}
}
//
/// 点击熔炼号显示相关信息
///
///
///
private void udLH_AfterRowActivate(object sender, EventArgs e)
{
GetHeatnoInfo();
}
///
/// 获取熔炼号相关信息
///
///
///
public void GetHeatnoInfo()
{
//初使化窗体
ResetData();
if (udLH.ActiveRow != null)
{
m_szJRCLH = udLH.ActiveRow.Cells["HEATPROCESSNO"].Value.ToString();//加热处理号
m_szLH = udLH.ActiveRow.Cells["HEATNO"].Value.ToString(); //熔炼号
m_strDisposaTime = udLH.ActiveRow.Cells["DISPOSALTIME"].Value.ToString(); //处理次数
//计划
ucPlan1.ResetData();
this.ucPlan1.ob = this.ob;
this.ucPlan1.GetPlanInfo(m_szLH);
//作业信息
GetRhsData();
//物料
if (_htRhsJobInfo != null && !string.IsNullOrEmpty(_htRhsJobInfo["HEATNO"].ToString()))
this.ucAdditives1.ob = this.ob;
this.ucAdditives1.GetAdditiveData(_htRhsJobInfo["HEATNO"].ToString(), "I" + _htRhsJobInfo["STATIONCODE"].ToString(), _htRhsJobInfo["DISPOSALTIME"].ToString());
//化学成分
ucResChemelEment1.ResetData();
this.ucResChemelEment1.ob = this.ob;
ucResChemelEment1.GetCraftEleInfo(_htRhsJobInfo["HEATNO"].ToString(), "F0" + DEVICE_POS, "S","");
//化学成分标准
if (_htRhsJobInfo != null && _htRhsJobInfo["PLANSTEEL"] != null)
ucResChemelEment1.GetStandardElement(_htRhsJobInfo["HEATNO"].ToString());
ucResChemelEment1.FillCraftElement();
if (ucResChemelEment1.ulgridElement.Rows.Count > 0) //add on 2009-04-24 显示最后一行
{
ucResChemelEment1.ulgridElement.ActiveRow = ucResChemelEment1.ulgridElement.Rows[ucResChemelEment1.ulgridElement.Rows.Count - 1];
ucResChemelEment1.ulgridElement.Rows[ucResChemelEment1.ulgridElement.Rows.Count - 1].Selected = false;
ucResChemelEment1.ulgridElement.Show();
}
//温度采样信息
this.ucTempSampling1.ob = this.ob;
ucTempSampling1.GetSampleData(_htRhsJobInfo["HEATNO"].ToString(), "I" + _htRhsJobInfo["STATIONCODE"].ToString(), _htRhsJobInfo["DISPOSALTIME"].ToString());
ucTempSampling1.FillTemperatureData("TEMPERATURE");
GetRhsOxygenblowingInfo(_htRhsJobInfo["HEATNO"].ToString(),_htRhsJobInfo["STATIONCODE"].ToString(), _htRhsJobInfo["DISPOSALTIME"].ToString());
}
}
///
/// 初始化作业数据
///
public void ResetData()
{
try
{
for (int i = 0; i < this.ultraDataSource1.Band.Columns.Count; i++)
{
if (this.ultraDataSource1.Band.Columns[i].DataType == typeof(System.DateTime))
this.ultraDataSource1.Rows[0][i] = null;
else
this.ultraDataSource1.Rows[0][i] = "";
}
}
catch { }
}
///
/// 获取作业信息
///
private void GetRhsData()
{
try
{
string strErr = "";
ArrayList arry = new ArrayList();
arry.Add("GetVDsOperateInfo.select");
arry.Add(m_szJRCLH);
arry.Add(m_szJRCLH);
arry.Add(m_szJRCLH);
arry.Add(m_szJRCLH);
CommonClientToServer cctos = new CommonClientToServer();
cctos.ob = this.ob;
DataSet ds = cctos.ExecuteQueryFunctions("Core.LgMes.Server.Common.ComDBQuery",
"doSimpleQuery", arry, out strErr);
if (strErr == "")
{
DataTable dt = ds.Tables[0];
if (dt.Rows.Count > 0)
{
for (int i = 0; i < dt.Columns.Count; i++)
{
if (_htRhsJobInfo.Contains(dt.Columns[i].ColumnName))
_htRhsJobInfo.Remove(dt.Columns[i].ColumnName);
_htRhsJobInfo.Add(dt.Columns[i].ColumnName, dt.Rows[0][i].ToString());
}
SetData(_htRhsJobInfo); //显示作业信息
}
else
_htRhsJobInfo.Clear();
}
}
catch { }
}
///
/// 显示作业信息
///
///
public void SetData(Hashtable ar)
{
if (ar == null || ar.Count == 0)
return;
int count = this.ultraDataSource1.Band.Columns.Count;
string strKey = "";
//班次
ucPlan1.ultraDataSource1.Rows[0]["SHIFTCODE"] = ar["SHIFTCODE"].ToString().Substring(1, 1);
//操作时间
if (ar["OPTDATE"] != null)
ucPlan1.ultraDataSource1.Rows[0]["OPTDATE"] = ar["OPTDATE"];
//操作员
if (ar["OPTPERSONNEL"] != null && !string.IsNullOrEmpty(ar["OPTPERSONNEL"].ToString()))
ucPlan1.ultraDataSource1.Rows[0]["OPTPERSONNEL"] = ar["OPTPERSONNEL"];
else
ucPlan1.ultraDataSource1.Rows[0]["OPTPERSONNEL"] = "";
bool Aflage = false, LAflage = false;
DateTime strArrTime = DateTime.Now;
DateTime strLeaveTime = DateTime.Now;
for (int i = 0; i < count; i++)
{
try
{
strKey = this.ultraDataSource1.Band.Columns[i].Key;
if (ar.Contains(strKey))
{
if (!string.IsNullOrEmpty(ar[strKey].ToString()))
{
if (strKey == "ARRIVETIME" && ar[strKey].ToString() != "")
{
Aflage = true;
strArrTime = Convert.ToDateTime(ar[strKey]);
}
if (strKey == "LEAVETIME" && ar[strKey].ToString() != "")
{
LAflage = true;
strLeaveTime = Convert.ToDateTime(ar[strKey]);
}
this.ultraDataSource1.Rows[0][i] = ar[strKey];
}
else if (this.ultraDataSource1.Band.Columns[i].DataType == typeof(System.DateTime))
{
this.ultraDataSource1.Rows[0][i] = null;
}
else
{
if (strKey == "REFINETIME" && ar[strKey].ToString() == "")
{
if (Aflage && LAflage)
{
this.ultraDataSource1.Rows[0][i] = Convert.ToString(strArrTime - strLeaveTime);
TimeSpan diff = strLeaveTime - strArrTime;
this.ultraDataSource1.Rows[0][i] = Math.Round(diff.TotalMinutes);
}
}
}
}
else
{
if (this.ultraDataSource1.Band.Columns[i].DataType == typeof(System.DateTime))
this.ultraDataSource1.Rows[0][i] = null;
else
this.ultraDataSource1.Rows[0][i] = "";
}
}
catch { }
}
}
private void button35_Click(object sender, EventArgs e)
{
DialogResult result = DialogResult.No;
result = MessageBox.Show(this, "刷新将撤消界面上所做的修改,按'否'先保存数据?", "提示", MessageBoxButtons.YesNo,
MessageBoxIcon.Question, MessageBoxDefaultButton.Button1);
if (result == DialogResult.Yes)
{
RefreshData();
}
}
///
/// 刷新数据
///
private void RefreshData()
{
if (m_szJRCLH != "" && m_szLH != "")
{
ResetData();
//计划
ucPlan1.ResetData();
this.ucPlan1.GetPlanInfo(m_szLH);
//作业信息
GetRhsData();
//物料
if (_htRhsJobInfo != null && !string.IsNullOrEmpty(_htRhsJobInfo["HEATNO"].ToString()))
this.ucAdditives1.ob = this.ob;
this.ucAdditives1.GetAdditiveData(_htRhsJobInfo["HEATNO"].ToString(), "I" + _htRhsJobInfo["STATIONCODE"].ToString(), _htRhsJobInfo["DISPOSALTIME"].ToString());
//化学成分
ucResChemelEment1.ResetData();
this.ucResChemelEment1.ob = this.ob;
ucResChemelEment1.GetCraftEleInfo(_htRhsJobInfo["HEATNO"].ToString(), "I0" + DEVICE_POS, "S","");
//化学成分标准
if (_htRhsJobInfo != null && _htRhsJobInfo["PLANSTEEL"] != null)
ucResChemelEment1.GetStandardElement(_htRhsJobInfo["HEATNO"].ToString());
ucResChemelEment1.FillCraftElement();
if (ucResChemelEment1.ulgridElement.Rows.Count > 0) //add on 2009-04-24 显示最后一行
{
ucResChemelEment1.ulgridElement.ActiveRow = ucResChemelEment1.ulgridElement.Rows[ucResChemelEment1.ulgridElement.Rows.Count - 1];
ucResChemelEment1.ulgridElement.Rows[ucResChemelEment1.ulgridElement.Rows.Count - 1].Selected = false;
ucResChemelEment1.ulgridElement.Show();
}
//温度采样信息
this.ucTempSampling1.ob = this.ob;
ucTempSampling1.GetSampleData(_htRhsJobInfo["HEATNO"].ToString(), "F" + _htRhsJobInfo["STATIONCODE"].ToString(), _htRhsJobInfo["DISPOSALTIME"].ToString());
ucTempSampling1.FillTemperatureData("TEMPERATURE");
}
}
///
/// 保存
///
///
///
private void Save()
{
if (ucPlan1.ultraDataSource1.Rows[0]["HEATNO"].ToString().Trim().Length == 0)
{
MessageBox.Show("请选择要更新的熔炼号!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
//在站时间判断
if (!string.IsNullOrEmpty(this.ultraDataSource1.Rows[0]["ARRIVETIME"].ToString()) && !string.IsNullOrEmpty(this.ultraDataSource1.Rows[0]["LEAVETIME"].ToString()))
{
if (Convert.ToDateTime(this.ultraDataSource1.Rows[0]["ARRIVETIME"]) < Convert.ToDateTime(this.ultraDataSource1.Rows[0]["LEAVETIME"]))
ultraDataSource1.Rows[0]["REFINETIME"] = CStaticMethod.caculateTime(Convert.ToDateTime(this.ultraDataSource1.Rows[0]["ARRIVETIME"]), Convert.ToDateTime(this.ultraDataSource1.Rows[0]["LEAVETIME"]));
else
{
MessageBox.Show("进站时间不能大于出站时间!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
}
//底吹氩时间判断
if (!string.IsNullOrEmpty(this.ultraDataSource1.Rows[0]["ARBEGINTIME"].ToString()) && !string.IsNullOrEmpty(this.ultraDataSource1.Rows[0]["ARCLOSETIME"].ToString()))
{
if (Convert.ToDateTime(this.ultraDataSource1.Rows[0]["ARBEGINTIME"]) < Convert.ToDateTime(this.ultraDataSource1.Rows[0]["ARCLOSETIME"]))
ultraDataSource1.Rows[0]["AR_TIME"] = CStaticMethod.caculateTime(Convert.ToDateTime(this.ultraDataSource1.Rows[0]["ARBEGINTIME"]), Convert.ToDateTime(this.ultraDataSource1.Rows[0]["ARCLOSETIME"]));
else
{
MessageBox.Show("底吹氩开始时间不能大于底吹氩结束时间!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
}
//真空时间判断
if (!string.IsNullOrEmpty(this.ultraDataSource1.Rows[0]["VACBEGINTIME"].ToString()) && !string.IsNullOrEmpty(this.ultraDataSource1.Rows[0]["VACLOSETIME"].ToString()))
{
if (Convert.ToDateTime(this.ultraDataSource1.Rows[0]["VACBEGINTIME"]) < Convert.ToDateTime(this.ultraDataSource1.Rows[0]["VACLOSETIME"]))
ultraDataSource1.Rows[0]["VAC_TIME"] = CStaticMethod.caculateTime(Convert.ToDateTime(this.ultraDataSource1.Rows[0]["VACBEGINTIME"]), Convert.ToDateTime(this.ultraDataSource1.Rows[0]["VACLOSETIME"]));
else
{
MessageBox.Show("真空开始时间不能大于真空结束时间!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
}
//喂丝时间判断
if (!string.IsNullOrEmpty(this.ultraDataSource1.Rows[0]["FEEDBEGINTIME"].ToString()) && !string.IsNullOrEmpty(this.ultraDataSource1.Rows[0]["FEEDCLOSETIME"].ToString()))
{
if (Convert.ToDateTime(this.ultraDataSource1.Rows[0]["FEEDBEGINTIME"]) < Convert.ToDateTime(this.ultraDataSource1.Rows[0]["FEEDCLOSETIME"]))
ultraDataSource1.Rows[0]["FEED_TIME"] = CStaticMethod.caculateTime(Convert.ToDateTime(this.ultraDataSource1.Rows[0]["FEEDBEGINTIME"]), Convert.ToDateTime(this.ultraDataSource1.Rows[0]["FEEDCLOSETIME"]));
else
{
MessageBox.Show("喂丝开始时间不能大于喂丝结束时间!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
}
SaveData(); //保存数据
RefreshData(); //刷新数据
}
///
/// 保存作业信息
///
private void SaveData()
{
string strHeatNo = ""; //熔炼号
string strStationCode = ""; //岗位编码
string strDisposaltime = ""; //处理次数
ArrayList alColumnName = new ArrayList(); //保存作业字段名
ArrayList alValue = new ArrayList(); //保存作业字段值
ArrayList alColumnType = new ArrayList(); //保存字段类型
ArrayList alMaterielcode = new ArrayList(); //物料编码
ArrayList alJMType = new ArrayList(); //加料类型
ArrayList alJMWGT = new ArrayList(); //加料重量
ArrayList alMaterielType = new ArrayList(); //物料类型
strHeatNo = _htRhsJobInfo["HEATNO"].ToString();
strStationCode = CStaticMethod.analysProcess(DEVICE_POSITION.Substring(0, 3)) + _htRhsJobInfo["STATIONCODE"].ToString();
strDisposaltime = _htRhsJobInfo["DISPOSALTIME"].ToString();
if (_UpdateColumnName == null || _UpdateColumnName.Count == 0)
{
MessageBox.Show("当前没做任何修改不需要保存!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
return;
}
//作业数据
for (int intCount = 0; intCount < ultraDataSource1.Band.Columns.Count; intCount++)
{
alColumnName.Add(ultraDataSource1.Band.Columns[intCount].Key.ToString());
alValue.Add((ultraDataSource1.Rows[0][intCount].ToString().Trim().Length > 0) ? ultraDataSource1.Rows[0][intCount].ToString() : "Empty");
alColumnType.Add(ultraDataSource1.Band.Columns[intCount].DataType.ToString());
}
//班次
string strShiftCode = "";
if (_htRhsJobInfo["SHIFTCODE"] != null && _htRhsJobInfo["SHIFTCODE"].ToString().Length > 1)
strShiftCode = _htRhsJobInfo["SHIFTCODE"].ToString().Substring(0, 1) + ucPlan1.ultraGrid1.Rows[0].Cells["SHIFTCODE"].Value.ToString();
//班次
alColumnName.Add("SHIFTCODE");
alValue.Add((strShiftCode.Length > 0) ? strShiftCode : "Empty");
alColumnType.Add("System.String");
//操作员
alColumnName.Add("OPTPERSONNEL");
string OPTPERSONNEL = "";
if (ucPlan1.ultraDataSource1.Rows[0]["OPTPERSONNEL"].ToString() == "")
{
OPTPERSONNEL = this.UserInfo.GetUserName();
}
else
{
if (this._htRhsJobInfo["OPTPERSONNEL"].ToString() == "")
{
OPTPERSONNEL = this.UserInfo.GetUserName();
}
else
{
if (ucPlan1.ultraDataSource1.Rows[0]["OPTPERSONNEL"].ToString() != this._htRhsJobInfo["OPTPERSONNEL"].ToString())
OPTPERSONNEL = ucPlan1.ultraDataSource1.Rows[0]["OPTPERSONNEL"].ToString();
else
OPTPERSONNEL = this._htRhsJobInfo["OPTPERSONNEL"].ToString();
}
}
alValue.Add(OPTPERSONNEL);
alColumnType.Add("System.String");
//辅料数据
for (int intCount = 0; intCount < ucAdditives1.ulgridPrcMtr.DisplayLayout.Bands[0].Columns.Count; intCount++)
{
if (ucAdditives1.ulgridPrcMtr.DisplayLayout.Bands[0].Columns[intCount].Tag != null)
{
string strKey = ucAdditives1.ulgridPrcMtr.DisplayLayout.Bands[0].Columns[intCount].Key.ToString();
alMaterielcode.Add(ucAdditives1.ulgridPrcMtr.DisplayLayout.Bands[0].Columns[intCount].Tag.ToString());
alJMWGT.Add((ucAdditives1.ulgridPrcMtr.Rows[0].Cells[strKey].Value.ToString().Trim().Length > 0) ? ucAdditives1.ulgridPrcMtr.Rows[0].Cells[strKey].Value.ToString() : "Empty");
alJMType.Add("1");
alMaterielType.Add("FL");
}
}
//合金数据
for (int intCount = 0; intCount < ucAdditives1.ultgridAlloy.DisplayLayout.Bands[0].Columns.Count; intCount++)
{
if (ucAdditives1.ultgridAlloy.DisplayLayout.Bands[0].Columns[intCount].Tag != null)
{
string strKey = ucAdditives1.ultgridAlloy.DisplayLayout.Bands[0].Columns[intCount].Key.ToString();
alMaterielcode.Add(ucAdditives1.ultgridAlloy.DisplayLayout.Bands[0].Columns[intCount].Tag.ToString());
alJMWGT.Add((ucAdditives1.ultgridAlloy.Rows[0].Cells[strKey].Value.ToString().Trim().Length > 0) ? ucAdditives1.ultgridAlloy.Rows[0].Cells[strKey].Value.ToString() : "Empty");
alJMType.Add("1");
alMaterielType.Add("HJ");
}
}
//喂丝数据
for (int intCount = 0; intCount < ucAdditives1.ultgridWs.DisplayLayout.Bands[0].Columns.Count; intCount++)
{
if (ucAdditives1.ultgridWs.DisplayLayout.Bands[0].Columns[intCount].Tag != null)
{
string strKey = ucAdditives1.ultgridWs.DisplayLayout.Bands[0].Columns[intCount].Key.ToString();
alMaterielcode.Add(ucAdditives1.ultgridWs.DisplayLayout.Bands[0].Columns[intCount].Tag.ToString());
alJMWGT.Add((ucAdditives1.ultgridWs.Rows[0].Cells[strKey].Value.ToString().Trim().Length > 0) ? ucAdditives1.ultgridWs.Rows[0].Cells[strKey].Value.ToString() : "Empty");
alJMType.Add("1");
alMaterielType.Add("WS");
}
}
//手投料
for (int intCount = 0; intCount < ucAdditives1.ultgridManual.DisplayLayout.Bands[0].Columns.Count; intCount++)
{
if (ucAdditives1.ultgridManual.DisplayLayout.Bands[0].Columns[intCount].Tag != null && ucAdditives1.ultgridManual.DisplayLayout.Bands[0].Columns[intCount].Header.Caption != "")
{
string strKey = ucAdditives1.ultgridManual.DisplayLayout.Bands[0].Columns[intCount].Key.ToString();
alMaterielcode.Add(ucAdditives1.ultgridManual.DisplayLayout.Bands[0].Columns[intCount].Tag.ToString());
alJMWGT.Add((ucAdditives1.ultgridManual.Rows[0].Cells[strKey].Value.ToString().Trim().Length > 0) ? ucAdditives1.ultgridManual.Rows[0].Cells[strKey].Value.ToString() : "Empty");
alJMType.Add("2");
alMaterielType.Add("ST"); //手投类型到后台再获取
}
}
string strSqlID = "SaveResData.Update";
object[] sArgs = new object[10];
sArgs[0] = strHeatNo; //熔炼号
sArgs[1] = strStationCode; //岗位
sArgs[2] = strDisposaltime;//处理次数
sArgs[3] = alColumnName; //作业字段名
sArgs[4] = alValue; //作业数据值
sArgs[5] = alColumnType; //作业数据类型
sArgs[6] = alMaterielcode; //物料编码
sArgs[7] = alJMType; //加料类型(料仓,手投)
sArgs[8] = alJMWGT; //加料重量
sArgs[9] = alMaterielType; //物料类型
string strError = "";
DialogResult result = DialogResult.No;
result = MessageBox.Show(this, "确实要保存信息吗?", "提示", MessageBoxButtons.YesNo,
MessageBoxIcon.Question, MessageBoxDefaultButton.Button1);
if (result == DialogResult.Yes)
{
Cursor oldCursor = this.Cursor;
this.Cursor = Cursors.WaitCursor;//等待光标
try
{
CommonClientToServer ccTs = new CommonClientToServer();
ccTs.ob = ob;
string strRCode = ccTs.ExecuteProcedureFunctions("Core.LgMes.Server.Common.ComDBProcedure",
"ExecProcWithCollParam", strSqlID, sArgs, out strError);
if (strError != "")
{
this.Cursor = oldCursor;
MessageBox.Show("保存不成功!\n" + strError, "错误!", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
else
{
this.Cursor = oldCursor;
if (_UpdateColumnName != null && _UpdateColumnName.Count > 0)
{
bool blReturn = StaticFunction.SaveUpdateLog(strHeatNo, strStationCode, strDisposaltime, _UpdateColumnName, _UpdateBefore, _UpdateAfter, this.ob);
if (blReturn == true)
{
_UpdateColumnName.Clear();
_UpdateBefore.Clear();
_UpdateAfter.Clear();
}
}
}
}
catch (System.Exception exp)
{
this.Cursor = oldCursor;
MessageBox.Show("保存不成功!\n" + exp.ToString(), "错误!", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
}
private void ubJJB_Click(object sender, EventArgs e)
{
foreach (Form mdiChild in this.MdiParent.MdiChildren)
{
if (mdiChild.Text == DEVICE_POS + "#RH炉交接班管理")
{
mdiChild.Activate();
return;
}
}
frmCcmMgt frm = new frmCcmMgt(DEVICE_POSITION);
frm.MdiParent = this.MdiParent;
frm.Text = frm.Text = DEVICE_POS + "#RH炉交接班管理";
frm.Show();
}
private void btAddLH_Click(object sender, EventArgs e)
{
}
///
/// 手动新增一个新炉号后,刷新炉号信息
///
public void AfterAddNewLH(string v_JRCLH)
{
m_szJRCLH = v_JRCLH;
RefreshStoveInfo(DateTime.Now.ToString("yyyy-MM-dd"), DateTime.Now.ToString("yyyy-MM-dd"), " where 1=1");
SetColumnRGB();
}
private void ultraGrid4_ClickCellButton(object sender, Infragistics.Win.UltraWinGrid.CellEventArgs e)
{
string strErr = "";
if (e.Cell.Column.Key == "VES_NO")
{
if (e.Cell.Text != null && e.Cell.Text.ToString().Length > 0)
{
if (MessageBox.Show("是否要初始化RH炉炉龄?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Asterisk) == DialogResult.Yes)
{
object obj = null;
if (strErr == "" && obj.ToString() == "0")
MessageBox.Show("初始化RH炉炉龄成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
}
}
else
MessageBox.Show("RH炉炉龄不能为空!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
}
else
{
frmSetTime frm = new frmSetTime(e.Cell.Value);
frm.Location = CStaticMethod.GetChildWindowLocation(frm.Size);
frm.ShowDialog();
if (frm._returnTime > new DateTime(2000, 1, 1, 0, 0, 0, 0))
{
DateTime dt = frm._returnTime;
e.Cell.Value = dt;
}
}
}
private void ultraGrid4_CellChange(object sender, Infragistics.Win.UltraWinGrid.CellEventArgs e)
{
if (ultraGrid4.ActiveCell.Text != "" && e.Cell.Value.GetType().ToString() != "System.DateTime"
&& e.Cell.Value.GetType().ToString() != "System.DBNull" && e.Cell.Column.Key != "MEMO" &&
e.Cell.Column.Key!="RHSNO")
{
try
{
Convert.ToDecimal(ultraGrid4.ActiveCell.Text);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "提示");
ultraGrid4.ActiveCell.Value = "";
}
}
}
#region "记录实绩修改日志"
///
/// 设置用户控件委托
///
private void SetUserControlDelegate()
{
///修改数据之前事情
ucAdditives1.ulgridPrcMtr.AfterCellUpdate += new Infragistics.Win.UltraWinGrid.CellEventHandler(ulgridPrcMtr_AfterCellUpdate);
ucAdditives1.ultgridAlloy.AfterCellUpdate += new Infragistics.Win.UltraWinGrid.CellEventHandler(ultgridAlloy_AfterCellUpdate);
ucAdditives1.ultgridManual.AfterCellUpdate += new Infragistics.Win.UltraWinGrid.CellEventHandler(ultgridManual_AfterCellUpdate);
ucAdditives1.ultgridWs.AfterCellUpdate += new Infragistics.Win.UltraWinGrid.CellEventHandler(ultgridWs_AfterCellUpdate);
ucPlan1.ultraGrid1.AfterCellUpdate += new Infragistics.Win.UltraWinGrid.CellEventHandler(ultraGrid1_AfterCellUpdate);
///修改数据之后事情
ucAdditives1.ulgridPrcMtr.BeforeCellUpdate += new Infragistics.Win.UltraWinGrid.BeforeCellUpdateEventHandler(ulgridPrcMtr_BeforeCellUpdate);
ucAdditives1.ultgridAlloy.BeforeCellUpdate += new Infragistics.Win.UltraWinGrid.BeforeCellUpdateEventHandler(ultgridAlloy_BeforeCellUpdate);
ucAdditives1.ultgridManual.BeforeCellUpdate += new Infragistics.Win.UltraWinGrid.BeforeCellUpdateEventHandler(ultgridManual_BeforeCellUpdate);
ucAdditives1.ultgridWs.BeforeCellUpdate += new Infragistics.Win.UltraWinGrid.BeforeCellUpdateEventHandler(ultgridWs_BeforeCellUpdate);
ucPlan1.ultraGrid1.BeforeCellUpdate += new Infragistics.Win.UltraWinGrid.BeforeCellUpdateEventHandler(ultraGrid1_BeforeCellUpdate);
}
void ultgridWs_BeforeCellUpdate(object sender, Infragistics.Win.UltraWinGrid.BeforeCellUpdateEventArgs e)
{
if (!string.IsNullOrEmpty(e.Cell.Column.Header.Caption.Trim()))
{
if (_UpdateBefore != null && _UpdateBefore.Contains(e.Cell.Column.Key))
{
_UpdateBefore.Remove(e.Cell.Column.Key);
_UpdateColumnName.Remove(e.Cell.Column.Key);
}
_UpdateBefore.Add(e.Cell.Column.Key, e.Cell.Value.ToString());
_UpdateColumnName.Add(e.Cell.Column.Key, e.Cell.Column.Header.Caption);
}
}
void ultgridWs_AfterCellUpdate(object sender, Infragistics.Win.UltraWinGrid.CellEventArgs e)
{
if (!string.IsNullOrEmpty(e.Cell.Column.Header.Caption.Trim()))
{
if (_UpdateAfter.Contains(e.Cell.Column.Key))
{
_UpdateAfter.Remove(e.Cell.Column.Key);
//_UpdateColumnName.Remove(e.Cell.Column.Key);
}
_UpdateAfter.Add(e.Cell.Column.Key, e.Cell.Value.ToString());
}
}
void ultgridManual_BeforeCellUpdate(object sender, Infragistics.Win.UltraWinGrid.BeforeCellUpdateEventArgs e)
{
if (!string.IsNullOrEmpty(e.Cell.Column.Header.Caption.Trim()))
{
if (_UpdateBefore != null && _UpdateBefore.Contains(e.Cell.Column.Key))
{
_UpdateBefore.Remove(e.Cell.Column.Key);
_UpdateColumnName.Remove(e.Cell.Column.Key);
}
_UpdateBefore.Add(e.Cell.Column.Key, e.Cell.Value.ToString());
_UpdateColumnName.Add(e.Cell.Column.Key, e.Cell.Column.Header.Caption);
}
}
void ultgridAlloy_BeforeCellUpdate(object sender, Infragistics.Win.UltraWinGrid.BeforeCellUpdateEventArgs e)
{
if (!string.IsNullOrEmpty(e.Cell.Column.Header.Caption.Trim()))
{
if (_UpdateBefore != null && _UpdateBefore.Contains(e.Cell.Column.Key))
{
_UpdateBefore.Remove(e.Cell.Column.Key);
_UpdateColumnName.Remove(e.Cell.Column.Key);
}
_UpdateBefore.Add(e.Cell.Column.Key, e.Cell.Value.ToString());
_UpdateColumnName.Add(e.Cell.Column.Key, e.Cell.Column.Header.Caption);
}
}
void ulgridPrcMtr_BeforeCellUpdate(object sender, Infragistics.Win.UltraWinGrid.BeforeCellUpdateEventArgs e)
{
if (!string.IsNullOrEmpty(e.Cell.Column.Header.Caption.Trim()))
{
if (_UpdateBefore != null && _UpdateBefore.Contains(e.Cell.Column.Key))
{
_UpdateBefore.Remove(e.Cell.Column.Key);
_UpdateColumnName.Remove(e.Cell.Column.Key);
}
_UpdateBefore.Add(e.Cell.Column.Key, e.Cell.Value.ToString());
_UpdateColumnName.Add(e.Cell.Column.Key, e.Cell.Column.Header.Caption);
}
}
void ultgridManual_AfterCellUpdate(object sender, Infragistics.Win.UltraWinGrid.CellEventArgs e)
{
if (!string.IsNullOrEmpty(e.Cell.Column.Header.Caption.Trim()))
{
if (_UpdateAfter.Contains(e.Cell.Column.Key))
{
_UpdateAfter.Remove(e.Cell.Column.Key);
// _UpdateColumnName.Remove(e.Cell.Column.Key);
}
_UpdateAfter.Add(e.Cell.Column.Key, e.Cell.Value.ToString());
}
}
void ultgridAlloy_AfterCellUpdate(object sender, Infragistics.Win.UltraWinGrid.CellEventArgs e)
{
if (!string.IsNullOrEmpty(e.Cell.Column.Header.Caption.Trim()))
{
if (_UpdateAfter.Contains(e.Cell.Column.Key))
{
_UpdateAfter.Remove(e.Cell.Column.Key);
// _UpdateColumnName.Remove(e.Cell.Column.Key);
}
_UpdateAfter.Add(e.Cell.Column.Key, e.Cell.Value.ToString());
}
}
void ulgridPrcMtr_AfterCellUpdate(object sender, Infragistics.Win.UltraWinGrid.CellEventArgs e)
{
if (!string.IsNullOrEmpty(e.Cell.Column.Header.Caption.Trim()))
{
if (_UpdateAfter.Contains(e.Cell.Column.Key))
{
_UpdateAfter.Remove(e.Cell.Column.Key);
//_UpdateColumnName.Remove(e.Cell.Column.Key);
}
_UpdateAfter.Add(e.Cell.Column.Key, e.Cell.Value.ToString());
}
}
void ultraGrid1_BeforeCellUpdate(object sender, Infragistics.Win.UltraWinGrid.BeforeCellUpdateEventArgs e)
{
if (!string.IsNullOrEmpty(e.Cell.Column.Header.Caption.Trim()))
{
if (_UpdateBefore != null && _UpdateBefore.Contains(e.Cell.Column.Key))
{
_UpdateBefore.Remove(e.Cell.Column.Key);
_UpdateColumnName.Remove(e.Cell.Column.Key);
}
_UpdateBefore.Add(e.Cell.Column.Key, e.Cell.Value.ToString());
_UpdateColumnName.Add(e.Cell.Column.Key, e.Cell.Column.Header.Caption);
}
}
void ultraGrid1_AfterCellUpdate(object sender, Infragistics.Win.UltraWinGrid.CellEventArgs e)
{
if (!string.IsNullOrEmpty(e.Cell.Column.Header.Caption.Trim()))
{
if (_UpdateAfter.Contains(e.Cell.Column.Key))
{
_UpdateAfter.Remove(e.Cell.Column.Key);
//_UpdateColumnName.Remove(e.Cell.Column.Key);
}
_UpdateAfter.Add(e.Cell.Column.Key, e.Cell.Value.ToString());
}
}
private void ultraGrid4_AfterCellUpdate(object sender, Infragistics.Win.UltraWinGrid.CellEventArgs e)
{
if (_UpdateAfter.Contains(e.Cell.Column.Key))
{
_UpdateAfter.Remove(e.Cell.Column.Key);
// _UpdateColumnName.Remove(e.Cell.Column.Key);
}
_UpdateAfter.Add(e.Cell.Column.Key, e.Cell.Value.ToString());
}
private void ultraGrid4_BeforeCellUpdate(object sender, Infragistics.Win.UltraWinGrid.BeforeCellUpdateEventArgs e)
{
if (_UpdateBefore != null && _UpdateBefore.Contains(e.Cell.Column.Key))
{
_UpdateBefore.Remove(e.Cell.Column.Key);
_UpdateColumnName.Remove(e.Cell.Column.Key);
}
_UpdateBefore.Add(e.Cell.Column.Key, e.Cell.Value.ToString());
_UpdateColumnName.Add(e.Cell.Column.Key, e.Cell.Column.Header.Caption);
}
#endregion
}
}