| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778 |
- using System;
- using System.Collections;
- 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;
- namespace Core.LZMes.Client.UIF.UIF06
- {
- public partial class UIF061070 : FrmBase
- {
- public UIF061070()
- {
- InitializeComponent();
- }
- private void UIF061070_Load(object sender, EventArgs e)
- {
- try
- {
- // Get_BaseData();
- //Get_ReelPlan_Info();
- // Get_ReelPlan_List();
- this.Cmb_PM.DisplayLayout.Bands[0].Columns["FLAG"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit;
- this.Cmb_BM.DisplayLayout.Bands[0].Columns["FLAG"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit;
- Common.FixDBManager.SetGridCheckBox("FLAG", "TAB_CCOILLIST", 25, this.ugrd_CoilList);
- string ColumnName = "";
- for (int i = 0; i < this.ugrd_CoilList.DisplayLayout.Bands[0].Columns.Count; i++)
- {
- ColumnName = this.ugrd_CoilList.DisplayLayout.Bands[0].Columns[i].Key;
- if (ColumnName == "FLAG")
- {
- Common.FixDBManager.SetCellActivation(ColumnName, "TAB_CCOILLIST", this.ugrd_CoilList, "ALLOWEDIT");
- }
- else
- {
- Common.FixDBManager.SetCellActivation(ColumnName, "TAB_CCOILLIST", this.ugrd_CoilList, "ACTIVATEONLY");
- }
- }
- this.ugrd_CalList.DisplayLayout.Override.SupportDataErrorInfo = Infragistics.Win.UltraWinGrid.SupportDataErrorInfo.RowsAndCells;
- }
- catch (System.Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- }
- }
- private void Get_BaseData()
- {
- try
- {
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "UIF.UIF06.UIF061070";
- ccp.MethodName = "queryBaseData";
- CoreClientParam obj = this.ExecuteQuery(ccp, CoreInvokeType.Internal);
- if (obj.ReturnInfo.Length == 0)
- {
- System.Collections.ArrayList rtnobj = obj.ReturnObject as System.Collections.ArrayList;
- if (rtnobj[0] != null)
- {
- this.dataSet1.Tables["TAB_PM"].Clear();
- System.Data.DataTable tab0 = FixDBManager.ConvertToDataTable(rtnobj[0] as System.Collections.ArrayList, this.dataSet1.Tables["TAB_PM"]);
- tab0.TableName = "TAB_PM";
- this.dataSet1.Tables["TAB_PM"].Merge(tab0);
- }
- if (rtnobj[1] != null)
- {
- this.dataSet1.Tables["TAB_BM"].Clear();
- System.Data.DataTable tab1 = FixDBManager.ConvertToDataTable(rtnobj[1] as System.Collections.ArrayList, this.dataSet1.Tables["TAB_BM"]);
- tab1.TableName = "TAB_BM";
- this.dataSet1.Tables["TAB_BM"].Merge(tab1);
- }
- if (rtnobj[2] != null)
- {
- this.dataSet1.Tables["TAB_SLEEVE"].Clear();
- System.Data.DataTable tab1 = FixDBManager.ConvertToDataTable(rtnobj[2] as System.Collections.ArrayList, this.dataSet1.Tables["TAB_SLEEVE"]);
- tab1.TableName = "TAB_SLEEVE";
- this.dataSet1.Tables["TAB_SLEEVE"].Merge(tab1);
- }
- if (rtnobj[3] != null)
- {
- this.dataSet1.Tables["SPM_MODE"].Clear();
- System.Data.DataTable tab1 = FixDBManager.ConvertToDataTable(rtnobj[3] as System.Collections.ArrayList, this.dataSet1.Tables["SPM_MODE"]);
- tab1.TableName = "SPM_MODE";
- this.dataSet1.Tables["SPM_MODE"].Merge(tab1);
- }
- if (rtnobj[4] != null)
- {
- this.dataSet1.Tables["SPM_WET_SYSTEM"].Clear();
- System.Data.DataTable tab1 = FixDBManager.ConvertToDataTable(rtnobj[4] as System.Collections.ArrayList, this.dataSet1.Tables["SPM_WET_SYSTEM"]);
- tab1.TableName = "SPM_WET_SYSTEM";
- this.dataSet1.Tables["SPM_WET_SYSTEM"].Merge(tab1);
- }
- }
- this.dataSet1.Tables["TAB_PULL"].Rows.Add(new string[] { "0", "否" });
- this.dataSet1.Tables["TAB_PULL"].Rows.Add(new string[] { "1", "是" });
- this.dataSet1.Tables["TAB_PULL"].AcceptChanges();
- }
- catch (System.Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- }
- }
- private void Get_ReelPlan_Info()
- {
- try
- {
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "UIF.UIF06.UIF061070";
- ccp.MethodName = "Get_SCoilData";
- CoreClientParam obj = this.ExecuteQuery(ccp, CoreInvokeType.Internal);
- if (obj.ReturnInfo.Length == 0)
- {
- this.dataSet1.Tables["TAB_CALINFO"].Clear();
- System.Data.DataTable tab0 = FixDBManager.ConvertToDataTable(obj.ReturnObject as System.Collections.ArrayList, this.dataSet1.Tables["TAB_CALINFO"]);
- tab0.TableName = "TAB_CALINFO";
- this.dataSet1.Tables["TAB_CALINFO"].Merge(tab0);
- this.dataSet1.AcceptChanges();
- }
- }
- catch (System.Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- }
- }
- private void Get_ReelPlan_List()//查询计划缓存表
- {
- try
- {
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "UIF.UIF06.UIF061070";
- ccp.MethodName = "Get_DCLData";
- CoreClientParam obj = this.ExecuteQuery(ccp, CoreInvokeType.Internal);
- if (obj.ReturnInfo.Length == 0)
- {
- this.dataSet1.Tables["TAB_CALLIST"].Clear();
- System.Data.DataTable tab0 = FixDBManager.ConvertToDataTable(obj.ReturnObject as System.Collections.ArrayList, this.dataSet1.Tables["TAB_CALLIST"]);
- tab0.TableName = "TAB_CALLIST";
- this.dataSet1.Tables["TAB_CALLIST"].Merge(tab0);
- this.dataSet1.AcceptChanges();
- }
- }
- catch (System.Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- }
- }
- public override void ToolBar_Click(object sender, string ToolbarKey)
- {
- try
- {
- switch (ToolbarKey)
- {
- case "Query":
- this.dataSet1.Tables["TAB_CCOILLIST"].Clear();
- Query("");
- Get_ReelPlan_List();
- break;
- case "Add":
- Add();
- break;
- case "Delete":
- Delete();
- break;
- case "Save":
- Save();
- break;
- case "Merge":
- Merge();
- break;
- case "Up":
- Up();
- break;
- case "Down":
- Down();
- break;
- case "CMerge":
- CMerge();
- break;
- case "Exit":
- this.dataSet1.Dispose();
- this.dataSet1 = null;
- this.Close();
- break;
- }
- }
- catch (System.Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- }
- }
- private void Query(string where)//查询原料表(可编制原料信息)
- {
- try
- {
- string Condition = GetCondition(where);
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "UIF.UIF06.UIF061070";
- ccp.MethodName = "Get_SCoilData";
- 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_CCOILLIST"]);
- tab0.TableName = "TAB_CCOILLIST";
- this.dataSet1.Tables["TAB_CCOILLIST"].Merge(tab0);
- this.dataSet1.AcceptChanges();
- }
- }
- catch (System.Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- }
- }
- private void Add()
- {
- try
- {
- this.ugrd_CoilList.UpdateData();
- System.Data.DataRow[] rows = this.dataSet1.Tables["TAB_CCOILLIST"].Select("FLAG='TRUE'");
- if (rows.Length == 0)
- {
- MessageBox.Show("您还未选择酸轧卷,请选择");
- return;
- }
- string CoilNOS = "";
- string ex = "";
- for (int i = 0; i < this.ugrd_CoilList.Rows.Count; i++)
- {
- if (Common.FixDBManager.CheckNullStr(ugrd_CoilList.Rows[i].Cells["FLAG"].Value).ToUpper() == "TRUE")
- {
- CoilNOS = CoilNOS + ugrd_CoilList.Rows[i].Cells["COIL_NO"].Value.ToString() + ";";
- }
- }
- CoilNOS = CoilNOS.Substring(0, CoilNOS.Length - 1);
- string paras = "";
- if (Common.FixDBManager.CheckNullStr(this.Cmb_Sleeve.Value).Length > 0)
- paras = Common.FixDBManager.CheckNullStr(this.Cmb_Sleeve.Value);
-
- paras += ";";
- if (Common.FixDBManager.CheckNullStr(this.Cmb_Pull.Value).Length > 0)
- paras += Common.FixDBManager.CheckNullStr(this.Cmb_Pull.Value);
-
- paras += ";";
- paras += this.txt_CALMemo.Text;
- string paran = "1";
- Hashtable paramHsmp = new Hashtable();
- paramHsmp.Add("i1", CoilNOS);
- paramHsmp.Add("i2", rows.Length.ToString());
- paramHsmp.Add("i3", paran);
- paramHsmp.Add("o4", ex);
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "UIB.COM.ComDBProcedure";
- ccp.MethodName = "doXmlProcedure";
- ccp.ServerParams = new Object[] { "UIF061070.Add", 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
- {
- this.dataSet1.Tables["TAB_CCOILLIST"].Clear();
- Query("");
- Get_ReelPlan_List();
- }
- }
- catch (System.Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- }
- }
- private void Delete()
- {
- try
- {
- if (this.ugrd_CalList.Selected.Rows.Count == 0)
- {
- MessageBox.Show("请选择您要移除的记录");
- return;
- }
- string RollNO = this.ugrd_CalList.Rows[0].Cells["CAL_NO"].Value.ToString();
- string CoilNOS = "";
- string Condition = "";
- foreach (Infragistics.Win.UltraWinGrid.UltraGridRow row in this.ugrd_CalList.Selected.Rows)
- {
- CoilNOS = CoilNOS + Common.FixDBManager.CheckNullStr(row.Cells["C_COIL_NO"].Value) + ";";
- Condition = Condition + "'" + Common.FixDBManager.CheckNullStr(row.Cells["C_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_CalList.Selected.Rows.Count.ToString());
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "UIB.COM.ComDBProcedure";
- ccp.MethodName = "doXmlProcedure";
- ccp.ServerParams = new Object[] { "UIF061070.Del_HotPlan", 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
- {
- this.dataSet1.Tables["TAB_CCOILLIST"].Clear();
- //Get_ReelPlan_Info();
- Get_ReelPlan_List();
- Query("");
- }
- }
- catch (System.Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- }
- }
- private void Up()
- {
- try
- {
- if (this.ugrd_CalList.Selected.Rows.Count == 0)
- {
- MessageBox.Show("请确定您要前移的酸轧卷");
- return;
- }
- string ex = "";
- string Index_ = "";
- string RollNO = this.ugrd_CalList.Rows[0].Cells["CAL_NO"].Value.ToString();
- System.Collections.ArrayList HCoil_ary = new ArrayList();
- foreach (Infragistics.Win.UltraWinGrid.UltraGridRow row in this.ugrd_CalList.Selected.Rows)
- {
- Index_ = Index_ + Common.FixDBManager.CheckNullStr(row.Cells["COIL_EDT_SEQ"].Value) + ";";
- HCoil_ary.Add(row.Cells["C_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_CalList.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[] { "UIF061050.Adj_HotPlan", 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_ReelPlan_Info();
- Get_ReelPlan_List();
- ReSet_SelectRow(HCoil_ary);
- }
- }
- }
- catch (System.Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- }
- }
- private void Down()
- {
- try
- {
- if (this.ugrd_CalList.Selected.Rows.Count == 0)
- {
- MessageBox.Show("请确定您要前移的酸轧卷");
- return;
- }
- string ex = "";
- string Index_ = "";
- string RollNO = this.ugrd_CalList.Rows[0].Cells["CAL_NO"].Value.ToString();
- System.Collections.ArrayList HCoil_ary = new ArrayList();
- foreach (Infragistics.Win.UltraWinGrid.UltraGridRow row in this.ugrd_CalList.Selected.Rows)
- {
- Index_ = Index_ + Common.FixDBManager.CheckNullStr(row.Cells["COIL_EDT_SEQ"].Value) + ";";
- HCoil_ary.Add(row.Cells["C_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_CalList.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[] { "UIF061050.Adj_HotPlan", 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_ReelPlan_Info();
- Get_ReelPlan_List();
- ReSet_SelectRow(HCoil_ary);
- }
- }
- }
- catch (System.Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- }
- }
- private void Save()
- {
- try
- {
- string chk_flag = "00000";
- string RollNO = this.ugrd_CalList.Rows[0].Cells["CAL_NO"].Value.ToString();
- //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[] { "UIF061050.Affirm_SuanPlan", 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_ReelPlan_Info();
- Get_ReelPlan_List();
- }
- }
- catch (System.Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- }
- }
- private void Merge()
- {
- try
- {
- if (this.ugrd_CalList.Selected.Rows.Count == 0)
- {
- MessageBox.Show("请确定您要并卷的酸轧卷");
- return;
- }
- string Index_ = "";
- string HCoilNOS = "";
- string ex = "";
- string RollNO = this.ugrd_CalList.Rows[0].Cells["CAL_NO"].Value.ToString();
- System.Collections.ArrayList HCoil_ary = new ArrayList();
- foreach (Infragistics.Win.UltraWinGrid.UltraGridRow row in this.ugrd_CalList.Selected.Rows)
- {
- Index_ = Index_ + Common.FixDBManager.CheckNullStr(row.Cells["COIL_EDT_SEQ"].Value) + ";";
- HCoilNOS = HCoilNOS + Common.FixDBManager.CheckNullStr(row.Cells["C_COIL_NO"].Value) + ";";
- HCoil_ary.Add(row.Cells["C_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_CalList.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[] { "UIF061070.Merge_CalPlan", 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_ReelPlan_Info();
- Get_ReelPlan_List();
- ReSet_SelectRow(HCoil_ary);
- }
- }
- }
- catch (System.Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- }
- }
- private void CMerge()
- {
- try
- {
- if (this.ugrd_CalList.Selected.Rows.Count == 0)
- {
- MessageBox.Show("请确定您要并卷的基料卷");
- return;
- }
- string Index_ = "";
- string HCoilNOS = "";
- string RollNO = this.ugrd_CalList.Rows[0].Cells["CAL_NO"].Value.ToString();
- System.Collections.ArrayList HCoil_ary = new ArrayList();
- foreach (Infragistics.Win.UltraWinGrid.UltraGridRow row in this.ugrd_CalList.Selected.Rows)
- {
- Index_ = Index_ + Common.FixDBManager.CheckNullStr(row.Cells["COIL_EDT_SEQ"].Value) + ";";
- HCoilNOS = HCoilNOS + Common.FixDBManager.CheckNullStr(row.Cells["C_COIL_NO"].Value) + ";";
- HCoil_ary.Add(row.Cells["C_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_CalList.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[] { "UIF061070.CMerge_CalPlan", 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_ReelPlan_Info();
- Get_ReelPlan_List();
- ReSet_SelectRow(HCoil_ary);
- }
- }
- }
- catch (System.Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- }
- }
- private string GetCondition(string InitCondition)
- {
- try
- {
- if (InitCondition.Length > 0)
- return InitCondition;
- string Condition = "";
- string tmp = "";
- if (FixDBManager.CheckNullStr(this.Cmb_BM.Text).Length > 0)
- {
- foreach (Infragistics.Win.UltraWinGrid.UltraGridRow row in this.Cmb_BM.CheckedRows)
- {
- tmp += "'" + row.Cells["SM_CD"].Value.ToString() + "',";
- }
- tmp = tmp.Substring(0, tmp.Length - 1);
- Condition += " AND B.C_EXTSHAPE_REQ IN(" + tmp + ") ";
- }
- if (FixDBManager.CheckNullStr(this.Cmb_PM.Text).Length > 0)
- {
- tmp = "";
- foreach (Infragistics.Win.UltraWinGrid.UltraGridRow row in this.Cmb_PM.CheckedRows)
- {
- tmp += "'" + row.Cells["SM_CD"].Value.ToString() + "',";
- }
- tmp = tmp.Substring(0, tmp.Length - 1);
- Condition += " AND B.PRODNM_CD IN(" + tmp + ") ";
- }
- string[] height = txt_Height.Text.Split('~');
- string min_height = height[0].Replace(" ", "");
- min_height = min_height == "." ? "0" : min_height;
- string max_height = height[1].Replace(" ", "");
- max_height = max_height == "." ? "99" : max_height;
- Condition += " AND B.C_ORD_THK BETWEEN " + min_height + " AND " + max_height;
- string[] width = txt_Width.Text.Split('~');
- string min_width = width[0].Replace(" ", "").Length == 0 ? "0" : width[0];
- string max_width = width[1].Replace(" ", "").Length == 0 ? "1500" : width[1];
- Condition += " AND B.C_ORD_WTH BETWEEN " + min_width + " AND " + max_width;
- string[] senddate = mtx_SendDate.Text.Split('~');
- string min_senddate = senddate[0].Replace(" ", "") == "--" ? "2010-01-01" : senddate[0];
- string max_senddate = senddate[1].Replace(" ", "") == "--" ? "2099-01-01" : senddate[1];
- Condition += " AND B.DEL_TO_DATE BETWEEN TO_CHAR(TO_DATE('" + min_senddate + "','YYYY-MM-DD'),'YYYYMMDD') "
- + " AND TO_CHAR(TO_DATE('" + max_senddate + "','YYYY-MM-DD'),'YYYYMMDD') ";
- return Condition;
- }
- catch (System.Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- return "";
- }
- }
- 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_CalList.Rows)
- {
- if (HCoil_ary.Contains(row.Cells["C_COIL_NO"].Value))
- {
- row.Selected = true;
- }
- }
- }
- 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_CALLIST"].Rows)
- {
- if (err_hsb.Contains(row["C_COIL_NO"].ToString()))
- {
- string err_Info = "";
- System.Collections.ArrayList err_lst = err_hsb[row["C_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_CALLIST"].Columns["COIL_EDT_SEQ"], err_Info);
- }
- }
- }
- catch (System.Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- }
- }
- }
- }
|