Esempio n. 1
0
 /// <summary>
 /// Start manually cooldown
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void buttonStartCooldown_Click(object sender, EventArgs e)
 {
     DataTable dt = dbsqlite.GetDataTable("select * from questionwc where enabled = 1 AND type = 'cooldown'");
     if (dt.Rows.Count > 0)
     {
         FormCoolDown fc = new FormCoolDown(dbsqlite);
         fc.Show();
     }
     else
     {
         MessageBox.Show("You haven't configure cooldown");
     }
 }
Esempio n. 2
0
 /// <summary>
 /// Ressume da sessão
 /// </summary>
 /// <param name="hand"></param>
 /// <param name="loss"></param>
 /// <param name="time"></param>
 public void setValueSession(String hand, String time, Double bbs, Double bbmax, Double bb100)
 {
     if (resumesession)
     {
         textBoxRsHands.Text = hand;
         if (String.IsNullOrEmpty(time))
         {
             textBoxRsTime.Text = "00:00:00";
         }
         else
         {
             textBoxRsTime.Text = time;
         }
         textBoxBbsMax.Text = bbmax.ToString();
         if (bbmax > 0)
         {
             textBoxBbsMax.ForeColor = Color.Green;
             labelBbsMax.ForeColor = Color.Green;
         }
         if (bbs < 0)
         {
             textBoxRsBbs.Text = bbs.ToString();
             textBoxRsBbs.ForeColor = Color.Red;
             labelSessionBBs.ForeColor = Color.Red;
         }
         else
         {
             textBoxRsBbs.Text = bbs.ToString();
             textBoxRsBbs.ForeColor = Color.Green;
             labelSessionBBs.ForeColor = Color.Green;
         }
         if (bb100 < 0)
         {
             textBoxbb100.Text = bb100.ToString();
             textBoxbb100.ForeColor = Color.Red;
             labelbb100.ForeColor = Color.Red;
         }
         else
         {
             textBoxbb100.Text = bb100.ToString();
             textBoxbb100.ForeColor = Color.Green;
             labelbb100.ForeColor = Color.Green;
         }
         tabControlMain.SelectedTab = tabResumeSession;
     }
     //mas faço na mesma o history
     Int32 handsession = new Utils().stringtoInt32(hand);
     Int32 timesession = new Utils().stringTimeToMinute(time);
     if (handsession > histhands)
     {
         histhands = handsession;
         textBoxHistoryHands.Text = handsession.ToString();
     }
     if (timesession > histtime)
     {
         histtime = timesession;
         textBoxHistoryTime.Text = new Utils().intToStringTimer(timesession);
     }
     if (bbs < histbbsloss)
     {
         histbbsloss = bbs;
         textBoxHistoryBbsloss.Text = bbs.ToString();
     }
     if (bbs > histbbsmax)
     {
         histbbsmax = bbs;
         textBoxHistoryBbsMax.Text = bbs.ToString();
     }
     //aqui recuperar a hora e data.
     lastsession = DateTime.Now;
     //aqui para o cooldown
     if (checkBoxCooldown.Checked)
     {
         DataTable dt = dbsqlite.GetDataTable("select * from questionwc where enabled = 1 AND type = 'cooldown'");
         if (dt.Rows.Count > 0)
         {
             FormCoolDown fc = new FormCoolDown(dbsqlite);
             fc.Show();
         }
         else
         {
             MessageBox.Show("You haven't configure cooldown");
         }
     }
     //brm management
     bbbrm += bbs;
     checkBrm();
 }