BadSn.cs 2.5 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 BadSn : Form
  15. {
  16. DataHelper dh = SystemInf.dh;
  17. AutoSizeFormClass asc = new AutoSizeFormClass();
  18. string _linecode;
  19. string _prodcode;
  20. string _wccode;
  21. string _begindate;
  22. string _enddate;
  23. string _stepcode;
  24. string _makind;
  25. string _badname;
  26. public BadSn(string linecode, string prodcode, string wccode, string begindate, string enddate, string stepcode,string makind,string badname)
  27. {
  28. InitializeComponent();
  29. _linecode = linecode;
  30. _prodcode = prodcode;
  31. _wccode = wccode;
  32. _begindate = begindate;
  33. _enddate = enddate;
  34. _stepcode = stepcode;
  35. _makind = makind;
  36. _badname = badname;
  37. }
  38. private void BadItem_SizeChanged(object sender, EventArgs e)
  39. {
  40. asc.controlAutoSize(this);
  41. }
  42. private void BadItem_Load(object sender, EventArgs e)
  43. {
  44. string condition = " mb_indate between to_date('" + _begindate + "', 'yyyy-mm-dd hh24:mi:ss') and to_date('" + _enddate + "', 'yyyy-mm-dd hh24:mi:ss') ";
  45. if (_prodcode != "")
  46. {
  47. condition += " and ma_prodcode = '" + _prodcode + "'";
  48. }
  49. if (_linecode != "")
  50. {
  51. condition += " and mb_linecode = '" + _linecode + "'";
  52. }
  53. if (_wccode != "")
  54. {
  55. condition += " and ma_wccode = '" + _wccode + "'";
  56. }
  57. if (_makind != "")
  58. {
  59. condition += " and ma_kind = '" + _makind + "'";
  60. }
  61. if (_stepcode != "")
  62. {
  63. condition += " and mb_stepcode = '" + _stepcode + "'";
  64. }
  65. if (_badname != "")
  66. {
  67. condition += " and mb_badname = '" + _badname + "'";
  68. }
  69. string v_sql = "";
  70. LogicHandler.GetQuerySQL(condition, "不良明细", out v_sql);
  71. DataTable dt = (DataTable)dh.ExecuteSql(v_sql, "select");
  72. BaseUtil.FillDgvWithDataTable(Data, dt);
  73. }
  74. }
  75. }