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 System.Collections; using Infragistics.Win.UltraWinGrid; namespace Core.LZMes.Client.UIB { public partial class UIB100204 : FrmBase { public UIB100204() { InitializeComponent(); } public override void ToolBar_Click(object sender, string ToolbarKey) { switch (ToolbarKey) { case "Query": this.DoQuery(); break; case "Save": this.DoSave(); break; } } public void DoQuery() { try { //string strLine = null; string strProc = null; ArrayList al = new ArrayList(); if (this.comboBox1.Text == "热轧") { //strLine = "R"; if (this.checkBox2.Checked) { al.Add("UIB100204_02_02.SELECT"); if (this.ultraDateTimeEditor1.Text == "" || this.ultraDateTimeEditor2.Text == "") { MessageBox.Show("请选择时间", "提示"); return; } } else { al.Add("UIB100204_02_01.SELECT"); } } else if (this.comboBox1.Text == "连退") { //strLine = "L"; if (this.checkBox2.Checked) { al.Add("UIB100204_01_02.SELECT"); if (this.ultraDateTimeEditor1.Text == "" || this.ultraDateTimeEditor2.Text == "") { MessageBox.Show("请选择时间", "提示"); return; } } else { al.Add("UIB100204_01_01.SELECT"); } } else if (this.comboBox1.Text == "酸洗") { //strLine = "L"; if (this.checkBox2.Checked) { al.Add("UIB100204_03_02.SELECT"); if (this.ultraDateTimeEditor1.Text == "" || this.ultraDateTimeEditor2.Text == "") { MessageBox.Show("请选择时间", "提示"); return; } } else { al.Add("UIB100204_03_01.SELECT"); } } else { MessageBox.Show("请选择产线", "提示"); return; } if (this.comboBox2.Text == "") { MessageBox.Show("请选择试样进程状态", "提示"); return; } OperateConditionRecode.WriteCondition("UIB100204_1", this.comboBox1.Text.ToString()); OperateConditionRecode.WriteCondition("UIB100204_2", this.comboBox2.Text.ToString()); strProc = this.comboBox2.Text == "全部(ALL)"?"": this.comboBox2.Text.Substring(7, 1); // al.Add(strLine); al.Add(strProc); //批号 if (this.textBox1.Text == "") { al.Add(""); al.Add(""); } else { al.Add(this.textBox1.Text.Trim()); if (this.textBox2.Text.Trim() == "") { al.Add(this.textBox1.Text.Trim()); } else { al.Add(this.textBox2.Text.Trim()); } } //时间 if (this.checkBox2.Checked) { al.Add(this.ultraDateTimeEditor1.DateTime.ToString("yyyyMMdd") + "000000"); al.Add(this.ultraDateTimeEditor2.DateTime.ToString("yyyyMMdd") + "999999"); } this.dataSet1.Tables[0].Clear(); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "UIB.COM.ComDBQuery"; ccp.MethodName = "doSimpleQuery"; ccp.ServerParams = new object[] { al }; ccp.SourceDataTable = this.dataSet1.Tables[0]; this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); foreach (UltraGridRow ugr in this.ultraGrid1.Rows) { if (ugr.Cells["SMP_PROG_CD"].Text == "试样入库待机") { ugr.RowSelectorAppearance.BackColor = Color.Red; } } } catch (Exception ex) { } } public void DoSave() { try { if (MessageBox.Show("确定入库?", "提示", MessageBoxButtons.OKCancel) == DialogResult.Cancel) return; ArrayList al = new ArrayList(); ArrayList list = null; foreach (UltraGridRow ugr in this.ultraGrid1.Rows) { if (ugr.Cells["SMP_PROG_CD"].Text == "试样入库待机" && ugr.Cells["CHK"].Text == "True") { //更新进程状态 list = new ArrayList(); list.Add("UIB100204_01.UPDATE"); list.Add(this.UserInfo.GetUserName()); list.Add(ugr.Cells["SMP_NO"].Text); list.Add(ugr.Cells["SMP_CUT_LOC"].Text); al.Add(list); //更新接口状态MSG_FLAG从1到N list = new ArrayList(); list.Add("UIB100204_02.UPDATE"); list.Add(ugr.Cells["SMP_NO"].Text); list.Add(ugr.Cells["SMP_CUT_LOC"].Text); al.Add(list); } } if (al.Count == 0) return; CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "UIB.COM.ComDBSave"; ccp.MethodName = "doXmlSave"; ccp.ServerParams = new object[] { al }; this.ExecuteNonQuery(ccp , CoreInvokeType.Internal); this.DoQuery(); } catch (Exception ex) { } } private void checkBox1_CheckedChanged(object sender, EventArgs e) { try { foreach (UltraGridRow ugr in this.ultraGrid1.Rows) { ugr.Cells["CHK"].Value = this.checkBox1.Checked; ugr.Update(); } } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); } } private void UIB100204_Load(object sender, EventArgs e) { try { this.comboBox1.Text = OperateConditionRecode.ReadCondition("UIB100204_1"); this.comboBox2.Text = OperateConditionRecode.ReadCondition("UIB100204_2"); this.ultraDateTimeEditor1.Enabled = false; this.ultraDateTimeEditor2.Enabled = false; } catch (Exception EX) { } } private void checkBox2_CheckedChanged(object sender, EventArgs e) { if (this.checkBox2.Checked) { this.ultraDateTimeEditor1.Enabled = true; this.ultraDateTimeEditor2.Enabled = true; } else { this.ultraDateTimeEditor1.Enabled = false; this.ultraDateTimeEditor2.Enabled = false; } } } }