Make_GetRepair.cs 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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. using UAS_MES.PublicMethod;
  12. namespace UAS_MES.Make
  13. {
  14. public partial class Make_GetRepair : Form
  15. {
  16. DataHelper dh = SystemInf.dh;
  17. LogStringBuilder sql = new LogStringBuilder();
  18. public Make_GetRepair()
  19. {
  20. InitializeComponent();
  21. }
  22. private void Confirm_Click(object sender, EventArgs e)
  23. {
  24. //获取序列号的途程
  25. DataTable dt = (DataTable)dh.ExecuteSql("select ms_id,ms_nextstepcode,ms_currentstepcode,ms_makecode,ms_status,ms_checkno,ms_craftcode,ms_prodcode,ms_stepcode from makeserial where ms_sncode='" + sn_code.Text + "' order by ms_id desc", "select");
  26. if (dt.Rows.Count > 0)
  27. {
  28. string pr_code = dt.Rows[0]["ms_prodcode"].ToString();
  29. string cr_code = dt.Rows[0]["ms_craftcode"].ToString();
  30. string ms_nextstepcode = dt.Rows[0]["ms_nextstepcode"].ToString();
  31. string ms_makecode = dt.Rows[0]["ms_makecode"].ToString();
  32. string ms_stepcode = dt.Rows[0]["ms_stepcode"].ToString();
  33. string ms_checkno = dt.Rows[0]["ms_checkno"].ToString();
  34. string ms_status = dt.Rows[0]["ms_status"].ToString();
  35. string ms_currentstepcode = dt.Rows[0]["ms_currentstepcode"].ToString();
  36. string ms_id = dt.Rows[0]["ms_id"].ToString();
  37. if (ms_status=="3")
  38. {
  39. dh.ExecuteSql("update makebad set mb_receivetime=sysdate where mb_sncode='"+sn_code.Text+"' and mb_status=0", "update");
  40. LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ms_makecode, User.UserLineCode, User.UserSourceCode, "维修接收", "维修接收成功", sn_code.Text, "");
  41. OperateResult.AppendText(">>序列号" + sn_code.Text + "维修接收成功\n", Color.Green, sn_code);
  42. }
  43. else OperateResult.AppendText(">>序列号" + sn_code.Text + "不处于维修状态\n", Color.Red, sn_code);
  44. }
  45. else OperateResult.AppendText(">>序列号" + sn_code.Text + "不存在\n", Color.Red, sn_code);
  46. }
  47. private void Clean_Click(object sender, EventArgs e)
  48. {
  49. OperateResult.Clear();
  50. }
  51. }
  52. }