| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278 |
- 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 System.Diagnostics;
- using System.Threading;
- using Infragistics.Win.UltraWinEditors;
- using System.Collections;
- using Core.LgMes.Client.Comm;
- using Core.Mes.Client;
- using Core.Mes.Client.Common;
- namespace Core.LgMes.Client.LgResMgt
- {
- public partial class frmCasResults : CoreFS.CA06.FrmBase // Core.Mes.Client.Common.frmStyleBase
- {
- System.Threading.Thread myThread;
- private bool threadGoOn = true;
- private bool m_bJJBFlag = false, m_bDelay = false;
- private string DEVICE_POSITION = "";
- private int DEVICE_POS = 0;
- private DataSet m_dsLFSCZXX = new DataSet();
- private string m_szJRCLH = "", m_szLH = "",m_strDisposaTime="";//, _szBC = "";
- string datetime = System.DateTime.Now.ToString("HH:mm:ss");
- private Hashtable _htCasJobInfo; // 用于作业信息的表字段数据
- private Hashtable _UpdateBefore; //修改之前值
- private Hashtable _UpdateAfter; //修改之后值
- private Hashtable _UpdateColumnName; //修改字段名
- public frmCasResults()
- {
- InitializeComponent();
- CheckForIllegalCrossThreadCalls = false;
- }
- /// <summary>
- /// 如果加热处理号的第五位不为1的话,该行的背景色设为red
- /// </summary>
- 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 frmCAS_Load(object sender, EventArgs e)
- {
- string strErr = "";
- ultraDateTimeEditor4.Enabled = false;
- ultraDateTimeEditor3.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);
- }
- //初始化
- panel3.BackColor = Color.Snow;
- ultraGroupBox1.BackColor = Color.Snow;
- ultraDataSource1.Rows.Add(new object[] { null });
- _htCasJobInfo = new Hashtable();
- _UpdateAfter = new Hashtable();
- _UpdateBefore = new Hashtable();
- _UpdateColumnName = new Hashtable();
- if (this.Tag != null)
- {
- DEVICE_POSITION = "CAS0" + 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;
- // 初始化吹氩站信息
- dsCas.Tables["dtbCas"].Rows.Add(new object[] { "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" });
- dsCas_AddItives.Tables["dtbCas_AddItives"].Rows.Add(new object[] { "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" });
- dsCas_Element.Tables["dtbCas_Element"].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");
- this.ucAdditives1.ob = this.ob;
- ucAdditives1.GetMaterialData();
- ucAdditives1.SetHopperInfo(DEVICE_POSITION);
- //给熔炼号ultragrid绑定列
- // SetCaption();
- SetColumnRGB();
- //判断是否交班 同时刷新熔炼号信息
- JudgeIfChangeClass();
- //SetGridColumns();
- }
-
- private void checkBox1_CheckedChanged(object sender, EventArgs e)
- {
- if (this.checkBox1.Checked == true)
- {
- threadGoOn = false;
- this.button1.Enabled = true;
- this.ultraDateTimeEditor4.Enabled = true;
- this.ultraDateTimeEditor3.Enabled = true;
- }
- else
- {
- this.button1.Enabled = false;
- threadGoOn = true;
- QueryLHInfo();
- this.ultraDateTimeEditor4.Enabled = false;
- this.ultraDateTimeEditor3.Enabled = false;
- }
- }
-
- private void button1_Click(object sender, EventArgs e)
- {
- if (this.checkBox1.Checked)
- {
- string strShifcode = "", strPsteel = "", strHeatNo = "";
- if (this.cbbBC.Text != "全部")
- {
- int numBC = this.cbbBC.SelectedIndex + 1;
- strShifcode = numBC.ToString();
- }
- if (this.urlCb_steelNo.SelectedIndex>-1)
- strPsteel = urlCb_steelNo.Value.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("请选择起止日期!", "提示");
- }
- }
- /// <summary>
- /// 查询熔炼号信息
- /// </summary>
- /// <param name="szDate1"></param>
- /// <param name="szDate2"></param>
- /// <param name="szAnd"></param>
- private void QueryStoveInfo(string szDate1, string szDate2, string strShifcode, string strPsteel, string strHeatNo)
- {
- string strErr = "";
- ArrayList arry = new ArrayList();
- arry.Add("GetCaSStoveInfo.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)
- {
- if (ds.Tables[0].Rows.Count != 0)
- {
- 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);
- }
- else
- {
- dsLH.Clear();
- }
- }
- else
- {
- MessageBox.Show("查询失败!!!", "提示");
- dsLH.Clear();
- }
- }
- /// <summary>
- /// 判断是否交班
- /// </summary>
- private void JudgeIfChangeClass()
- {
- try
- {
- myThread = new Thread(new ThreadStart(QueryClass));
- myThread.Priority = ThreadPriority.Normal;
- myThread.Start();
- }
- catch (Exception ex)
- {
- MessageBox.Show(ex.Message);
- }
- }
- /// <summary>
- /// 扫描线程,判断是否是交班时间,并实时刷新熔炼号信息
- /// </summary>
- private void QueryClass()
- {
- try
- {
- int i = 0, scanLH = 5;
- System.Windows.Forms.Control.CheckForIllegalCrossThreadCalls = false;
- while (true)
- {
- if (!!this.On_Off_Thread)
- {
- System.Threading.Thread.Sleep(500);
- continue;
- }
- Thread.Sleep(1000 * 5);
- 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;
- //label10.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;
- }
- }
- /// <summary>
- /// 刷新熔炼号信息
- /// </summary>
- private void QueryLHInfo()
- {
- if (threadGoOn)
- {
- RefreshStoveInfo(DateTime.Now.ToString("yyyy-MM-dd"), DateTime.Now.ToString("yyyy-MM-dd"), " where 1=1");
- SetColumnRGB();
- }
- }
- /// <summary>
- /// 取当前班次
- /// </summary>
- private string GetClassCode()
- {
- #region "取班次编码"
- string szCurrClass = "";
- return (szCurrClass);
- #endregion
- }
- /// <summary>
- /// 刷新熔炼号信息
- /// </summary>
- private void RefreshStoveInfo(string szDate1, string szDate2, string szAnd)
- {
- try
- {
- string strErr = "", szWhere = "";
- //WSID:工位号
- //OPTDATE:操作时间
- 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("GetCaSStoveInfo_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);
- }
-
- }
- }
- catch
- {
- }
-
- }
- /// <summary>
- /// 给熔炼号ultragrid绑定列
- /// </summary>
- 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 = 150;
- 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
- {
- }
- }
- /// <summary>
- /// 点击熔炼号显示相关信息
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void udLH_AfterRowActivate(object sender, EventArgs e)
- {
- GetHeatnoInfo();
- }
- /// <summary>
- /// 获取熔炼号相关信息
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- public void GetHeatnoInfo()
- {
- //初使化窗体
- // FormatThisForm();
- 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);
- //吹氩作业信息
- GetCASData();
- //物料
- if (_htCasJobInfo != null && !string.IsNullOrEmpty(_htCasJobInfo["HEATNO"].ToString()))
- this.ucAdditives1.GetAdditiveData(_htCasJobInfo["HEATNO"].ToString(), "D" + _htCasJobInfo["STATIONCODE"].ToString(), _htCasJobInfo["DISPOSALTIME"].ToString());
- //化学成分
- ucResChemelEment1.ResetData();
- this.ucResChemelEment1.ob = this.ob;
- ucResChemelEment1.GetCraftEleInfo(_htCasJobInfo["HEATNO"].ToString(), "D0" + DEVICE_POS, "S", "");
- //化学成分标准
- if (ucPlan1._htPlanInfo["V_HEAT_ID"] != null)
- ucResChemelEment1.GetStandardElement(_htCasJobInfo["HEATNO"].ToString());
- // //化学成分标准
- //if (_htCasJobInfo != null && _htCasJobInfo["PLANSTEEL"] != null)
- // ucResChemelEment1.GetStandardElement(_htCasJobInfo["PLANSTEEL"].ToString(), ucPlan1.ultraDataSource1.Rows[0]["CAST_ID"].ToString());
- ucResChemelEment1.FillCraftElement();
- //温度采样信息
- this.ucTempSampling1.ob = this.ob;
- ucTempSampling1.GetSampleData(_htCasJobInfo["HEATNO"].ToString(), "D" + _htCasJobInfo["STATIONCODE"].ToString(), _htCasJobInfo["DISPOSALTIME"].ToString());
- ucTempSampling1.FillTemperatureData("TEMPERATURE");
- _UpdateColumnName.Clear();
- _UpdateBefore.Clear();
- _UpdateAfter.Clear();
- }
- }
- /// <summary>
- /// 获取作业信息
- /// </summary>
- private void GetCASData()
- {
- try
- {
- string strErr = "";
- ArrayList arry = new ArrayList();
- arry.Add("GetCasOperateInfo.select");
- 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 (_htCasJobInfo.Contains(dt.Columns[i].ColumnName))
- _htCasJobInfo.Remove(dt.Columns[i].ColumnName);
- _htCasJobInfo.Add(dt.Columns[i].ColumnName, dt.Rows[0][i].ToString());
- }
- SetData(_htCasJobInfo); //显示作业信息
- }
- else
- _htCasJobInfo.Clear();
- }
- }
- catch { }
- }
- /// <summary>
- /// 初始化作业数据
- /// </summary>
- 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 { }
- }
- /// <summary>
- /// 显示作业信息
- /// </summary>
- /// <param name="ar"></param>
- 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 == "STAYTIME" && 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 { }
- }
- }
- /// <summary>
- /// 保存
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- 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]["STAYTIME"] = 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]["BLOWARSTARTTIME"].ToString()) && !string.IsNullOrEmpty(this.ultraDataSource1.Rows[0]["BLOWARENDTIME"].ToString()))
- {
- if (Convert.ToDateTime(this.ultraDataSource1.Rows[0]["BLOWARSTARTTIME"]) < Convert.ToDateTime(this.ultraDataSource1.Rows[0]["BLOWARENDTIME"]))
- ultraDataSource1.Rows[0]["BLOWARTIME"] = CStaticMethod.caculateTime(Convert.ToDateTime(this.ultraDataSource1.Rows[0]["BLOWARSTARTTIME"]), Convert.ToDateTime(this.ultraDataSource1.Rows[0]["BLOWARENDTIME"]));
- else
- {
- MessageBox.Show("吹氩开始时间不能大于吹氩结束时间!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
- return;
- }
- }
- //喂丝时间判断
- if (!string.IsNullOrEmpty(this.ultraDataSource1.Rows[0]["FEEDSILKBEGINTIME"].ToString()) && !string.IsNullOrEmpty(this.ultraDataSource1.Rows[0]["FEEDSILKCLOSETIME"].ToString()))
- {
- if (Convert.ToDateTime(this.ultraDataSource1.Rows[0]["FEEDSILKBEGINTIME"]) < Convert.ToDateTime(this.ultraDataSource1.Rows[0]["FEEDSILKCLOSETIME"]))
- ultraDataSource1.Rows[0]["FEEDSILKTIME"] = CStaticMethod.caculateTime(Convert.ToDateTime(this.ultraDataSource1.Rows[0]["FEEDSILKBEGINTIME"]), Convert.ToDateTime(this.ultraDataSource1.Rows[0]["FEEDSILKCLOSETIME"]));
- else
- {
- MessageBox.Show("喂丝开始时间不能大于喂丝结束时间!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
- return;
- }
- }
- SaveData(); //保存数据
- RefreshData(); //刷新数据
- }
-
- /// <summary>
- /// 保存作业信息
- /// </summary>
- 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 = _htCasJobInfo["HEATNO"].ToString();
- strStationCode = CStaticMethod.analysProcess(DEVICE_POSITION.Substring(0, 3)) + _htCasJobInfo["STATIONCODE"].ToString();
- strDisposaltime = _htCasJobInfo["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++)
- {
- //判断是否修改过
- if (_UpdateColumnName.ContainsKey(ultraDataSource1.Band.Columns[intCount].Key.ToString()))
- {
- 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 (_htCasJobInfo["SHIFTCODE"] != null && _htCasJobInfo["SHIFTCODE"].ToString().Length > 1)
- strShiftCode = _htCasJobInfo["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._htCasJobInfo["OPTPERSONNEL"].ToString() == "")
- {
- OPTPERSONNEL = this.UserInfo.GetUserName();
- }
- else
- {
- if (ucPlan1.ultraDataSource1.Rows[0]["OPTPERSONNEL"].ToString() != this._htCasJobInfo["OPTPERSONNEL"].ToString())
- OPTPERSONNEL = ucPlan1.ultraDataSource1.Rows[0]["OPTPERSONNEL"].ToString();
- else
- OPTPERSONNEL = this._htCasJobInfo["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();
- //判断是否修改过
- if (_UpdateColumnName.ContainsKey(strKey) &&
- _UpdateColumnName.ContainsValue(ucAdditives1.ulgridPrcMtr.DisplayLayout.Bands[0].Columns[intCount].Header.Caption))
- {
- 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();
- //判断是否修改过
- if (_UpdateColumnName.ContainsKey(strKey) &&
- _UpdateColumnName.ContainsValue(ucAdditives1.ultgridAlloy.DisplayLayout.Bands[0].Columns[intCount].Header.Caption))
- {
- 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();
- //判断是否修改过
- if (_UpdateColumnName.ContainsKey(strKey) &&
- _UpdateColumnName.ContainsValue(ucAdditives1.ultgridWs.DisplayLayout.Bands[0].Columns[intCount].Header.Caption))
- {
- 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();
- //判断是否修改过
- if (_UpdateColumnName.ContainsKey(strKey) &&
- _UpdateColumnName.ContainsValue(ucAdditives1.ultgridManual.DisplayLayout.Bands[0].Columns[intCount].Header.Caption))
- {
- 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);
- }
- }
- }
- /// <summary>
- /// 刷新
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- 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 (udLH.ActiveRow != null)
- {
- //m_szJRCLH = udLH.ActiveRow.Cells["HEATPROCESSNO"].Value.ToString();//加热处理号
- //m_szLH = udLH.ActiveRow.Cells["HEATNO"].Value.ToString(); //熔炼号
- ResetData();
- //计划
- ucPlan1.ResetData();
- this.ucPlan1.GetPlanInfo(m_szLH);
- //吹氩作业信息
- GetCASData();
- if (_htCasJobInfo.Count == 0)
- return;
- //物料
- if (_htCasJobInfo != null && !string.IsNullOrEmpty(_htCasJobInfo["HEATNO"].ToString()))
- this.ucAdditives1.GetAdditiveData(_htCasJobInfo["HEATNO"].ToString(), "D" + _htCasJobInfo["STATIONCODE"].ToString(), _htCasJobInfo["DISPOSALTIME"].ToString());
- //化学成分
- ucResChemelEment1.ResetData();
- ucResChemelEment1.GetCraftEleInfo(_htCasJobInfo["HEATNO"].ToString(), "D0" + DEVICE_POS, "S","");
- //化学成分标准
- if (ucPlan1._htPlanInfo["V_HEAT_ID"] != null)
- ucResChemelEment1.GetStandardElement(_htCasJobInfo["HEATNO"].ToString());
- ////化学成分标准
- //if (_htCasJobInfo != null && _htCasJobInfo["PLANSTEEL"] != null)
- // ucResChemelEment1.GetStandardElement(_htCasJobInfo["PLANSTEEL"].ToString(), ucPlan1.ultraDataSource1.Rows[0]["CAST_ID"].ToString());
- ucResChemelEment1.FillCraftElement();
- //温度采样信息
- ucTempSampling1.GetSampleData(_htCasJobInfo["HEATNO"].ToString(), "D" + _htCasJobInfo["STATIONCODE"].ToString(), _htCasJobInfo["DISPOSALTIME"].ToString());
- ucTempSampling1.FillTemperatureData("TEMPERATURE");
- _UpdateColumnName.Clear();
- _UpdateBefore.Clear();
- _UpdateAfter.Clear();
- }
- }
- private void ubJJB_Click(object sender, EventArgs e)
- {
- foreach (Form mdiChild in this.MdiParent.MdiChildren)
- {
- if (mdiChild.Text == DEVICE_POS + "#吹氩站交接班管理")
- {
- mdiChild.Activate();
- return;
- }
- }
- frmCcmMgt frm = new frmCcmMgt(DEVICE_POSITION);
- frm.MdiParent = this.MdiParent;
- frm.Text = DEVICE_POS + "#吹氩站交接班管理";
- frm.Show();
- }
- private void btAddLH_Click(object sender, EventArgs e)
- {
-
- }
- /// <summary>
- /// 手动新增一个新熔炼号后,刷新熔炼号信息
- /// </summary>
- 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();
- }
- /// <summary>
- /// 修改各岗位钢包信息
- /// </summary>
- /// <param name="strHeatNo">熔炼号</param>
- /// <param name="strPotNo">钢包包号</param>
- /// <param name="strPotdistinction">钢包等级</param>
- /// <param name="strPotage">钢包包龄</param>
- /// <param name="strPotwrapstate">钢包包况</param>
- private void UpdatePotInfo(string strHeatNo,string strPotNo,string strPotdistinction,string strPotage,string strPotwrapstate)
- {
- string[] ArrayCZXX = new string[5] { "", "", "", "", ""}; //保存信息
- ArrayCZXX[0] = strHeatNo;//熔炼号
- ArrayCZXX[1] = strPotNo;//钢包包号
- ArrayCZXX[2] = strPotdistinction;//钢包等级
- ArrayCZXX[3] = strPotage;//钢包包龄
- ArrayCZXX[4] = strPotwrapstate;//钢包包况
- string strError = "";
- //hengxing Core.Mes.ClientFrameWork.ClientCommon._RemotingHelp.ExecuteMethod("lgResMgt", "Core.LgMes.Server.LgResMgt.LfsCollect", "UpdatePot", new object[] { ArrayCZXX }, out strError);
- if (strError == "")
- MessageBox.Show("熔炼号:" + strHeatNo + " 的各岗位钢包信息修改成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
- else
- MessageBox.Show("熔炼号:" + strHeatNo + " 的各岗位钢包信息修改失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
- }
- private void ultraGrid4_ClickCellButton(object sender, Infragistics.Win.UltraWinGrid.CellEventArgs e)
- {
- 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 != "BLOWARMODE")
- {
- try
- {
- Convert.ToDecimal(ultraGrid4.ActiveCell.Text);
- }
- catch (Exception ex)
- {
- MessageBox.Show(ex.Message, "提示");
- ultraGrid4.ActiveCell.Value = "";
- }
- }
- }
- #region "记录实绩修改日志"
- /// <summary>
- /// 设置用户控件委托
- /// </summary>
- 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
- private void button34_Click(object sender, EventArgs e)
- {
- }
- }
- }
|