Example #1
0
 private void SaveDictionary()
 {
     if (CurrentOptions.CurrentUser != null)
     {
         DictionaryViewModel newDictionary = new DictionaryViewModel();
         newDictionary.Name         = _newDictionary.Name;
         newDictionary.DictionaryID = _newDictionary.DictionaryID;
         Dictionaries.Add(newDictionary);
         _dao.addDictionary(newDictionary.getDictionary());
         NewDictionary = new DictionaryViewModel();
     }
 }
Example #2
0
        private void calculatePercentagesForSelectedDictionary()
        {
            decimal correctPercentage   = _dao.GetCorrectAnswerPercentage(_selectedDictionary.getDictionary());
            decimal incorrectPercentage = 100 - correctPercentage;

            CorrectPercentage   = correctPercentage.ToString("#.##") + "%";
            IncorrectPercentage = incorrectPercentage.ToString("#.##") + "%";

            if (correctPercentage == -1)
            {
                correctPercentage   = 0;
                incorrectPercentage = 0;
            }

            if (correctPercentage == 0)
            {
                CorrectPercentage = "0%";
            }

            if (incorrectPercentage == 0)
            {
                IncorrectPercentage = "0%";
            }
        }