Packing_PalletWeightRecord.cs 1.7 KB

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