Query_Commandlog.cs 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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_Commandlog : Form
  15. {
  16. DataTable dbfind;
  17. AutoSizeFormClass asc = new AutoSizeFormClass();
  18. LogStringBuilder sql = new LogStringBuilder();
  19. DataTable dt;
  20. DataHelper dh;
  21. DataTable dta;
  22. DataTable dtpi;
  23. DataTable dtform;
  24. DataTable dtms;
  25. int getcount;
  26. public Query_Commandlog()
  27. {
  28. InitializeComponent();
  29. }
  30. private void Warehouse_ProductMakeIn_Load(object sender, EventArgs e)
  31. {
  32. asc.controllInitializeSize(this);
  33. getcount = 0;
  34. dh = SystemInf.dh;
  35. pallecode.Focus();
  36. }
  37. private void Warehouse_ProductMakeIn_SizeChanged(object sender, EventArgs e)
  38. {
  39. asc.controlAutoSize(this);
  40. }
  41. private void Search_Click(object sender, EventArgs e)
  42. {
  43. if (pallecode.Text!="")
  44. {
  45. sql.Clear();
  46. sql.Append(" select cl_linecode,cl_sncode,cl_makecode,cl_operate,cl_result,cl_date,sc_stepname,cl_man from commandlog ");
  47. sql.Append(" left join source on cl_sourcecode = sc_code where cl_sncode = '"+pallecode.Text+"' or cl_result like '%"+pallecode.Text+"%' order by cl_id asc ");
  48. DataTable dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
  49. BaseUtil.FillDgvWithDataTable(InOutDetailDGV, dt);
  50. }
  51. else {
  52. MessageBox.Show("不可录入为空");
  53. }
  54. }
  55. private void pallecode_KeyDown(object sender, KeyEventArgs e)
  56. {
  57. }
  58. private void pallecode_UserControlOnKeyDown(object sender, KeyEventArgs e)
  59. {
  60. if (e.KeyCode == Keys.Enter)
  61. {
  62. Search_Click(this, new EventArgs());
  63. }
  64. }
  65. }
  66. }