Exemplo n.º 1
0
        public RegisterViewModel()
        {
            MoodEntry = App.MoodDatabase.GetMoodEntry(DateTime.Today);
            if (MoodEntry == null)
            {
                MoodEntry = new MoodEntry();
            }

            LowerLimitDate = new DateTime(2018, 1, 1);
            HighLimitDate  = DateTime.Today;
        }
Exemplo n.º 2
0
        public int SaveMoodEntry(MoodEntry entry)
        {
            lock (locker)
            {
                var existing = GetMoodEntry(entry.EntryDate);

                if (existing != null)
                {
                    entry.MoodEntryID = existing.MoodEntryID;

                    db.Update(entry);
                }
                else
                {
                    db.Insert(entry);
                }
            }
            return(entry.MoodEntryID);
        }