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.UIM { public partial class UIM010170 : FrmBase { private int OUT_TYPE = 1;//出库类型,默认为上料出库 public UIM010170() { 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() { try { this.dataSet1.Tables[0].Clear(); string coilNo = textBox3.Text.Trim(); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "UIM.UIM010170"; if (ultraComboEditor1.SelectedIndex < 1) { OUT_TYPE = 1; this.ultraComboEditor2.Enabled = true; ccp.MethodName = "queryMillPlan"; ccp.ServerParams = new object[] { coilNo }; } else { //退废出库类型为2 ,退回类型为3 OUT_TYPE = ultraComboEditor1.SelectedIndex == 1 ? 2 : 3; this.ultraComboEditor2.Enabled = false; ccp.MethodName = "queryOutCoil"; ccp.ServerParams = new object[] { coilNo }; } ccp.SourceDataTable = this.dataSet1.Tables[0]; this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); this.ultraButton1.Enabled = true; } catch (Exception EX) { MessageBox.Show(EX.ToString()); } } /// /// 中间库出库 /// private void DoSave() { try { if (this.ultraGrid1.Selected.Rows.Count < 1) { MessageBox.Show("请选择需要出库的钢卷!"); } string coilNo = this.ultraGrid1.Selected.Rows[0].Cells["COIL_NO"].Text; string regID = this.UserInfo.GetUserID();//出库人 string trnfShift = "A";//出库班次 string trnfGroup = "1";//出库班组 string trnfDtime = this.ultraDateTimeEditor1.DateTime.ToString("yyyyMMddHHmmss");//出库时间 string trnfRemark = this.ultraComboEditor2.Enabled ? this.ultraComboEditor2.Value.ToString() : "";//出库去向 CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "UIM.UIM010170"; ccp.MethodName = "saveCoilOut"; ccp.ServerParams = new object[] { OUT_TYPE, coilNo, regID, trnfShift, trnfGroup, trnfDtime, trnfRemark }; ccp.SourceDataTable = this.dataSet1.Tables[0]; this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); } catch (Exception EX) { MessageBox.Show(EX.ToString()); } } private void UIM010170_Load(object sender, EventArgs e) { this.ultraComboEditor1.SelectedIndex = 0; this.ultraButton1.Enabled = false; this.ultraComboEditor2.SelectedIndex = 0; } } }