| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172 |
- 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 UIJ040040 : FrmBase
- {
- public UIJ040040()
- {
- 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.UIJ04.UIJ040040";
- 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.UIJ04.UIJ040040";
- 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;
- }
- }
- /// <summary>
- /// 发运计划回退
- /// </summary>
- 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.UIJ04.UIJ040040";
- ccp.MethodName = "returnShipDir";
- ccp.ServerParams = new Object[] { regId, list };
- ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (0 != ccp.ReturnCode)
- {
- return;
- }
- this.DoQuery();
- }
- }
- }
- private void UIJ040040_Load(object sender, EventArgs e)
- {
- }
- }
- }
|