| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- using System;
- using System.Windows.Forms;
- using UAS_MES.DataOperate;
- namespace UAS_MES.Make
- {
- public partial class Make_NewPallet : Form
- {
- DataHelper dh;
- //生成的箱类型,2表示大箱号,3表示栈板号
- string pa_type = "";
- public Make_NewPallet(string Caller)
- {
- InitializeComponent();
- switch (Caller)
- {
- case "Make!BigBoxWeigh":
- title.Text = "新增大箱号";
- pa_type = "2";
- break;
- case "Make!PalletWeigh":
- title.Text = "新增栈板号";
- pa_type = "3";
- break;
- default:
- break;
- }
- }
- private void 新增栈板_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 # 物料规格";
- }
- private void pr_code_UserControlTextChanged(object sender, EventArgs e)
- {
- pa_outboxcode.Pr_id = dh.getFieldDataByCondition("product", "pr_id", "pr_code='" + pr_code.Text + "'").ToString();
- }
- private void pa_outboxcode_IconClick(object sender, EventArgs e)
- {
- pa_outboxcode.Text = dh.GetSerialNumberByCaller(Tag.ToString());
- }
- private void Confirm_Click(object sender, EventArgs e)
- {
- if (pa_outboxcode.Text != "" && pa_packageqty.Text != "" && pr_code.Text != "")
- {
- string sql = "insert into package (pa_id,pa_outboxcode,pa_indate,pa_packageqty,pa_type,pa_prodcode,pa_level,PA_STATUS)values";
- sql += "(package_seq.nextval,'" + pa_outboxcode.Text + "',sysdate,'" + pa_packageqty.Text + "','" + pa_type + "','" + pr_code.Text + "',0,'')";
- dh.ExecuteSql(sql, "insert");
- MessageBox.Show("生成箱号成功!");
- pa_outboxcode.Text = "";
- pa_packageqty.Text = "";
- pr_code.Text = "";
- }
- else
- {
- MessageBox.Show("请先填写完整信息");
- }
- }
- }
- }
|