Special_QCRecheck.cs 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Data;
  4. using System.Drawing;
  5. using System.Windows.Forms;
  6. using UAS_MES_NEW.DataOperate;
  7. using UAS_MES_NEW.Entity;
  8. using UAS_MES_NEW.PublicMethod;
  9. namespace UAS_MES_NEW.Special
  10. {
  11. public partial class Special_QCRecheck : Form
  12. {
  13. DataHelper dh = SystemInf.dh;
  14. LogStringBuilder sql = new LogStringBuilder();
  15. public Special_QCRecheck()
  16. {
  17. InitializeComponent();
  18. }
  19. private void Confirm_Click(object sender, EventArgs e)
  20. {
  21. //获取序列号的途程
  22. DataTable dt = (DataTable)dh.ExecuteSql("select pr_detail,ms_outboxcode,ms_sncode,ms_firstsn,ms_id,ms_nextstepcode,ms_currentstepcode,ms_makecode,ms_status,ms_checkno,ms_craftcode,ms_prodcode,ms_stepcode,nvl(ms_qccheck,0)ms_qccheck from makeserial left join product on pr_code=ms_prodcode where (ms_sncode='" + sn_code.Text + "' or ms_imei1='" + sn_code.Text + "' and ms_imei2='" + sn_code.Text + "') order by ms_id desc", "select");
  23. if (dt.Rows.Count > 0)
  24. {
  25. pr_code.Text = dt.Rows[0]["ms_prodcode"].ToString();
  26. string ms_makecode = dt.Rows[0]["ms_makecode"].ToString();
  27. string ms_qccheck = dt.Rows[0]["ms_qccheck"].ToString();
  28. pr_detail.Text = dt.Rows[0]["pr_detail"].ToString();
  29. if (ms_qccheck != "-1")
  30. {
  31. OperateResult.AppendText(">>序列号" + sn_code.Text + "不处于QC判定状态\n", Color.Red, sn_code);
  32. return;
  33. }
  34. dh.ExecuteSql("update makeserial set ms_qccheck=0 where ms_sncode='" + sn_code.Text + "'", "update");
  35. LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ms_makecode, User.UserLineCode, User.UserSourceCode, "维修品判定", "维修品判定为良品", sn_code.Text, "");
  36. OperateResult.AppendText(">>序列号" + sn_code.Text + "QC确认良品\n", Color.Green, sn_code);
  37. }
  38. else OperateResult.AppendText(">>序列号" + sn_code.Text + "不存在\n", Color.Red, sn_code);
  39. }
  40. private void Clean_Click(object sender, EventArgs e)
  41. {
  42. OperateResult.Clear();
  43. }
  44. private void Special_CancelCollection_Load(object sender, EventArgs e)
  45. {
  46. }
  47. DataTable Dbfind;
  48. private void pr_code_DbChange(object sender, EventArgs e)
  49. {
  50. }
  51. private void sn_code_KeyDown(object sender, KeyEventArgs e)
  52. {
  53. if (e.KeyCode == Keys.Enter)
  54. {
  55. DataTable dt = (DataTable)dh.ExecuteSql("select pr_detail,ms_outboxcode,ms_sncode,ms_firstsn,ms_id,ms_nextstepcode,ms_currentstepcode,ms_makecode,ms_status,ms_checkno,ms_craftcode,ms_prodcode,ms_stepcode,nvl(ms_qccheck,0)ms_qccheck from makeserial left join product on pr_code=ms_prodcode where (ms_sncode='" + sn_code.Text + "' or ms_imei1='" + sn_code.Text + "' and ms_imei2='" + sn_code.Text + "') order by ms_id desc", "select");
  56. if (dt.Rows.Count > 0)
  57. {
  58. pr_code.Text = dt.Rows[0]["ms_prodcode"].ToString();
  59. string ms_makecode = dt.Rows[0]["ms_makecode"].ToString();
  60. string ms_qccheck = dt.Rows[0]["ms_qccheck"].ToString();
  61. pr_detail.Text = dt.Rows[0]["pr_detail"].ToString();
  62. }
  63. else OperateResult.AppendText(">>序列号" + sn_code.Text + "不存在\n", Color.Red, sn_code);
  64. }
  65. }
  66. }
  67. }