Packing_PalletWeightRecord.cs 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. using System;
  2. using System.Drawing;
  3. using System.Windows.Forms;
  4. using UAS_MES_NEW.DataOperate;
  5. using UAS_MES_NEW.Entity;
  6. namespace UAS_MES_NEW.Packing
  7. {
  8. public partial class Packing_PalletWeightRecord : Form
  9. {
  10. DataHelper dh = SystemInf.dh;
  11. public Packing_PalletWeightRecord()
  12. {
  13. InitializeComponent();
  14. }
  15. private void SaveWeight_Click(object sender, EventArgs e)
  16. {
  17. //验证栈板号存在
  18. if (dh.CheckExist("package", "pa_outboxcode='" + pa_outboxcode.Text + "' and pa_type=3"))
  19. {
  20. float PalletWeight;
  21. try
  22. {
  23. PalletWeight = float.Parse(weight.Text);
  24. }
  25. catch (Exception)
  26. {
  27. OperateResult.AppendText(">>请输入正确的重量\n");
  28. return;
  29. }
  30. dh.UpdateByCondition("package", "PA_WEIGHT='" + PalletWeight + "'", "pa_outboxcode='" + pa_outboxcode.Text + "'");
  31. OperateResult.AppendText(">>栈板号" + pa_outboxcode.Text + "记录重量" + weight.Text + "kg成功\n", Color.Green, pa_outboxcode);
  32. weight.Clear();
  33. }
  34. else OperateResult.AppendText(">>栈板号" + pa_outboxcode.Text + "不存在\n", Color.Red, pa_outboxcode);
  35. }
  36. private void Clean_Click(object sender, EventArgs e)
  37. {
  38. OperateResult.Clear();
  39. }
  40. }
  41. }