void HandleKey_ShowStatistics(int input, bool state)
        {
            if (state)
                return;

            if (input == KeyConstants.FUNC_A)
            {
                _currentStateHandleKey = (k, s) =>
                {
                    if (!s)
                    {
                        if(k == KeyConstants.FUNC_C)
                        {
                            Write(DeleteStatistic_Perform);
                            AudioManager.Instance.PlaySound("Stat Delete Perform.mp3");
                            using (var repo = new MedicationIntakeRepository())
                            {
                                repo.ClearStatistic();
                            }
                            Thread.Sleep(2000);
                        }
                        ChangeState_ShowStatistics();
                    }
                };
                Write(DeleteStatistic_Ask);
                AudioManager.Instance.PlaySound("Stat Ask.mp3");
            }
            else if (input == KeyConstants.FUNC_B)
            {
                ChangeState_Waiting();
            }
        }
 private void TakeRadX(int _radXTakeCount)
 {
     Write(TakeRadXMessage);
     AudioManager.Instance.PlaySound("Take RadX Message.mp3");
     Thread.Sleep(2000);
     if (IS_DEMO)
         Thread.Sleep(2000);
     else
         _dongleConnector.TakeRadX(_radXTakeCount);
     using (var repo = new MedicationIntakeRepository())
     {
         repo.RecordIntake(MedicationType.RadX,_radXTakeCount);
         repo.CommitOrRollbackOnError();
     }
     ReadRads();
 }
 void ChangeState_ShowStatistics()
 {
     _state =ModelState.showStatistics;
     _currentStateHandleKey = HandleKey_ShowStatistics;
     WriteInput("");
     using (var repo = new MedicationIntakeRepository())
     {
         var rep = repo.GetMedicationReport();
         string reportMessage = string.Format(
             "RadX:     {0}\n"+
             "PureLive: {1}\n"+
             "RadAway:  {2}\n",
             rep.RadX,rep.PureLive, rep.RadAway);
         Write(StatisticMessage + "\n" + reportMessage + "\n" + StatisticMessage_DeleteOption);
         AudioManager.Instance.PlaySound("Stat Message.mp3");
         AudioManager.Instance.PlaySound("Stat Option.mp3",4000);
     }
 }