Make_CheckQrcode.cs 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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. using UAS_MES_NEW.PublicMethod;
  12. namespace UAS_MES_NEW.Make
  13. {
  14. public partial class Make_CheckQrcode : Form
  15. {
  16. DataHelper dh;
  17. LogStringBuilder sql = new LogStringBuilder();
  18. public Make_CheckQrcode()
  19. {
  20. InitializeComponent();
  21. }
  22. private void Special_BoxSplit_Load(object sender, EventArgs e)
  23. {
  24. dh = SystemInf.dh;
  25. OperatResult.AppendText(">>请录入SN\n", Color.Black);
  26. }
  27. private void Split_Click(object sender, EventArgs e)
  28. {
  29. BaseUtil.CleanControls(this.Controls);
  30. OperatResult.AppendText(">>请录入SN\n", Color.Black);
  31. }
  32. private void checkno_KeyDown(object sender, KeyEventArgs e)
  33. {
  34. if (e.KeyCode == Keys.Enter)
  35. {
  36. if (input.Text == "")
  37. {
  38. OperatResult.AppendText(">>录入不可为空\n", Color.Red);
  39. return;
  40. }
  41. if (qrcode.Text == "")
  42. {
  43. string qr_code = dh.getFieldDataByCondition("craftmaterial join product on cm_soncode = pr_code", "cm_barcode", "cm_sncode = '"+ input.Text + "' and cm_status =0 and pr_detail like '%二维码%'").ToString();
  44. if (qr_code == "")
  45. {
  46. OperatResult.AppendText(">>SN:"+input.Text+"未找到对应二维码标签\n", Color.Red);
  47. input.Text = "";
  48. return;
  49. }
  50. qrcode.Text = qr_code;
  51. OperatResult.AppendText(">>获取SN:"+ input.Text + "二维码标签成功,请录入二维码核对\n", Color.Green);
  52. SN.Text = input.Text;
  53. input.Text = "";
  54. }
  55. else {
  56. if (qrcode.Text != input.Text)
  57. {
  58. OperatResult.AppendText(">>录入二维码标签:" + input.Text + "与先标签内容不对应,核对失败\n", Color.Red);
  59. input.Text = "";
  60. return;
  61. }
  62. else {
  63. OperatResult.AppendText(">>二维码标签核对成功\n", Color.Green);
  64. BaseUtil.CleanControls(this.Controls);
  65. OperatResult.AppendText(">>请录入SN\n", Color.Black);
  66. return;
  67. }
  68. }
  69. }
  70. }
  71. }
  72. }