public static string IsStarted(this ClockStatus me) { if (me?.IsRunning == true) { return(""); } return("disabled"); }
public static string IsStarted(this ClockStatus me) { if (me != null && me.IsRunning) { return(""); } return("disabled"); }
private void t_Tick(object sender, EventArgs e) { string ans = ""; if (cs == ClockStatus.work) { ans += "Current phase: working\n"; } if (cs == ClockStatus.rest) { ans += "Current phase: resting\n"; } ans += Math.Floor(timer / 60f) + ":"; if (timer % 60 < 10) { ans += "0" + timer % 60; } else { ans += timer % 60; } if (!ticking) { ans += "\n[Stopped]"; } l.Text = ans; if (!ticking) { return; } timer--; if (timer < 0) { if (cs == ClockStatus.work) { cs = ClockStatus.rest; timer = resetMaxTime; ticking = false; // SystemSounds.Beep.Play(); showTipMessage("MyTomatoClock", "Working phase ended!"); } else { cs = ClockStatus.work; timer = workingMaxTime; ticking = false; // SystemSounds.Beep.Play(); showTipMessage("MyTomatoClock", "Resting phase ended!"); } } }
private void clockOut() { var db = DBMethods.OPENDB(); string queryString = "INSERT INTO clocking(ID, GM, status) VALUES(" + DBMethods.GenerateUID("clocking") + " ,'" + DBMethods.GMSELF() + "', 0);"; new SQLiteCommand(queryString, db).ExecuteNonQuery(); db.Close(); Constants.Toast(StatusMsg.Text = "Clocked out."); status = ClockStatus.OUT; }
public async Task <ActionResult <Staff> > PostStaff(Staff staff) { ClockStatus clockStatus = _context.ClockStatus.Find(staff.ClockStatus.Id); StaffPosition staffPosition = _context.StaffPosition.Find(staff.StaffPosition.Id); staff.ClockStatus = clockStatus; staff.StaffPosition = staffPosition; _context.Staff.Add(staff); await _context.SaveChangesAsync(); return(CreatedAtAction(nameof(GetStaff), new { id = staff.Id }, staff)); }
public static string StatusClass(this ClockStatus me) { if (me?.IsUnavailable != false) { return("unavailable"); } if (me.IsRealtime) { return("realtime"); } if (me.IsRunning) { return("fastclock"); } return("stopped"); }
private void Btn_Mode(object sender, EventArgs e) { if (cs == ClockStatus.work) { cs = ClockStatus.rest; timer = resetMaxTime; ticking = false; // SystemSounds.Beep.Play(); // showTipMessage("MyTomatoClock", "Working phase ended!"); } else { cs = ClockStatus.work; timer = workingMaxTime; ticking = false; // SystemSounds.Beep.Play(); // showTipMessage("MyTomatoClock", "Resting phase ended!"); } }
private void Btn_Click(object sender, EventArgs e) { ticking = true; timer = workingMaxTime; cs = ClockStatus.work; }
public static bool IsClientVersionSameAsServer(this ClockStatus me) => me?.ServerVersionNumber.StartsWith(ClientVersion.MajorAndMiniorVersionNumber(), System.StringComparison.Ordinal) == true;
public static string SecondsPerHour(this ClockStatus me) { var speed = me == null ? 0 : me.Speed; return((60 / speed).ToString("F0", CultureInfo.CurrentCulture)); }
public static bool IsClientVersionSameAsServer(this ClockStatus me) => me?.ServerVersionNumber.StartsWith(ClientVersion.ComparableVersionNumber(), StringComparison.Ordinal) == true;
public static void Action(ClockStatus status) { }