| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231 |
- 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;
- using Infragistics.Win.UltraWinGrid;
- namespace Core.LZMes.Client.UIM
- {
- public partial class UIM010260 : FrmBase
- {
- private string COIL_NO = "";
- public UIM010260()
- {
- InitializeComponent();
- this.dteTime.DateTime = DateTime.Now;
- }
- 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
- {
- string coilNo = this.txtCoilNo.Text.Trim();
- this.dataSet1.Tables[0].Clear();
- COIL_NO = coilNo;
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "UIM.UIM010260";
- ccp.MethodName = "queryCoilInfo";
- ccp.ServerParams = new object[] { coilNo };
- ccp.SourceDataTable = this.dataSet1.Tables[0];
- this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
- if (this.ultraGrid1.Rows.Count == 0)
- {
- this.txtCoilNoOUT.Text = "查无此卷";
- this.txtCoilNoStat.Text = "";
- }
- else
- {
- this.txtCoilNoOUT.Text = this.ultraGrid1.Rows[0].Cells["CUR_LOAD_LOC"].Text;
- this.txtCoilNoStat.Text = this.ultraGrid1.Rows[0].Cells["COIL_STAT"].Text;
- }
- }
- catch (Exception EX)
- {
- MessageBox.Show(EX.ToString());
- }
- }
- /// <summary>
- /// 盘入盘出操作
- /// </summary>
- private void DoSave()
- {
- if (this.txtCoilNo.Text != this.COIL_NO)
- {
- MessageBox.Show("输入钢卷号在上次查询后已经更改; \n请再次输入确定进行操作的钢卷号,并做查询后再进行操作。");
- return;
- }
- try
- {
- if (this.dataTable1.Rows.Count < 1)
- {
- MessageBox.Show("钢卷信息不能为空,请先查询出钢卷信息再进行盘入盘出操作!");
- return;
- }
- Infragistics.Win.UltraWinGrid.RowsCollection rs = null;
- rs = this.ultraGrid1.Rows;
- string wdlivno = "";
- foreach (UltraGridRow ugr in rs)
- {
- wdlivno = rs[0].Cells["wdlivno"].Text.ToString(); //获取提货单号
- }
- string curLoadLoc = this.yardCtl.GetYardFlag();
- int type = 0;
- if (checkBox2.Checked)
- {
- type = 1;
- }
- else if(checkBox3.Checked || checkBox4.Checked)
- {
- type = 2;//外卖或者废钢
- }
- else if(!checkBox1.Checked)
- {
- MessageBox.Show("请选择盘入盘出类型!");
- return;
- }
- else if ("".Equals(curLoadLoc) && checkBox1.Checked)
- {
- MessageBox.Show("盘入操作需要垛位信息,请输入相应的垛位信息!");
- return;
- }
- else if (this.dteTime.DateTime == null)
- {
- MessageBox.Show("请选择操作时间!");
- return;
- }
- else if ("".Equals(wdlivno) && (checkBox3.Checked || checkBox4.Checked))
- {
- MessageBox.Show("外卖或者废钢提货单号不能为空!");
- return;
- }
- curLoadLoc = this.yardAnalysisForQuerry(curLoadLoc);
- string regId = this.UserInfo.GetUserID();
- string regShift = this.UserInfo.GetUserOrder();
- string regGroup = this.UserInfo.GetUserGroup();
- string coilInDtime = this.dteTime.DateTime.ToString("yyyyMMddHHmmss");
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "UIM.UIM010260";
- ccp.MethodName = "save";
- ccp.ServerParams = new object[] { type, COIL_NO, curLoadLoc, regId, regShift, regGroup, coilInDtime, wdlivno};
- ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- this.DoQuery();
- }
- catch (Exception EX)
- {
- MessageBox.Show(EX.ToString());
- }
- }
- /// <summary>
- /// 把经过上面检测后的字符串补0 转为数据库通用字符串
- /// </summary>
- /// <param name="yardIN"></param>
- /// <returns></returns>
- private string yardAnalysisForQuerry(string yardIN)
- {
- try
- {
- string[] strs = yardIN.Split('-');
- if (strs[1].Length < 3)
- {
- for (int i = strs[1].Length; i < 3; i++)
- {
- strs[1] = "0" + strs[1];
- }
- }
- if (strs[2].Length < 3)
- {
- for (int i = strs[2].Length; i < 3; i++)
- {
- strs[2] = "0" + strs[2];
- }
- }
- return strs[0] + "-" + strs[1].ToUpper() + "-" + strs[2];
- }
- catch
- {
- return "";
- }
- }
- private void checkBox1_CheckedChanged(object sender, EventArgs e)
- {
- if (this.checkBox1.Checked)
- {
- this.checkBox2.Checked = false;
- this.checkBox3.Checked = false;
- this.checkBox4.Checked = false;
- }
- }
- private void checkBox2_CheckedChanged(object sender, EventArgs e)
- {
- if (this.checkBox2.Checked)
- {
- this.checkBox1.Checked = false;
- this.checkBox3.Checked = false;
- this.checkBox4.Checked = false;
- }
- }
- private void checkBox3_CheckedChanged(object sender, EventArgs e)
- {
- if (this.checkBox3.Checked)
- {
- this.checkBox1.Checked = false;
- this.checkBox2.Checked = false;
- this.checkBox4.Checked = false;
- }
- }
- private void checkBox4_CheckedChanged(object sender, EventArgs e)
- {
- if (this.checkBox4.Checked)
- {
- this.checkBox1.Checked = false;
- this.checkBox2.Checked = false;
- this.checkBox3.Checked = false;
- }
- }
- }
- }
|