Make_PalletWeightRecord.cs 1.5 KB

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