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 UIM010360 : FrmBase { public UIM010360() { InitializeComponent(); } //工具栏事件处理 public override void ToolBar_Click(object sender, string ToolbarKey) { switch (ToolbarKey) { case "Query": this.DoQuery(); break; case "Save": this.DoSave(); break; } } /// /// 查询待入库钢卷 /// private void DoQuery() { try { this.dataSet1.Tables[0].Clear(); string procuctedTime = ultraDateTimeEditor1.Value != null ? ultraDateTimeEditor1.DateTime.ToString("yyyyMMdd") : ""; string coilNo = this.ultraTextEditor1.Text.Trim(); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "UIM.UIM010360"; ccp.MethodName = "query"; ccp.ServerParams = new object[] { procuctedTime, coilNo }; ccp.SourceDataTable = this.dataSet1.Tables[0]; this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); } catch (Exception EX) { MessageBox.Show(EX.ToString()); } } //选框点击事件处理 private void ultraGrid1_CellChange(object sender, Infragistics.Win.UltraWinGrid.CellEventArgs e) { if (e.Cell.Column.Key == "CHK") { if (!Convert.ToBoolean(e.Cell.Value)) { for (int i = 0; i < ultraGrid1.Rows.Count; i++) { ultraGrid1.Rows[i].Cells["CHK"].Value = false; } e.Cell.Value = true; this.ultraTextEditor2.Text = e.Cell.Row.Cells["OLD_SAMPL_NO"].Value.ToString(); //yardControl1.Layer = "A"; //yardControl1.Stock = "2"; //yardControl1.Focus(); } else { e.Cell.Value = false; this.ultraTextEditor2.Text = ""; } } } //废次品入库处理 private void DoSave() { bool flag = false; for (int i = 0; i < ultraGrid1.Rows.Count; i++) { if (Convert.ToBoolean(ultraGrid1.Rows[i].Cells["CHK"].Value)) { flag = true; break; } } if (!flag) { MessageBox.Show("请选择需要入库的钢卷!"); return; } string yardAddr =this.ultraTextEditor3.Text.Trim();//垛位 try { string stock = yardAddr.Substring(0, 1); yardAddr = yardAddr.Substring(2); string row = yardAddr.Substring(0, yardAddr.IndexOf('-') - 1); if (row.Length < 2) { row = "0" + row; } string fl = yardAddr.Substring(yardAddr.IndexOf('-') - 1, 1); string col = yardAddr.Substring(yardAddr.IndexOf('-') + 1); if (col.Length < 2) { col = "0" + col; } yardAddr = stock + "-" + row + fl + "-" + col; } catch (Exception ex) { MessageBox.Show("垛位输入错误,请重新输入!"); ultraTextEditor3.Focus(); return; } string entryShift = UserInfo.GetUserOrder();//入库班次 string entryGroup = UserInfo.GetUserGroup();//入库班组 string entryDtime = this.ultraDateTimeEditor2.DateTime.ToString("yyyyMMddHHmmss");//入库时间 string reg_id = UserInfo.GetUserID();//操作人 CoreClientParam ccp2 = new CoreClientParam(); ccp2.ServerName = "UIM.UIM010360"; ccp2.MethodName = "saveCoilYard"; ccp2.ServerParams = new object[] { this.ultraTextEditor2.Text, yardAddr, entryShift, entryGroup, entryDtime, reg_id }; ccp2 = this.ExecuteNonQuery(ccp2, CoreInvokeType.Internal); if (0 == ccp2.ReturnCode) { MessageBox.Show("入库成功!"); } DoQuery(); } } }