public static string IsStarted(this ClockStatus me)
 {
     if (me?.IsRunning == true)
     {
         return("");
     }
     return("disabled");
 }
Exemple #2
0
 public static string IsStarted(this ClockStatus me)
 {
     if (me != null && me.IsRunning)
     {
         return("");
     }
     return("disabled");
 }
Exemple #3
0
        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;
        }
Exemple #5
0
        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");
 }
Exemple #7
0
 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!");
     }
 }
Exemple #8
0
 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));
        }
Exemple #11
0
 public static bool IsClientVersionSameAsServer(this ClockStatus me) => me?.ServerVersionNumber.StartsWith(ClientVersion.ComparableVersionNumber(), StringComparison.Ordinal) == true;
Exemple #12
0
 public static void Action(ClockStatus status)
 {
 }