예제 #1
0
        public int DeleteReminder(ReminderDataStructure reminderDataStructureInstance)
        {
            var id = reminderDataStructureInstance.Id;

            if (id != 0)
            {
                lock (collisionLock)
                {
                    database.Delete <ReminderDataStructure>(id);
                }
            }
            this.Reminders.Remove(reminderDataStructureInstance);
            return(id);
        }
예제 #2
0
 public int SaveReminder(ReminderDataStructure reminderDataStructureInstance)
 {
     lock (collisionLock)
     {
         if (reminderDataStructureInstance.Id != 0)
         {
             database.Update(reminderDataStructureInstance);
             Reminders.Add(reminderDataStructureInstance);
             return(reminderDataStructureInstance.Id);
         }
         else
         {
             database.Insert(reminderDataStructureInstance);
             Reminders.Add(reminderDataStructureInstance);
             return(reminderDataStructureInstance.Id);
         }
     }
 }