12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- 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_NewPallet : CustomControl.BaseForm.BaseForm
- {
- DataHelper dh;
- DataTable Dbfind;
- //生成的箱类型,2表示大箱号,3表示栈板号
- string pa_type = "";
- string OutBoxCode1;
- public string OutBoxCode
- {
- get
- {
- return OutBoxCode1;
- }
- set
- {
- OutBoxCode1 = value;
- }
- }
- public Make_NewPallet(string Caller, string MakeCode)
- {
- InitializeComponent();
- pa_outboxcode.Caller = Caller;
- pa_outboxcode.MakeCode = MakeCode;
- }
- private void Make_NewPallet_Load(object sender, EventArgs e)
- {
- dh = new DataHelper();
- pr_code.FormName = Name;
- pr_code.SetValueField = new string[] { "pr_code" };
- pr_code.TableName = "product";
- pr_code.SelectField = "pr_code # 物料编号,pr_detail # 物料名称,pr_kind # 物料种类,pr_spec # 物料规格";
- 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_code.Text != "")
- {
- string sql = "insert into package (pa_id,pa_outboxcode,pa_makecode,pa_indate,pa_type,pa_prodcode,pa_level,PA_STATUS,pa_sccode,pa_currentstep)values";
- sql += "(package_seq.nextval,'" + pa_outboxcode.Text + "','" + pa_outboxcode.MakeCode + "',sysdate,3,'" + pr_code.Text + "',0,0,'" + User.UserSourceCode + "','" + User.CurrentStepCode + "')";
- dh.ExecuteSql(sql, "insert");
- }
- else MessageBox.Show("请先填写完整信息");
- }
- private void pa_outboxcode_UserControlTextChanged(object sender, EventArgs e)
- {
- OutBoxCode1 = pa_outboxcode.Text;
- }
- }
- }
|