using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Collections; using System.Windows.Forms; using CoreFS.CA06; namespace Core.LZMes.Client.UIJ { public partial class UIJ030040 : FrmBase { public UIJ030040() { InitializeComponent(); } public override void ToolBar_Click(object sender, string ToolbarKey) { switch (ToolbarKey) { case "Query": this.DoQuery(); break; case "Save": this.DoSave(); break; case "Exit": this.Close(); break; } } private void DoQuery() { if (null == this.ultraDateTimeEditor1.Value) { MessageBox.Show("发货指示的开始时间不能为空,请选择相应的发货指示开始时间!"); return; } if (null == this.ultraDateTimeEditor2.Value) { MessageBox.Show("发货指示的结束时间不能为空,请选择相应的发货指示结束时间!"); return; } if (0 > this.ultraComboEditor1.SelectedIndex) { MessageBox.Show("运输方式不能为空,请选择相应的运输方式!"); return; } string fromDate = this.ultraDateTimeEditor1.DateTime.ToString("yyyyMMdd"); string toDate = this.ultraDateTimeEditor2.DateTime.ToString("yyyyMMdd"); string dlivTp = this.ultraComboEditor1.Value.ToString(); string dlivDirNo = this.textBox3.Text.Trim(); string isCancel = "0"; this.dataSet1.Tables[0].Clear(); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "UIJ.UIJ03.UIJ030040"; ccp.MethodName = "queryDlivPlan"; ccp.ServerParams = new Object[] { fromDate, toDate, dlivTp, dlivDirNo, isCancel }; ccp.SourceDataTable = this.dataSet1.Tables[0]; this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); Infragistics.Win.UltraWinGrid.RowsCollection rs = this.ultraGrid1.Rows; for (int i = 0; i < rs.Count; i++) { rs[i].Cells["CHK"].Value = false; } } private void label3_Click(object sender, EventArgs e) { if (null == this.ultraDateTimeEditor1.Value) { MessageBox.Show("发货指示的开始时间不能为空,请选择相应的发货指示开始时间!"); return; } if (null == this.ultraDateTimeEditor2.Value) { MessageBox.Show("发货指示的结束时间不能为空,请选择相应的发货指示结束时间!"); return; } if (0 > this.ultraComboEditor1.SelectedIndex) { MessageBox.Show("运输方式不能为空,请选择相应的运输方式!"); return; } string fromDate = this.ultraDateTimeEditor1.DateTime.ToString("yyyyMMdd"); string toDate = this.ultraDateTimeEditor2.DateTime.ToString("yyyyMMdd"); string dlivTp = this.ultraComboEditor1.Value.ToString(); string dlivDirNo = this.textBox3.Text.Trim(); string isCancel = "1"; this.dataSet1.Tables[0].Clear(); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "UIJ.UIJ03.UIJ030040"; ccp.MethodName = "queryDlivPlan"; ccp.ServerParams = new Object[] { fromDate, toDate, dlivTp, dlivDirNo, isCancel }; ccp.SourceDataTable = this.dataSet1.Tables[0]; this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); Infragistics.Win.UltraWinGrid.RowsCollection rs = this.ultraGrid1.Rows; for (int i = 0; i < rs.Count; i++) { rs[i].Cells["CHK"].Value = false; } } /// /// 发运计划回退 /// private void DoSave() { string isCancel = null; ArrayList list = new ArrayList(); Infragistics.Win.UltraWinGrid.RowsCollection rs = this.ultraGrid1.Rows; for (int i = 0; i < rs.Count; i++) { if ("TRUE".Equals(rs[i].Cells["CHK"].Text.ToUpperInvariant())) { if (null == isCancel) { isCancel = rs[i].Cells["ISCANCEL"].Text; } list.Add(rs[i].Cells["DLIV_DIRNO"].Text); } } if (list.Count < 1) { MessageBox.Show("没有选中发运计划,不能进行保存操作!"); return; } else { if ("1".Equals(isCancel)) { MessageBox.Show("已经回退的计划,不能进行保存操作!"); return; } else { string regId = this.UserInfo.GetUserID(); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "UIJ.UIJ03.UIJ030040"; ccp.MethodName = "returnShipDir"; ccp.ServerParams = new Object[] { regId,list }; ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal); if (0 != ccp.ReturnCode) { return; } this.DoQuery(); } } } } }