Packing_NewBigBox.cs 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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_NewBigBox : Form
  10. {
  11. DataHelper dh;
  12. DataTable Dbfind;
  13. //生成的箱类型,2表示大箱号,3表示栈板号
  14. string OutBoxCode1;
  15. public string OutBoxCode
  16. {
  17. get
  18. {
  19. return OutBoxCode1;
  20. }
  21. set
  22. {
  23. OutBoxCode1 = value;
  24. }
  25. }
  26. public Packing_NewBigBox(string Caller, string MakeCode)
  27. {
  28. InitializeComponent();
  29. pa_outboxcode.Caller = Caller;
  30. pa_outboxcode.MakeCode = MakeCode;
  31. }
  32. private void 新增栈板_Load(object sender, EventArgs e)
  33. {
  34. dh = SystemInf.dh;
  35. pr_code.FormName = Name;
  36. pr_code.SetValueField = new string[] { "pr_code", "pr_bigboxinnerqty" };
  37. pr_code.TableName = "product";
  38. pr_code.SelectField = "pr_code # 物料编号,pr_detail # 物料名称,pr_kind # 物料种类,pr_spec # 物料规格,pr_bigboxinnerqty # 大箱容量";
  39. pr_code.DbChange += Pr_code_DbChange;
  40. }
  41. private void Pr_code_DbChange(object sender, EventArgs e)
  42. {
  43. Dbfind = pr_code.ReturnData;
  44. BaseUtil.SetFormValue(this.Controls, Dbfind);
  45. }
  46. private void pr_code_UserControlTextChanged(object sender, EventArgs e)
  47. {
  48. pa_outboxcode.ProdCode = pr_code.Text;
  49. }
  50. private void Confirm_Click(object sender, EventArgs e)
  51. {
  52. if (pa_outboxcode.Text != "" && pr_bigboxinnerqty.Text != "" && pr_code.Text != "")
  53. {
  54. 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";
  55. 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 + "')";
  56. dh.ExecuteSql(sql, "insert");
  57. Close();
  58. }
  59. else
  60. {
  61. MessageBox.Show("请先填写完整信息");
  62. return;
  63. }
  64. }
  65. private void pa_outboxcode_UserControlTextChanged(object sender, EventArgs e)
  66. {
  67. OutBoxCode1 = pa_outboxcode.Text;
  68. }
  69. }
  70. }