public void AddDoze(string name)
        {
            db = DB.GetDB();
            Doze doze = new Doze {
                Name = name
            };

            db.Dozes.Add(doze);
            db.SaveChanges();
        }
Beispiel #2
0
 public EditDozeViewModel(MainViewModel mainVM, Doze doze)
 {
     this.doze = doze;
     Name      = doze.Name;
     SaveDoze  = new RelayCommand(() =>
     {
         db                 = DB.GetDB();
         doze.Name          = Name;
         mainVM.CurrentView = new CatalogView(mainVM);
         db.SaveChanges();
     });
 }
Beispiel #3
0
 //the order of the list is like the order of the fields in the object
 public static void updateTableByList(List <int> weightedSleepSegmentsStats)
 {
     if (weightedSleepSegmentsStats != null)
     {
         if (weightedSleepSegmentsStats.Count == (8 * 6))
         {
             Awake.updateSemgentByList(weightedSleepSegmentsStats, 0);
             Snooze.updateSemgentByList(weightedSleepSegmentsStats, 8 * 1);
             Doze.updateSemgentByList(weightedSleepSegmentsStats, 8 * 2);
             RestlessSleep.updateSemgentByList(weightedSleepSegmentsStats, 8 * 3);
             RestfulSleep.updateSemgentByList(weightedSleepSegmentsStats, 8 * 4);
             REMSleep.updateSemgentByList(weightedSleepSegmentsStats, 8 * 5);
         }
     }
 }
Beispiel #4
0
 public EditDozeView(MainViewModel mainVM, Doze doze)
 {
     InitializeComponent();
     DataContext = new EditDozeViewModel(mainVM, doze);
 }
Beispiel #5
0
        public void DeveObterValorDoNumeroDoze()
        {
            Numero doze = new Doze();

            Assert.AreEqual(12, doze.GetValor, "Valor diferente de doze");
        }