| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119 |
- 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;
- }
- }
- /// <summary>
- /// 查询中间库库存数据
- /// </summary>
- 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());
- }
- }
- /// <summary>
- /// 中间库出库
- /// </summary>
- 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;
- }
- }
- }
|