SourceStepCount.cs 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Drawing;
  5. using System.Data;
  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. namespace UAS_MES_NEW.CustomControl.TextBoxWithIcon
  12. {
  13. public partial class SourceStepCount : UserControl
  14. {
  15. DataHelper dh;
  16. string Source1;
  17. string makecode1;
  18. public string Source
  19. {
  20. get
  21. {
  22. return Source1;
  23. }
  24. set
  25. {
  26. Source1 = value;
  27. }
  28. }
  29. string StepCode1;
  30. public string StepCode
  31. {
  32. get
  33. {
  34. return StepCode1;
  35. }
  36. set
  37. {
  38. StepCode1 = value;
  39. }
  40. }
  41. string LineCode1;
  42. public string LineCode
  43. {
  44. get
  45. {
  46. return LineCode1;
  47. }
  48. set
  49. {
  50. LineCode1 = value;
  51. }
  52. }
  53. internal DataHelper Dh
  54. {
  55. get
  56. {
  57. return dh;
  58. }
  59. set
  60. {
  61. dh = value;
  62. }
  63. }
  64. public string Makecode
  65. {
  66. get
  67. {
  68. return makecode1;
  69. }
  70. set
  71. {
  72. makecode1 = value;
  73. }
  74. }
  75. public SourceStepCount()
  76. {
  77. InitializeComponent();
  78. }
  79. private void SourceStepCount_Load(object sender, EventArgs e)
  80. {
  81. //五分钟刷新一次
  82. CountRefresh.Interval = 60000;
  83. }
  84. public void Start()
  85. {
  86. string SQL = "select count(distinct mp_sncode) from makeprocess where mp_indate>trunc(sysdate) and ";
  87. SQL += "mp_sourcecode='" + Source1 + "' and mp_linecode='" + LineCode1 + "' and mp_stepcode='" + StepCode1 + "' and mp_inman='" + User.UserCode + "' ";
  88. DataTable dt = (DataTable)Dh.ExecuteSql(SQL, "select");
  89. string SQL1 = "select count(distinct mp_sncode) from makeprocess where mp_indate>trunc(sysdate) and ";
  90. SQL1 += "mp_sourcecode='" + Source1 + "' and mp_linecode='" + LineCode1 + "' and mp_stepcode='" + StepCode1 + "' and mp_inman='" + User.UserCode + "' and mp_makecode='" + makecode1 + "'";
  91. DataTable dt1 = (DataTable)Dh.ExecuteSql(SQL1, "select");
  92. Count.Text = "计数:" + dt.Rows[0][0].ToString() + " 工单:" + dt1.Rows[0][0].ToString();
  93. CountRefresh.Start();
  94. }
  95. public void Close()
  96. {
  97. CountRefresh.Stop();
  98. }
  99. private void CountRefresh_Tick(object sender, EventArgs e)
  100. {
  101. string SQL = "select count(distinct mp_sncode) from makeprocess where mp_indate>trunc(sysdate) and ";
  102. SQL += "mp_sourcecode='" + Source1 + "' and mp_linecode='" + LineCode1 + "' and mp_stepcode='" + StepCode1 + "' and mp_inman='" + User.UserCode + "' ";
  103. DataTable dt = (DataTable)Dh.ExecuteSql(SQL, "select");
  104. string SQL1 = "select count(distinct mp_sncode) from makeprocess where mp_indate>trunc(sysdate) and ";
  105. SQL1 += "mp_sourcecode='" + Source1 + "' and mp_linecode='" + LineCode1 + "' and mp_stepcode='" + StepCode1 + "' and mp_inman='" + User.UserCode + "' and mp_makecode='" + makecode1 + "'";
  106. DataTable dt1 = (DataTable)Dh.ExecuteSql(SQL1, "select");
  107. Count.Text = "计数:" + dt.Rows[0][0].ToString() + " 工单:" + dt1.Rows[0][0].ToString();
  108. }
  109. }
  110. }