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 { public partial class UIF052010 : CoreFS.CA06.FrmBase { public UIF052010() { InitializeComponent(); } #region "Init" private void UIF052010_Load(object sender, EventArgs e) { try { Get_BaseData(); Get_CALPlan_Info(); Get_CALPlan_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.UIF05.UIF052010"; ccp.MethodName = "Query_BaseData"; 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_CALPlan_Info() { try { CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "UIF.UIF05.UIF052010"; ccp.MethodName = "Query_CAL_Data"; 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_CALPlan_List() { try { CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "UIF.UIF05.UIF052010"; ccp.MethodName = "Query_CAL_List"; 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()); } } #endregion #region "ToolBar Event" public override void ToolBar_Click(object sender, string ToolbarKey) { try { switch (ToolbarKey) { case "Query": this.dataSet1.Tables["TAB_CCOILLIST"].Clear(); Query(""); break; case "Add": Add(); break; case "Delete": Delete(); break; case "Up": Up(); break; case "Down": Down(); break; case "Save": Save(); break; case "Merge": Merge(); 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.UIF05.UIF052010"; ccp.MethodName = "Query_CAL_Coil"; 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); if (Common.FixDBManager.CheckNullStr(this.Cmb_SPMMode.Value).Length > 0) paras = paras + ";" + Common.FixDBManager.CheckNullStr(this.Cmb_SPMMode.Value); else { MessageBox.Show("请选择平整模式!"); Cmb_SPMMode.Focus(); return; } if (Common.FixDBManager.CheckNullStr(this.Cmb_SPM_WET.Value).Length > 0) paras = paras + ";" + Common.FixDBManager.CheckNullStr(this.Cmb_SPM_WET.Value); else { MessageBox.Show("请选择湿平标识!"); Cmb_SPM_WET.Focus(); return; } if (Common.FixDBManager.CheckNullStr(this.Cmb_Pull.Value).Length > 0) paras = paras + ";" + Common.FixDBManager.CheckNullStr(this.Cmb_Pull.Value); else { MessageBox.Show("请选择是否拉矫!"); Cmb_Pull.Focus(); return; } paras = paras + ";" + this.txt_CALMemo.Text; string paran = "5"; Hashtable paramHsmp = new Hashtable(); paramHsmp.Add("i1", CoilNOS); paramHsmp.Add("i2", rows.Length.ToString()); paramHsmp.Add("i3", paras); paramHsmp.Add("i4", paran); paramHsmp.Add("o5", ex); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "UIB.COM.ComDBProcedure"; ccp.MethodName = "doXmlProcedure"; ccp.ServerParams = new Object[] { "UIF052010.Add_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_CALPlan_Info(); Get_CALPlan_List(); for (int i = rows.Length - 1; i >= 0; i--) { this.dataSet1.Tables["TAB_CCOILLIST"].Rows.Remove(rows[i]); } this.dataSet1.Tables["TAB_CCOILLIST"].AcceptChanges(); } } 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[] { "UIF052010.Del_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_CALPlan_Info(); Get_CALPlan_List(); Query(Condition); } } 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[] { "UIF052010.Adj_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_CALPlan_Info(); Get_CALPlan_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[] { "UIF052010.Adj_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_CALPlan_Info(); Get_CALPlan_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[] { "UIF052010.Affirm_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); if (err.Count > 1 && Common.FixDBManager.CheckNullStr(err[1]) != "1") { string[] err_Coil = Common.FixDBManager.CheckNullStr(err[1]).Split('#'); SetDataErrorRow(err_Coil); } } else { Get_CALPlan_Info(); Get_CALPlan_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[] { "UIF052010.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_CALPlan_Info(); Get_CALPlan_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[] { "UIF052010.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_CALPlan_Info(); Get_CALPlan_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()); } } #endregion } }