Packing_NewPallet.cs 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. using System;
  2. using System.Data;
  3. using System.Windows.Forms;
  4. using UAS_MES_NEW.DataOperate;
  5. using UAS_MES_NEW.Entity;
  6. using UAS_MES_NEW.PublicMethod;
  7. namespace UAS_MES_NEW.Packing
  8. {
  9. public partial class Packing_NewPallet : CustomControl.BaseForm.BaseForm
  10. {
  11. DataHelper dh;
  12. DataTable Dbfind;
  13. //生成的箱类型,2表示大箱号,3表示栈板号
  14. string pa_type = "";
  15. string OutBoxCode1;
  16. public string OutBoxCode
  17. {
  18. get
  19. {
  20. return OutBoxCode1;
  21. }
  22. set
  23. {
  24. OutBoxCode1 = value;
  25. }
  26. }
  27. public Packing_NewPallet(string Caller, string MakeCode)
  28. {
  29. InitializeComponent();
  30. pa_outboxcode.Caller = Caller;
  31. pa_outboxcode.MakeCode = MakeCode;
  32. }
  33. private void Make_NewPallet_Load(object sender, EventArgs e)
  34. {
  35. dh = new DataHelper();
  36. pr_code.FormName = Name;
  37. pr_code.SetValueField = new string[] { "pr_code" };
  38. pr_code.TableName = "product";
  39. pr_code.SelectField = "pr_code # 物料编号,pr_detail # 物料名称,pr_kind # 物料种类,pr_spec # 物料规格";
  40. pr_code.DbChange += Pr_code_DbChange;
  41. }
  42. private void Pr_code_DbChange(object sender, EventArgs e)
  43. {
  44. Dbfind = pr_code.ReturnData;
  45. BaseUtil.SetFormValue(this.Controls, Dbfind);
  46. }
  47. private void pr_code_UserControlTextChanged(object sender, EventArgs e)
  48. {
  49. pa_outboxcode.ProdCode = pr_code.Text;
  50. }
  51. private void Confirm_Click(object sender, EventArgs e)
  52. {
  53. if (pa_outboxcode.Text != "" && pr_code.Text != "")
  54. {
  55. 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";
  56. sql += "(package_seq.nextval,'" + pa_outboxcode.Text + "','" + pa_outboxcode.MakeCode + "',sysdate,3,'" + pr_code.Text + "',0,0,'" + User.UserSourceCode + "','" + User.CurrentStepCode + "')";
  57. dh.ExecuteSql(sql, "insert");
  58. }
  59. else MessageBox.Show("请先填写完整信息");
  60. }
  61. private void pa_outboxcode_UserControlTextChanged(object sender, EventArgs e)
  62. {
  63. OutBoxCode1 = pa_outboxcode.Text;
  64. }
  65. }
  66. }