Esempio n. 1
0
 public match getCurrentMatch(string companyid, string agentid)
 {
     try
     {
         match     o  = new match();
         DataTable dt = execQuery("select top 1 * from vCurrentMatch where companyid = '" + companyid + "' and agentid='" + agentid.Replace("'", "''") + "' order by no desc").Tables[0];
         if (dt.Rows.Count > 0)
         {
             o.id        = Int32.Parse(dt.Rows[0]["id"].ToString());
             o.companyid = dt.Rows[0]["companyid"].ToString();
             o.no        = Int32.Parse(dt.Rows[0]["no"].ToString());
             return(o);
         }
         return(null);
     }
     catch (Exception)
     {
         return(null);
     }
 }
Esempio n. 2
0
 private void timer1_Tick(object sender, EventArgs e)
 {
     try
     {
         match o = db.getCurrentMatch(txtCompanyID.Text, frmLogin.m.agentid);
         if (o.no != match_no)
         {
             match_no        = o.no;
             match_id        = o.id;
             lblMatchNo.Text = match_no.ToString();
             lblInput.Text   = "0";
             lblRed.Text     = "0";
             lblBlue.Text    = "0";
             lblHoa.Text     = "0";
         }
     }
     catch (Exception)
     {
     }
 }