Query_SOP.cs 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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.Query
  13. {
  14. public partial class Query_SOP : Form
  15. {
  16. DataHelper dh = SystemInf.dh;
  17. public Query_SOP()
  18. {
  19. InitializeComponent();
  20. }
  21. private void Export_Click(object sender, EventArgs e)
  22. {
  23. }
  24. //选择导出Excel时是选择导出数据的还是模板
  25. private void ExcelExport(string DataOrTemplet)
  26. {
  27. }
  28. private void Query_SpecialReport_Load(object sender, EventArgs e)
  29. {
  30. }
  31. private void Sn_KeyDown(object sender, KeyEventArgs e)
  32. {
  33. if (e.KeyData == Keys.Enter)
  34. {
  35. //dh.ExecuteSql("update craftmaterial set cm_status=-1 where cm_barcode='" + Sn.Text + "'", "update");
  36. //MessageBox.Show("解绑成功");
  37. DataTable dt = (DataTable)dh.ExecuteSql("select ms_prodcode from makeserial where ms_sncode='" + Sn.Text + "'", "select");
  38. if (dt.Rows.Count > 0)
  39. {
  40. string prodcode = dt.Rows[0]["ms_prodcode"].ToString();
  41. string FilePath = dh.getFieldDataByCondition("SOPDETAIL left join sop on so_id=sod_soid ", "sod_path", "so_prodcode='" + prodcode + "' and sod_stepcode='" + User.CurrentStepCode + "'").ToString();
  42. if (FilePath == "")
  43. {
  44. MessageBox.Show("产品:"+prodcode+"在工序:"+User.CurrentStepName+"无SOP信息");
  45. }
  46. else
  47. {
  48. System.Diagnostics.Process.Start(FilePath);
  49. }
  50. }
  51. else
  52. {
  53. MessageBox.Show("序列号" + Sn.Text + "不存在");
  54. }
  55. }
  56. }
  57. }
  58. }