using System; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using System.Data; using System.Linq; using System.Text; using System.Windows.Forms; using UAS_MES_NEW.DataOperate; using UAS_MES_NEW.Entity; namespace UAS_MES_NEW.CustomControl.TextBoxWithIcon { public partial class SourceStepCount : UserControl { DataHelper dh; string Source1; public string Source { get { return Source1; } set { Source1 = value; } } string StepCode1; public string StepCode { get { return StepCode1; } set { StepCode1 = value; } } string LineCode1; public string LineCode { get { return LineCode1; } set { LineCode1 = value; } } internal DataHelper Dh { get { return dh; } set { dh = value; } } public SourceStepCount() { InitializeComponent(); } private void SourceStepCount_Load(object sender, EventArgs e) { //五分钟刷新一次 CountRefresh.Interval = 60000; } public void Start() { string SQL = "select count(distinct mp_sncode) from makeprocess where mp_indate>trunc(sysdate) and "; SQL += "mp_sourcecode='" + Source1 + "' and mp_linecode='" + LineCode1 + "' and mp_stepcode='" + StepCode1 + "' and mp_inman='" + User.UserCode + "' "; DataTable dt = (DataTable)Dh.ExecuteSql(SQL, "select"); Count.Text = "计数:" + dt.Rows[0][0].ToString(); CountRefresh.Start(); } public void Close() { CountRefresh.Stop(); } private void CountRefresh_Tick(object sender, EventArgs e) { string SQL = "select count(distinct mp_sncode) from makeprocess where mp_indate>trunc(sysdate) and "; SQL += "mp_sourcecode='" + Source1 + "' and mp_linecode='" + LineCode1 + "' and mp_stepcode='" + StepCode1 + "' and mp_inman='" + User.UserCode + "' "; DataTable dt = (DataTable)Dh.ExecuteSql(SQL, "select"); Count.Text = "计数:" + dt.Rows[0][0].ToString(); } } }