Make_PalletWeightRecord.cs 1.6 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. using UAS_MES.Entity;
  11. namespace UAS_MES.Make
  12. {
  13. public partial class Make_PalletWeightRecord : Form
  14. {
  15. DataHelper dh = SystemInf.dh;
  16. public Make_PalletWeightRecord()
  17. {
  18. InitializeComponent();
  19. }
  20. private void SaveWeight_Click(object sender, EventArgs e)
  21. {
  22. //验证栈板号存在
  23. if (dh.CheckExist("package", "pa_outboxcode='" + pa_outboxcode.Text + "' and pa_type=3"))
  24. {
  25. float PalletWeight;
  26. try
  27. {
  28. PalletWeight = float.Parse(weight.Text);
  29. }
  30. catch (Exception)
  31. {
  32. OperateResult.AppendText(">>请输入正确的重量\n");
  33. return;
  34. }
  35. dh.UpdateByCondition("package", "PA_WEIGHT='" + PalletWeight + "'", "pa_outboxcode='" + pa_outboxcode.Text + "'");
  36. OperateResult.AppendText(">>栈板号" + pa_outboxcode.Text + "记录重量" + weight.Text + "kg成功\n", Color.Green, pa_outboxcode);
  37. weight.Clear();
  38. }
  39. else OperateResult.AppendText(">>栈板号" + pa_outboxcode.Text + "不存在\n", Color.Red, pa_outboxcode);
  40. }
  41. private void Clean_Click(object sender, EventArgs e)
  42. {
  43. OperateResult.Clear();
  44. }
  45. }
  46. }