private void timerUI_Tick(object sender, EventArgs e) { var timeRemaining = getTimeRemaining(); lblTimer.Text = string.Format("{0} : {1}", timeRemaining.ToString("mm"), timeRemaining.ToString("ss")); if (timeRemaining.TotalSeconds < 1) { timerUI.Stop(); currentState = TomatoState.Stopped; MessageBox.Show("Done!"); RefreshUI(); } }
private void Setup() { InitializeComponent(); countdownMinutes = Convert.ToDouble(ConfigurationManager.AppSettings["CountdownMinutes"]); currentState = TomatoState.Stopped; RefreshUI(); }
private void StartTomato() { currentState = TomatoState.Started; countdownFinished = DateTime.Now.AddMinutes(countdownMinutes); currentBucket = new Bucket(); timerUI.Start(); }
static public Boolean setTomatoState(long userId, DateTime startTime, DateTime endTime, TomatoState state) { using (var db = SugarBase.GetIntance()) { db.Updateable <History>() .SetColumns(it => new History() { status = (int)state, endTime = endTime }) .Where(it => it.userId == userId && it.startTime == startTime).ExecuteCommand(); return(true); } }