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; namespace Core.LZMes.Client.UIJ { public partial class UIJ030021 : FrmBase { private ArrayList coils = new ArrayList(); public ArrayList Coils { get { return coils; } set { coils = value; } } private string ordNo = string.Empty; public string OrdNo { get { return ordNo; } set { ordNo = value; } } private string ordSeq = string.Empty; public string OrdSeq { get { return ordSeq; } set { ordSeq = value; } } private UIJ030020 onwer = null; public UIJ030020 ShowOnwer { get { return onwer; } set { onwer = value; } } public UIJ030021() { InitializeComponent(); } private void UIJ030021_Load(object sender, EventArgs e) { textBox1.Text = ordNo + "-" + ordSeq; DoQuery(); } private void DoQuery() { string coilNo = textBox2.Text.Trim(); string thkMin = textBox3.Text.Trim(); string thkMax = textBox4.Text.Trim(); string wthMin = textBox5.Text.Trim(); string wthMax = textBox6.Text.Trim(); this.dataSet1.Tables[0].Clear(); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "UIJ.UIJ03.UIJ030020"; ccp.MethodName = "querySameCoils"; ccp.SourceDataTable = this.dataSet1.Tables[0]; ccp.ServerParams = new Object[] { ordNo,ordSeq,coilNo,thkMin,thkMax,wthMin,wthMax }; this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); } private void label2_Click(object sender, EventArgs e) { DoQuery(); } private void label6_Click(object sender, EventArgs e) { ultraGrid1.UpdateData(); ArrayList newCoils = new ArrayList(); Infragistics.Win.UltraWinGrid.RowsCollection rs = ultraGrid1.Rows; for (int i = 0; i < rs.Count; i++) { if (Convert.ToBoolean(rs[i].Cells["CHK"].Value)) { newCoils.Add(rs[i].Cells["COIL_NO"].Value.ToString()); } } bool flag = false; if (coils.Count == newCoils.Count) { if (DialogResult.Yes == MessageBox.Show("冷轧MES", "是否确定替换钢卷?", MessageBoxButtons.YesNo)) { flag = true; } } else { if (DialogResult.Yes == MessageBox.Show("冷轧MES", "钢卷数量不相等,是否确定替换钢卷?", MessageBoxButtons.YesNo)) { flag = true; } } if (flag) { CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "UIJ.UIJ03.UIJ030020"; ccp.MethodName = "replaceCoils"; ccp.SourceDataTable = this.dataSet1.Tables[0]; ccp.ServerParams = new Object[] { coils,newCoils }; ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal); if (0 == ccp.ReturnCode) { MessageBox.Show("换卷成功!"); onwer.queryDlivDirCoil("C"); this.Close(); } } } } }