using System; using System.Data; using System.Windows.Forms; using UAS_MES.DataOperate; using UAS_MES.Entity; using UAS_MES.PublicMethod; namespace UAS_MES.Make { public partial class Make_NewBigBox : Form { DataHelper dh; DataTable Dbfind; //生成的箱类型,2表示大箱号,3表示栈板号 string OutBoxCode1; public string OutBoxCode { get { return OutBoxCode1; } set { OutBoxCode1 = value; } } public Make_NewBigBox(string Caller, string MakeCode) { InitializeComponent(); pa_outboxcode.Caller = Caller; pa_outboxcode.MakeCode = MakeCode; } private void 新增栈板_Load(object sender, EventArgs e) { dh = SystemInf.dh; pr_code.FormName = Name; pr_code.SetValueField = new string[] { "pr_code", "pr_bigboxinnerqty" }; pr_code.TableName = "product"; pr_code.SelectField = "pr_code # 物料编号,pr_detail # 物料名称,pr_kind # 物料种类,pr_spec # 物料规格,pr_bigboxinnerqty # 大箱容量"; pr_code.DbChange += Pr_code_DbChange; } private void Pr_code_DbChange(object sender, EventArgs e) { Dbfind = pr_code.ReturnData; BaseUtil.SetFormValue(this.Controls, Dbfind); } private void pr_code_UserControlTextChanged(object sender, EventArgs e) { pa_outboxcode.ProdCode = pr_code.Text; } private void Confirm_Click(object sender, EventArgs e) { if (pa_outboxcode.Text != "" && pr_bigboxinnerqty.Text != "" && pr_code.Text != "") { string sql = "insert into package (pa_id,pa_outboxcode,pa_makecode,pa_indate,pa_packageqty,pa_type,pa_prodcode,pa_level,PA_STATUS,pa_standardqty,pa_sccode,pa_currentstep)values"; sql += "(package_seq.nextval,'" + pa_outboxcode.Text + "','" + pa_outboxcode.MakeCode + "',sysdate,'0',2,'" + pr_code.Text + "',0,0,'" + pr_bigboxinnerqty.Text + "','" + User.UserSourceCode + "','" + User.CurrentStepCode + "')"; dh.ExecuteSql(sql, "insert"); Close(); } else { MessageBox.Show("请先填写完整信息"); return; } } private void pa_outboxcode_UserControlTextChanged(object sender, EventArgs e) { OutBoxCode1 = pa_outboxcode.Text; } } }