| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- using CoreFS.CA06;
- using Common;
- using System.Collections;
- using Core.LZMes.Client.UIE;
- namespace Core.LZMes.Client.UIF
- {
- /// <summary>
- /// 酸轧生产管制主界面:轧批指定
- /// </summary>
- public partial class UIF0420101 : CoreFS.CA06.FrmBase
- {
- public UIF0420101()
- {
- InitializeComponent();
- }
- #region "Button Event"
- /// <summary>
- /// 轧制单元计划:酸轧基料卷选择
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void btn_Add_Click(object sender, EventArgs e)
- {
- try
- {
- this.ugrd_HCoilInfo.UpdateData();
- System.Data.DataRow[] rows = this.dataSet1.Tables["TAB_HCOILINFO"].Select("FLAG='TRUE'");
- if (rows.Length == 0)
- {
- MessageBox.Show("您还未选择基料卷,请选择");
- return;
- }
- string CoilNOS = "";
- string ex = "";
- for (int i = 0; i < this.ugrd_HCoilInfo.Rows.Count; i++)
- {
- if (Common.FixDBManager.CheckNullStr(ugrd_HCoilInfo.Rows[i].Cells["FLAG"].Value).ToUpper() == "TRUE")
- {
- CoilNOS = CoilNOS + ugrd_HCoilInfo.Rows[i].Cells["COIL_NO"].Value.ToString() + ";";
- }
-
- }
-
- CoilNOS = CoilNOS.Substring(0, CoilNOS.Length - 1);
- Hashtable paramHsmp = new Hashtable();
- paramHsmp.Add("i1", CoilNOS);
- paramHsmp.Add("i2", rows.Length.ToString());
- paramHsmp.Add("i3", CoreFS.SA06.CoreUserInfo.UserInfo.GetUserName());
- paramHsmp.Add("o4", ex);
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "UIB.COM.ComDBProcedure";
- ccp.MethodName = "doXmlProcedure";
- ccp.ServerParams = new Object[] { "UIF042010.Add_RollPlan_List", paramHsmp };
- CoreClientParam obj = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- System.Collections.ArrayList err = obj.ReturnObject as System.Collections.ArrayList;
- if (err != null && err.Count > 0 && Common.FixDBManager.CheckNullStr(err[0]) != "1")
- {
- MessageBox.Show(err[0].ToString(), Common.FixDBManager.MsgCaption);
- }
- else
- {
- Get_RollPlan_List();
- Get_RollPlan_Info();
- for (int i = rows.Length - 1; i >= 0; i--)
- {
- this.dataSet1.Tables["TAB_HCOILINFO"].Rows.Remove(rows[i]);
- }
- this.dataSet1.Tables["TAB_HCOILINFO"].AcceptChanges();
- }
- }
- catch (System.Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- }
- }
- /// <summary>
- /// 轧制单元计划:删除已制定的计划
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void btn_Del_Click(object sender, EventArgs e)
- {
- try
- {
- if (this.ugrd_RollPlan.Selected.Rows.Count == 0)
- {
- MessageBox.Show("请选择您要移除的记录");
- return;
- }
- string RollNO = this.ugrd_RollInfo.Rows[0].Cells[1].Value.ToString();
- string CoilNOS = "";
- string Condition = "";
- foreach (Infragistics.Win.UltraWinGrid.UltraGridRow row in this.ugrd_RollPlan.Selected.Rows)
- {
- CoilNOS = CoilNOS + Common.FixDBManager.CheckNullStr(row.Cells["COIL_NO"].Value) + ";";
- Condition = Condition + "'" + Common.FixDBManager.CheckNullStr(row.Cells["COIL_NO"].Value) + "',";
- }
- CoilNOS = CoilNOS.Substring(0, CoilNOS.Length - 1);
- Condition = Condition.Substring(0, Condition.Length - 1);
- Condition = " AND A.COIL_NO IN(" + Condition + ") ";
- Hashtable paramHsmp = new Hashtable();
- paramHsmp.Add("i1", RollNO);
- paramHsmp.Add("i2", CoilNOS);
- paramHsmp.Add("i3", this.ugrd_RollPlan.Selected.Rows.Count.ToString());
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "UIB.COM.ComDBProcedure";
- ccp.MethodName = "doXmlProcedure";
- ccp.ServerParams = new Object[] { "UIF042010.Del_RollPlan_List", paramHsmp };
- CoreClientParam obj = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- System.Collections.ArrayList err = obj.ReturnObject as System.Collections.ArrayList;
- if (err != null && err.Count > 0 && Common.FixDBManager.CheckNullStr(err[0]) != "1")
- {
- MessageBox.Show(err[0].ToString(), Common.FixDBManager.MsgCaption);
- }
- else
- {
- Get_RollPlan_List();
- Get_RollPlan_Info();
- Query(Condition);
- }
- }
- catch (System.Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- }
- }
- /// <summary>
- /// 轧制单位内基料卷顺序前移
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void btn_UP_Click(object sender, EventArgs e)
- {
- try
- {
- if (this.ugrd_RollPlan.Selected.Rows.Count == 0)
- {
- MessageBox.Show("请确定您要前移的基料卷");
- return;
- }
- string ex = "";
- string Index_ = "";
- string RollNO = this.ugrd_RollInfo.Rows[0].Cells[1].Value.ToString();
- System.Collections.ArrayList HCoil_ary = new ArrayList();
- foreach (Infragistics.Win.UltraWinGrid.UltraGridRow row in this.ugrd_RollPlan.Selected.Rows)
- {
- Index_ = Index_ + Common.FixDBManager.CheckNullStr(row.Cells["INDX_"].Value) + ";";
- HCoil_ary.Add(row.Cells["COIL_NO"].Value);
- }
- Index_ = Index_.Substring(0, Index_.Length - 1);
- string[] Indexs_ = Index_.Split(';');
-
- if (Check_Index_Order(Indexs_))
- {
- Hashtable paramHsmp = new Hashtable();
- paramHsmp.Add("i1", RollNO);
- paramHsmp.Add("i2", this.ugrd_RollPlan.Selected.Rows.Count.ToString());
- paramHsmp.Add("i3", Get_Index_Min(Indexs_));
- paramHsmp.Add("i4", Get_Index_Max(Indexs_));
- paramHsmp.Add("i5", "-1");
- paramHsmp.Add("o6", ex);
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "UIB.COM.ComDBProcedure";
- ccp.MethodName = "doXmlProcedure";
- ccp.ServerParams = new Object[] { "UIF042010.Adj_RollPlan_List", paramHsmp };
- CoreClientParam obj = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- System.Collections.ArrayList err = obj.ReturnObject as System.Collections.ArrayList;
- if (err != null && err.Count > 0 && Common.FixDBManager.CheckNullStr(err[0]) != "1")
- {
- MessageBox.Show(err[0].ToString(), Common.FixDBManager.MsgCaption);
- }
- else
- {
- Get_RollPlan_List();
- Get_RollPlan_Info();
- ReSet_SelectRow(HCoil_ary);
- }
- }
- }
- catch (System.Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- }
- }
- /// <summary>
- /// 轧制单元内基料卷顺序后移
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void btn_Down_Click(object sender, EventArgs e)
- {
- try
- {
- if (this.ugrd_RollPlan.Selected.Rows.Count == 0)
- {
- MessageBox.Show("请确定您要前移的基料卷");
- return;
- }
- string ex = "";
- string Index_ = "";
- string RollNO = this.ugrd_RollInfo.Rows[0].Cells[1].Value.ToString();
- System.Collections.ArrayList HCoil_ary = new ArrayList();
- foreach (Infragistics.Win.UltraWinGrid.UltraGridRow row in this.ugrd_RollPlan.Selected.Rows)
- {
- Index_ = Index_ + Common.FixDBManager.CheckNullStr(row.Cells["INDX_"].Value) + ";";
- HCoil_ary.Add(row.Cells["COIL_NO"].Value);
- }
- Index_ = Index_.Substring(0, Index_.Length - 1);
- string[] Indexs_ = Index_.Split(';');
- if (Check_Index_Order(Indexs_))
- {
- Hashtable paramHsmp = new Hashtable();
- paramHsmp.Add("i1", RollNO);
- paramHsmp.Add("i2", this.ugrd_RollPlan.Selected.Rows.Count.ToString());
- paramHsmp.Add("i3", Get_Index_Min(Indexs_));
- paramHsmp.Add("i4", Get_Index_Max(Indexs_));
- paramHsmp.Add("i5", "1");
- paramHsmp.Add("o6", ex);
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "UIB.COM.ComDBProcedure";
- ccp.MethodName = "doXmlProcedure";
- ccp.ServerParams = new Object[] { "UIF042010.Adj_RollPlan_List", paramHsmp };
- CoreClientParam obj = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- System.Collections.ArrayList err = obj.ReturnObject as System.Collections.ArrayList;
- if (err != null && err.Count > 0 && Common.FixDBManager.CheckNullStr(err[0]) != "1")
- {
- MessageBox.Show(err[0].ToString(), Common.FixDBManager.MsgCaption);
- }
- else
- {
- Get_RollPlan_List();
- Get_RollPlan_Info();
- ReSet_SelectRow(HCoil_ary);
- }
- }
- }
- catch (System.Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- }
- }
- /// <summary>
- /// 并卷
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void btn_Merge_Click(object sender, EventArgs e)
- {
- try
- {
- if (this.ugrd_RollPlan.Selected.Rows.Count == 0)
- {
- MessageBox.Show("请确定您要并卷的基料卷");
- return;
- }
- string Index_ = "";
- string HCoilNOS = "";
- string ex = "";
- string RollNO = this.ugrd_RollInfo.Rows[0].Cells[1].Value.ToString();
- System.Collections.ArrayList HCoil_ary = new ArrayList();
- foreach (Infragistics.Win.UltraWinGrid.UltraGridRow row in this.ugrd_RollPlan.Selected.Rows)
- {
- Index_ = Index_ + Common.FixDBManager.CheckNullStr(row.Cells["INDX_"].Value) + ";";
- HCoilNOS = HCoilNOS + Common.FixDBManager.CheckNullStr(row.Cells["COIL_NO"].Value) + ";";
- HCoil_ary.Add(row.Cells["COIL_NO"].Value);
- }
- Index_ = Index_.Substring(0, Index_.Length - 1);
- string[] Indexs_ = Index_.Split(';');
- if (Check_Index_Order(Indexs_))
- {
- Hashtable paramHsmp = new Hashtable();
- paramHsmp.Add("i1", RollNO);
- paramHsmp.Add("i2", this.ugrd_RollPlan.Selected.Rows.Count.ToString());
- paramHsmp.Add("i3", HCoilNOS);
- paramHsmp.Add("o4", ex);
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "UIB.COM.ComDBProcedure";
- ccp.MethodName = "doXmlProcedure";
- ccp.ServerParams = new Object[] { "UIF042010.Mge_RollPlan_HCoil", paramHsmp };
- CoreClientParam obj = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- System.Collections.ArrayList err = obj.ReturnObject as System.Collections.ArrayList;
- if (err != null && err.Count > 0 && Common.FixDBManager.CheckNullStr(err[0]) != "1")
- {
- MessageBox.Show(err[0].ToString(), Common.FixDBManager.MsgCaption);
- }
- else
- {
- Get_RollPlan_List();
- Get_RollPlan_Info();
- ReSet_SelectRow(HCoil_ary);
- }
- }
- }
- catch (System.Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- }
- }
- /// <summary>
- /// 取消并卷
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void btn_Cancel_Click(object sender, EventArgs e)
- {
- try
- {
- if (this.ugrd_RollPlan.Selected.Rows.Count == 0)
- {
- MessageBox.Show("请确定您要并卷的基料卷");
- return;
- }
- string Index_ = "";
- string HCoilNOS = "";
- string RollNO = this.ugrd_RollInfo.Rows[0].Cells[1].Value.ToString();
- System.Collections.ArrayList HCoil_ary = new ArrayList();
- foreach (Infragistics.Win.UltraWinGrid.UltraGridRow row in this.ugrd_RollPlan.Selected.Rows)
- {
- Index_ = Index_ + Common.FixDBManager.CheckNullStr(row.Cells["INDX_"].Value) + ";";
- HCoilNOS = HCoilNOS + Common.FixDBManager.CheckNullStr(row.Cells["COIL_NO"].Value) + ";";
- HCoil_ary.Add(row.Cells["COIL_NO"].Value);
- }
- Index_ = Index_.Substring(0, Index_.Length - 1);
- string[] Indexs_ = Index_.Split(';');
- string ex = "";
- if (Check_Index_Order(Indexs_))
- {
- Hashtable paramHsmp = new Hashtable();
- paramHsmp.Add("i1", RollNO);
- paramHsmp.Add("i2", this.ugrd_RollPlan.Selected.Rows.Count.ToString());
- paramHsmp.Add("i3", HCoilNOS);
- paramHsmp.Add("o4", ex);
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "UIB.COM.ComDBProcedure";
- ccp.MethodName = "doXmlProcedure";
- ccp.ServerParams = new Object[] { "UIF042010.CMg_RollPlan_HCoil", paramHsmp };
- CoreClientParam obj = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- System.Collections.ArrayList err = obj.ReturnObject as System.Collections.ArrayList;
- if (err != null && err.Count > 0 && Common.FixDBManager.CheckNullStr(err[0]) != "1")
- {
- MessageBox.Show(err[0].ToString(), Common.FixDBManager.MsgCaption);
- }
- else
- {
- Get_RollPlan_List();
- Get_RollPlan_Info();
- ReSet_SelectRow(HCoil_ary);
- }
- }
- }
- catch (System.Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- }
- }
- private bool Check_Index_Order(string[] Index_)
- {
- try
- {
- if (Index_.Length < 2)
- return true;
- int value = 0;
- for (int i = 0; i < Index_.Length - 1; i++)
- {
- value = Common.FixDBManager.CheckNullInt(Index_[i + 1]) - Common.FixDBManager.CheckNullInt(Index_[i]);
- if (value > 1)
- {
- MessageBox.Show("所操作的基料卷的顺序不能跳跃");
- return false;
- }
- }
- return true;
- }
- catch (System.Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- return false;
- }
- }
- private string Get_Index_Min(string[] Index_)
- {
- string Index_Min = Index_[0];
- for (int i = 1; i < Index_.Length; i++)
- {
- if (Common.FixDBManager.CheckNullInt(Index_Min) > Common.FixDBManager.CheckNullInt(Index_[i]))
- {
- Index_Min = Index_[i];
- }
- }
- return Index_Min;
- }
- private string Get_Index_Max(string[] Index_)
- {
- string Index_Max = Index_[0];
- for (int i = 1; i < Index_.Length; i++)
- {
- if (Common.FixDBManager.CheckNullInt(Index_Max) < Common.FixDBManager.CheckNullInt(Index_[i]))
- {
- Index_Max = Index_[i];
- }
- }
- return Index_Max;
- }
- private void ReSet_SelectRow(System.Collections.ArrayList HCoil_ary)
- {
- try
- {
- foreach (Infragistics.Win.UltraWinGrid.UltraGridRow row in this.ugrd_RollPlan.Rows)
- {
- if (HCoil_ary.Contains(row.Cells["COIL_NO"].Value))
- {
- row.Selected = true;
- }
- }
- }
- catch (System.Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- }
- }
- #endregion
- #region "ToolBar Event"
- public override void ToolBar_Click(object sender, string ToolbarKey)
- {
- try
- {
- switch (ToolbarKey)
- {
- case "Query":
- string Condition = this.uiF042010_CTL1.Condition;
- Condition = Condition + " AND A.TOT_DEC_GRD IS NOT NULL ";
- this.dataSet1.Tables["TAB_HCOILINFO"].Clear();
- Query(Condition);
- break;
- case "Save":
- string RollNO = this.ugrd_RollInfo.Rows[0].Cells[1].Value.ToString();
- Save(RollNO);
- break;
- case "Exit":
- this.Close();
- break;
- }
- }
- catch (System.Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- }
- }
- /// <summary>
- /// 根据条件得到待选取的冷轧基料卷信息
- /// </summary>
- private void Query(string Condition)
- {
- try
- {
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "UIF.UIF04.UIF042010";
- ccp.MethodName = "Query_HCoil_Info";
- ccp.ServerParams = new object[] { Condition };
- CoreClientParam obj = this.ExecuteQuery(ccp, CoreInvokeType.Internal);
- if (obj.ReturnInfo.Length == 0)
- {
- System.Data.DataTable tab0 = FixDBManager.ConvertToDataTable(obj.ReturnObject as System.Collections.ArrayList, this.dataSet1.Tables["TAB_HCOILINFO"]);
- tab0.TableName = "TAB_HCOILINFO";
- this.dataSet1.Tables["TAB_HCOILINFO"].Merge(tab0);
- this.dataSet1.AcceptChanges();
- }
- }
- catch (System.Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- }
- }
- private void Save(string RollNO)
- {
- try
- {
- string chk_flag = "";
- if (this.CHK_CHEM.Checked)
- chk_flag = "1";
- else
- chk_flag = "0";
- if (this.CHK_PHY.Checked)
- chk_flag = chk_flag + "1";
- else
- chk_flag = chk_flag + "0";
- chk_flag=chk_flag + "000";
- string ex = "";
- string chk_ex = "";
- Hashtable paramHsmp = new Hashtable();
- paramHsmp.Add("i1", RollNO);
- paramHsmp.Add("i2", CoreFS.SA06.CoreUserInfo.UserInfo.GetUserName());
- paramHsmp.Add("i3", chk_flag);
- paramHsmp.Add("o4", chk_ex);
- paramHsmp.Add("o5", ex);
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "UIB.COM.ComDBProcedure";
- ccp.MethodName = "doXmlProcedure";
- ccp.ServerParams = new Object[] { "UIF042010.AFM_RollPlan", paramHsmp };
- CoreClientParam obj = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- System.Collections.ArrayList err = obj.ReturnObject as System.Collections.ArrayList;
- if (err != null && err.Count > 0 && Common.FixDBManager.CheckNullStr(err[0]) != "1")
- {
- MessageBox.Show(err[0].ToString(), Common.FixDBManager.MsgCaption);
- if (err.Count > 1 && Common.FixDBManager.CheckNullStr(err[1]) != "1")
- {
- string[] err_Coil = Common.FixDBManager.CheckNullStr(err[1]).Split('#');
- SetDataErrorRow(err_Coil);
- }
- }
- else
- {
- Get_RollPlan_List();
- Get_RollPlan_Info();
- }
- }
- catch (System.Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- }
- }
- private void SetDataErrorRow(string[] err_Coil)
- {
- try
- {
- System.Collections.Hashtable err_hsb = new Hashtable();
- foreach (string Coil in err_Coil)
- {
- if (Coil.Length > 2)
- {
- string err_no = Coil.Split(':')[0];
- string Coil_no = Coil.Split(':')[1];
- System.Collections.ArrayList err_list;
- if (err_hsb.Contains(Coil_no))
- {
- err_list = err_hsb[Coil_no] as System.Collections.ArrayList;
- err_list.Add(err_no);
- err_hsb[Coil_no] = err_list;
- }
- else
- {
- err_list = new ArrayList();
- err_list.Add(err_no);
- err_hsb.Add(Coil_no, err_list);
- }
- }
- }
- foreach (System.Data.DataRow row in this.dataSet1.Tables["TAB_ROLLPLAN"].Rows)
- {
- if (err_hsb.Contains(row["COIL_NO"].ToString()))
- {
- string err_Info = "";
- System.Collections.ArrayList err_lst = err_hsb[row["COIL_NO"].ToString()] as System.Collections.ArrayList;
- for (int i = 0; i < err_lst.Count; i++)
- {
- switch (err_lst[i].ToString())
- {
- case "10000":
- err_Info = err_Info + "基料卷成分不满足要求,不能确认计划" + "\n";
- break;
- case "01000":
- err_Info = err_Info + "基料卷性能不满足要求,不能确认计划" + "\n";
- break;
- }
- }
- row.SetColumnError(this.dataSet1.Tables["TAB_ROLLPLAN"].Columns["INDX_"], err_Info);
- }
- }
- }
- catch (System.Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- }
- }
- #endregion
- #region"Init"
- /// <summary>
- /// 窗体初始化事件
- /// 用于加载初始化数据
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void UIF0420101_Load(object sender, EventArgs e)
- {
- try
- {
- System.Windows.Forms.ToolTip tip = new ToolTip();
- tip.SetToolTip(this.btn_UP, "上移");
- tip.SetToolTip(this.btn_Down, "下移");
- tip.SetToolTip(this.btn_Merge, "合并基料卷");
- tip.SetToolTip(this.btn_Cancel, "取消基料卷合并");
- Get_RollPlan_List();
- Get_RollPlan_Info();
- Common.FixDBManager.SetGridCheckBox("FLAG", "TAB_HCOILINFO", 25, this.ugrd_HCoilInfo);
- string ColumnName = "";
- for (int i = 0; i < this.ugrd_HCoilInfo.DisplayLayout.Bands[0].Columns.Count; i++)
- {
- ColumnName = this.ugrd_HCoilInfo.DisplayLayout.Bands[0].Columns[i].Key;
- if (ColumnName == "FLAG")
- {
- Common.FixDBManager.SetCellActivation(ColumnName, "TAB_HCOILINFO", this.ugrd_HCoilInfo, "ALLOWEDIT");
- }
- else
- {
- Common.FixDBManager.SetCellActivation(ColumnName, "TAB_HCOILINFO", this.ugrd_HCoilInfo, "ACTIVATEONLY");
- }
- }
- this.ugrd_RollPlan.DisplayLayout.Override.SupportDataErrorInfo = Infragistics.Win.UltraWinGrid.SupportDataErrorInfo.RowsAndCells;
- }
- catch (System.Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- }
- }
- /// <summary>
- /// 获取已制定未确认的轧制计划信息
- /// </summary>
- private void Get_RollPlan_List()
- {
- try
- {
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "UIF.UIF04.UIF042010";
- ccp.MethodName = "Query_RollPlan_List";
- CoreClientParam obj = this.ExecuteQuery(ccp, CoreInvokeType.Internal);
- if (obj.ReturnInfo.Length == 0)
- {
- this.dataSet1.Tables["TAB_ROLLPLAN"].Clear();
- System.Data.DataTable tab0 = FixDBManager.ConvertToDataTable(obj.ReturnObject as System.Collections.ArrayList, this.dataSet1.Tables["TAB_ROLLPLAN"]);
- tab0.TableName = "TAB_ROLLPLAN";
- this.dataSet1.Tables["TAB_ROLLPLAN"].Merge(tab0);
- this.dataSet1.AcceptChanges();
- }
- }
- catch (System.Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- }
- }
- /// <summary>
- /// 获取已制定未确认的轧制计划描述信息
- /// </summary>
- private void Get_RollPlan_Info()
- {
- try
- {
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "UIF.UIF04.UIF042010";
- ccp.MethodName = "Query_RollPlan_Info";
- CoreClientParam obj = this.ExecuteQuery(ccp, CoreInvokeType.Internal);
- if (obj.ReturnInfo.Length == 0)
- {
- this.dataSet1.Tables["TAB_ROLLINFO"].Clear();
- System.Data.DataTable tab0 = FixDBManager.ConvertToDataTable(obj.ReturnObject as System.Collections.ArrayList, this.dataSet1.Tables["TAB_ROLLINFO"]);
- tab0.TableName = "TAB_ROLLINFO";
- this.dataSet1.Tables["TAB_ROLLINFO"].Merge(tab0);
- this.dataSet1.AcceptChanges();
- }
- }
- catch (System.Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- }
- }
- #endregion
- #region "Grid Event"
- private void ugrd_HCoilInfo_CellChange(object sender, Infragistics.Win.UltraWinGrid.CellEventArgs e)
- {
- try
- {
- this.ugrd_HCoilInfo.UpdateData();
- if (e.Cell.Column.Key == "FLAG")
- {
- if (e.Cell.Value.ToString().ToUpper() == "TRUE")
- {
- e.Cell.Row.Appearance.BackColor = System.Drawing.Color.LightSteelBlue;
-
- }
- else
- {
- e.Cell.Row.Appearance.BackColor = System.Drawing.Color.White;
-
- }
- }
- }
- catch (System.Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- }
- }
- private void ugrd_HCoilInfo_DoubleClickRow(object sender, Infragistics.Win.UltraWinGrid.DoubleClickRowEventArgs e)
- {
- try
- {
- if (this.ugrd_HCoilInfo.ActiveRow != null)
- {
- Core.LZMes.Client.UIB.UIB010301 frm = new Core.LZMes.Client.UIB.UIB010301();
- frm.ob = this.ob;
- frm.OrderNO = Common.FixDBManager.CheckNullStr(this.ugrd_HCoilInfo.ActiveRow.Cells["ORD_NO"].Value);
- frm.OrderSEQ = Common.FixDBManager.CheckNullStr(this.ugrd_HCoilInfo.ActiveRow.Cells["ORD_SEQ"].Value); ;
- frm.ShowDialog();
- }
- }
- catch (System.Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- }
- }
- private void ugrd_HCoilInfo_ClickCell(object sender, Infragistics.Win.UltraWinGrid.ClickCellEventArgs e)
- {
- //try
- //{
- // if (e.Cell.Column.Key == "ORD_NO" | e.Cell.Column.Key == "ORD_SEQ")
- // {
- // Core.LZMes.Client.UIB.UIB010301 frm = new Core.LZMes.Client.UIB.UIB010301();
- // frm.ob = this.ob;
- // frm.OrderNO = Common.FixDBManager.CheckNullStr(this.ugrd_HCoilInfo.ActiveRow.Cells["ORD_NO"].Value);
- // frm.OrderSEQ = Common.FixDBManager.CheckNullStr(this.ugrd_HCoilInfo.ActiveRow.Cells["ORD_SEQ"].Value); ;
- // frm.ShowDialog();
- // }
- //}
- //catch (System.Exception ex)
- //{
- // System.Diagnostics.Debug.WriteLine(ex.ToString());
- //}
- }
- #endregion
- private void ugrd_HCoilInfo_AfterCellActivate(object sender, EventArgs e)
- {
- Infragistics.Win.UltraWinGrid.UltraGrid tt = (Infragistics.Win.UltraWinGrid.UltraGrid)sender;
- string clickColumnID = Convert.ToString(Common.FixDBManager.CheckNullStr(tt.ActiveCell.Column.Key));
- if (!(clickColumnID.Equals("ORD_NO") || clickColumnID.Equals("ORD_SEQ") || clickColumnID.Equals("CUST_CD")))
- {
- return;
- }
- string clickNO = Convert.ToString(Common.FixDBManager.CheckNullStr(tt.ActiveRow.Cells["ORD_NO"].Value));
- string clickSeq = Convert.ToString(Common.FixDBManager.CheckNullStr(tt.ActiveRow.Cells["ORD_SEQ"].Value));
- if (clickNO == null || clickNO == "") return;
- if (clickSeq == null || clickSeq == "") return;
- if (clickColumnID.Equals("ORD_NO"))
- {
- Core.LZMes.Client.UIE.UIE041050 frm = new UIE041050();
- frm.ob = this.ob;
- frm.Condition = clickNO + "|" + clickSeq;
- frm.ShowDialog();
- }
- else if (clickColumnID.Equals("ORD_SEQ"))
- {
- Core.LZMes.Client.UIE.UIE041080 frm = new UIE041080();
- frm.ob = this.ob;
- frm.Condition = clickNO + "|" + clickSeq;
- frm.ShowDialog();
- }
- else if (clickColumnID.Equals("CUST_CD"))
- {
- try
- {
- if (this.ugrd_HCoilInfo.ActiveRow != null)
- {
- Core.LZMes.Client.UIB.UIB010301 frm = new Core.LZMes.Client.UIB.UIB010301();
- frm.ob = this.ob;
- frm.OrderNO = Common.FixDBManager.CheckNullStr(this.ugrd_HCoilInfo.ActiveRow.Cells["ORD_NO"].Value);
- frm.OrderSEQ = Common.FixDBManager.CheckNullStr(this.ugrd_HCoilInfo.ActiveRow.Cells["ORD_SEQ"].Value); ;
- frm.ShowDialog();
- }
- }
- catch (System.Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- }
- }
- else
- {
- return;
- }
- }
-
- }
- }
|