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 UAS_MES_NEW.DataOperate; using UAS_MES_NEW.Entity; using UAS_MES_NEW.PublicMethod; namespace UAS_MES_NEW.Special { public partial class Special_BoxUpdate : Form { DataHelper dh; DataTable Dbfind; LogStringBuilder sql = new LogStringBuilder(); public Special_BoxUpdate() { InitializeComponent(); } private void Special_BoxSplit_Load(object sender, EventArgs e) { dh = SystemInf.dh; lockCheckBox1.GetMakeCodeCtl(US_ID); US_ID.SetLockCheckBox(lockCheckBox1); US_ID.TableName = "upcsku"; US_ID.SelectField = "US_ID # ID,US_PRODUCTCOLOR # PRODUCT_COLOR,US_COLORCODE # 颜色号,US_SKU # SKU,US_UPC # UPC,US_LOCATION # 出货地"; US_ID.FormName = Name; US_ID.SetValueField = new string[] { "US_ID", "US_SKU", "US_PRODUCTCOLOR", "US_COLORCODE", "US_UPC", "US_LOCATION" }; US_ID.Condition = "1=1"; US_ID.DbChange += US_SKU_DbChange; } private void US_SKU_DbChange(object sender, EventArgs e) { Dbfind = US_ID.ReturnData; BaseUtil.SetFormValue(this.Controls, Dbfind); } private void Split_Click(object sender, EventArgs e) { } private void Pallate_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { DataTable dt; if (boxcode.Text == "" || US_ID.Text == "") { OperatResult.AppendText(">>箱号与US_ID均不可为空\n", Color.Red); return; } dt = (DataTable)dh.ExecuteSql("select pa_status,pa_mothercode from package where pa_type = 1 and pa_outboxcode = '"+boxcode.Text+"'", "select"); if (dt.Rows.Count > 0) { string pa_status = dt.Rows[0]["pa_status"].ToString(); string pa_mothercode = dt.Rows[0]["pa_mothercode"].ToString(); if (pa_status != "1") { OperatResult.AppendText(">>箱号" + boxcode.Text + "未封箱\n", Color.Red, boxcode); return; } if (pa_mothercode != "") { OperatResult.AppendText(">>箱号" + boxcode.Text + "已装栈板\n", Color.Red, boxcode); return; } dh.UpdateByCondition(" package ", "PA_COLORCODE = '"+US_COLORCODE.Text+ "',PA_PRODUCTCOLOR = '"+US_PRODUCTCOLOR.Text+ "',pa_upc = '"+US_UPC.Text+ "' ,pa_sku = '"+US_SKU.Text+ "',pa_location = '"+US_LOCATION.Text+"'", " pa_outboxcode = '"+boxcode.Text+"' "); dh.UpdateByCondition(" makeserial ", "ms_COLORCODE = '" + US_COLORCODE.Text + "',ms_PRODUCTCOLOR = '" + US_PRODUCTCOLOR.Text + "',ms_upc = '" + US_UPC.Text + "' ,ms_sku = '" + US_SKU.Text + "',ms_location = '" + US_LOCATION.Text + "'", " ms_outboxcode = '" + boxcode.Text + "' "); OperatResult.AppendText(">>箱号" + boxcode.Text + "更新信息成功\n", Color.Green, boxcode); return; } else { OperatResult.AppendText(">>箱号"+boxcode.Text+"不存在\n", Color.Red,boxcode); return; } } } } }