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; namespace Core.LZMes.Client.UIJ { public partial class UIJ060030 : FrmBase { public UIJ060030() { 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() { string dlivDirNo = this.textBox1.Text.Trim(); this.dataSet1.Tables[0].Clear(); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "UIJ.UIJ06.UIJ060030"; ccp.MethodName = "queryShipRetRs"; ccp.ServerParams = new Object[] { dlivDirNo }; ccp.SourceDataTable = this.dataSet1.Tables[0]; this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); } private void DoUpdate() { if (DialogResult.Yes != MessageBox.Show("请确保需要回退的数据为异常指示号!", "提示", MessageBoxButtons.YesNo)) { return; } string dlivDirNo = this.textBox1.Text.Trim(); if (dlivDirNo == "") { MessageBox.Show("指示号不能为空"); return; } CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "UIJ.UIJ06.UIJ060030"; ccp.MethodName = "update"; ccp.ServerParams = new object[] { dlivDirNo }; ccp.SourceDataTable = this.dataSet1.Tables[0]; this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); } /// /// 查询异常明细 /// private void query1() { string dlivDirNo = this.textBox1.Text.Trim(); this.dataSet1.Tables[0].Clear(); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "UIJ.UIJ06.UIJ060030"; ccp.MethodName = "queryShipRetRsNoCarNo"; ccp.ServerParams = new Object[] { dlivDirNo }; ccp.SourceDataTable = this.dataSet1.Tables[0]; this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); } /// /// 明细回退 /// private void DoSave() { string dlivDirNo = ""; DataRowCollection drs = this.dataSet1.Tables[0].Rows; if (drs.Count < 1) { MessageBox.Show("没有查询到可以回退的发运明细,请确认后再进行回退操作!"); return; } dlivDirNo = drs[0]["DLIV_DIRNO"].ToString(); String regId = this.UserInfo.GetUserID(); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "UIJ.UIJ06.UIJ060030"; ccp.MethodName = "returnShipResult"; ccp.ServerParams = new Object[] { dlivDirNo, regId }; ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal); if (ccp.ReturnCode != 0) return; this.DoQuery(); } private void label2_Click(object sender, EventArgs e) { this.query1(); } private void button1_Click(object sender, EventArgs e) { this.DoUpdate(); } } }