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; namespace Core.LZMes.Client.UIK { public partial class UIK050020 : FrmBase { public UIK050020() { InitializeComponent(); } public override void ToolBar_Click(object sender, string ToolbarKey) { switch (ToolbarKey) { case "Query": this.DoQuery(); break; } } private void DoQuery() { try { string zgNum = ""; string zgAr = ""; string beginTime = ""; string endTime = ""; bool flag = false; CoreClientParam ccp = new CoreClientParam(); CoreClientParam ccp2 = new CoreClientParam(); //if (this.zgNumber.Text == "" && this.zgArea.Text == "" && this.ultraCheckEditor1.Checked == false) //{ // MessageBox.Show("请选择查询条件!"); //} //else //{ if (this.ultraCheckEditor1.Checked) { this.dataSet1.Tables[0].Clear(); this.dataSet2.Tables[0].Clear(); this.zgArea.Clear(); this.zgNumber.Clear(); this.ultraCheckEditor1.Checked = false; ccp.ServerName = "UIK.UIK05.UIK050020"; ccp.MethodName = "DoQueryShang"; ccp.ServerParams = new object[] { zgNum, zgAr, flag ,beginTime,endTime}; ccp.SourceDataTable = this.dataSet1.Tables[0]; this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); DataRowCollection drc1 = this.dataSet1.Tables[0].Rows; ccp2.ServerName = "UIK.UIK05.UIK050020"; ccp2.MethodName = "DoQueryXia"; ccp2.ServerParams = new object[] { zgNum, zgAr, flag, beginTime, endTime }; ccp2.SourceDataTable = this.dataSet2.Tables[0]; this.ExecuteQueryToDataTable(ccp2, CoreInvokeType.Internal); DataRowCollection drc2 = this.dataSet2.Tables[0].Rows; if (drc1.Count <= 0) { MessageBox.Show("暂无记录!"); } return; } else { flag = true; if (this.zgArea.Text == "" || this.zgNumber.Text == "") { if (this.zgNumber.Text == "") { this.dataSet1.Tables[0].Clear(); this.dataSet2.Tables[0].Clear(); zgAr = this.zgArea.Text; beginTime = ultraDateTimeEditor1.Value != null ? ultraDateTimeEditor1.DateTime.ToString("yyyyMMdd000000") : ""; endTime = ultraDateTimeEditor2.Value != null ? ultraDateTimeEditor2.DateTime.ToString("yyyyMMdd999999") : ""; this.zgArea.Clear(); this.zgNumber.Clear(); this.ultraCheckEditor1.Checked = false; ccp.ServerName = "UIK.UIK05.UIK050020"; ccp.MethodName = "DoQueryShang"; ccp.ServerParams = new object[] { zgNum, zgAr, flag, beginTime, endTime }; ccp.SourceDataTable = this.dataSet1.Tables[0]; this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); DataRowCollection drc1 = this.dataSet1.Tables[0].Rows; ccp2.ServerName = "UIK.UIK05.UIK050020"; ccp2.MethodName = "DoQueryXia"; ccp2.ServerParams = new object[] { zgNum, zgAr, flag, beginTime, endTime }; ccp2.SourceDataTable = this.dataSet2.Tables[0]; this.ExecuteQueryToDataTable(ccp2, CoreInvokeType.Internal); DataRowCollection drc2 = this.dataSet2.Tables[0].Rows; if (drc1.Count <= 0) { MessageBox.Show("该区域的记录不存在!"); } return; } if (this.zgArea.Text == "") { this.dataSet1.Tables[0].Clear(); this.dataSet2.Tables[0].Clear(); zgNum = this.zgNumber.Text; beginTime = ultraDateTimeEditor1.Value != null ? ultraDateTimeEditor1.DateTime.ToString("yyyyMMdd000000") : ""; endTime = ultraDateTimeEditor2.Value != null ? ultraDateTimeEditor2.DateTime.ToString("yyyyMMdd999999") : ""; this.zgArea.Clear(); this.zgNumber.Clear(); this.ultraCheckEditor1.Checked = false; ccp.ServerName = "UIK.UIK05.UIK050020"; ccp.MethodName = "DoQueryShang"; ccp.ServerParams = new object[] { zgNum, zgAr, flag, beginTime, endTime }; ccp.SourceDataTable = this.dataSet1.Tables[0]; this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); DataRowCollection drc1 = this.dataSet1.Tables[0].Rows; ccp2.ServerName = "UIK.UIK05.UIK050020"; ccp2.MethodName = "DoQueryXia"; ccp2.ServerParams = new object[] { zgNum, zgAr, flag, beginTime, endTime }; ccp2.SourceDataTable = this.dataSet2.Tables[0]; this.ExecuteQueryToDataTable(ccp2, CoreInvokeType.Internal); DataRowCollection drc2 = this.dataSet2.Tables[0].Rows; if (drc1.Count <= 0) { MessageBox.Show("该轧辊顺序号记录不存在,请查证后查询!"); } return; } } if (this.zgArea.Text == "" && this.zgNumber.Text == "") { beginTime = ultraDateTimeEditor1.Value != null ? ultraDateTimeEditor1.DateTime.ToString("yyyyMMdd000000") : ""; endTime = ultraDateTimeEditor2.Value != null ? ultraDateTimeEditor2.DateTime.ToString("yyyyMMdd999999") : ""; this.zgArea.Clear(); this.zgNumber.Clear(); this.ultraCheckEditor1.Checked = false; ccp.ServerName = "UIK.UIK05.UIK050020"; ccp.MethodName = "DoQueryShang"; ccp.ServerParams = new object[] { zgNum, zgAr, flag, beginTime, endTime }; ccp.SourceDataTable = this.dataSet1.Tables[0]; this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); DataRowCollection drc1 = this.dataSet1.Tables[0].Rows; ccp2.ServerName = "UIK.UIK05.UIK050020"; ccp2.MethodName = "DoQueryXia"; ccp2.ServerParams = new object[] { zgNum, zgAr, flag, beginTime, endTime }; ccp2.SourceDataTable = this.dataSet2.Tables[0]; this.ExecuteQueryToDataTable(ccp2, CoreInvokeType.Internal); DataRowCollection drc2 = this.dataSet1.Tables[0].Rows; if (drc1.Count <= 0) { MessageBox.Show("记录不存在,请查证后查询!"); } return; } else { this.dataSet1.Tables[0].Clear(); this.dataSet2.Tables[0].Clear(); zgNum = this.zgNumber.Text; zgAr = this.zgArea.Text; beginTime = ultraDateTimeEditor1.Value != null ? ultraDateTimeEditor1.DateTime.ToString("yyyyMMdd000000") : ""; endTime = ultraDateTimeEditor2.Value != null ? ultraDateTimeEditor2.DateTime.ToString("yyyyMMdd999999") : ""; this.zgArea.Clear(); this.zgNumber.Clear(); this.ultraCheckEditor1.Checked = false; ccp.ServerName = "UIK.UIK05.UIK050020"; ccp.MethodName = "DoQueryShang"; ccp.ServerParams = new object[] { zgNum, zgAr, flag, beginTime, endTime }; ccp.SourceDataTable = this.dataSet1.Tables[0]; this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); DataRowCollection drc1 = this.dataSet1.Tables[0].Rows; ccp2.ServerName = "UIK.UIK05.UIK050020"; ccp2.MethodName = "DoQueryXia"; ccp2.ServerParams = new object[] { zgNum, zgAr, flag, beginTime, endTime }; ccp2.SourceDataTable = this.dataSet2.Tables[0]; this.ExecuteQueryToDataTable(ccp2, CoreInvokeType.Internal); DataRowCollection drc2 = this.dataSet2.Tables[0].Rows; if (drc1.Count <= 0) { MessageBox.Show("记录不存在,请查证后查询!"); } return; } } } // } catch(Exception Ex) { MessageBox.Show(Ex.ToString()); } } //if (this.ultraCheckEditor1.Checked) //{ // ccp.ServerName = "UIK.UIK05.UIK050020"; // ccp.MethodName = "DoQueryShang"; // ccp.ServerParams = new object[] { zgNum, zgAr, flag }; // ccp.SourceDataTable = dt; // this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); // this.ultraGrid1.DataSource = dt; //} //else //{ // flag = "1"; // if() //} // // string zgNum = this.zgNumber.Text; // string zgAr = this.zgArea.Text; // DataTable dt = new DataTable(); // DataTable dt2 = new DataTable(); // CoreClientParam ccp = new CoreClientParam(); // ccp.ServerName = "UIK.UIK05.UIK050020"; // ccp.MethodName = "DoQueryShang"; // ccp.ServerParams = new object[] { zgNum, zgAr, startTime ,endTime}; // ccp.SourceDataTable = dt; // this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); // this.ultraGrid1.DataSource = dt; // private void UIK050020_Load(object sender, EventArgs e) { } private void ultraCheckEditor1_CheckedChanged(object sender, EventArgs e) { try { if (this.ultraCheckEditor1.Checked) { this.zgNumber.Enabled = false; this.zgArea.Enabled = false; } if (!this.ultraCheckEditor1.Checked) { this.zgNumber.Enabled = true; this.zgArea.Enabled = true; } } catch (Exception Ex) { MessageBox.Show(Ex.ToString()); } } //private void ultraGrid1_AfterRowActivate(object sender, EventArgs e) //{ // Infragistics.Win.UltraWinGrid.UltraGridRow row = this.ultraGrid2.ActiveRow; // if (this.ultraGrid1.ActiveRow.Cells["SPEC_NO"].Text == row.Cells["SPEC_NO"].Text) // { // ////int i = this.ultraGrid1.ActiveRow.Index; // //row.Cells["SPEC_NO"].Text // //this.ultraGrid2.cell2 // } //} } }