예제 #1
0
        public int DeleteCatatan(Catatan catatanInstance)
        {
            var id = catatanInstance.Id;

            if (id != 0)
            {
                lock (collisionLock)
                {
                    database.Delete <Catatan>(id);
                }
            }
            this.Catatans.Remove(catatanInstance);
            return(id);
        }
예제 #2
0
 public int SaveCatatan(Catatan catatanInstance)
 {
     lock (collisionLock)
     {
         if (catatanInstance.Id != 0)
         {
             database.Update(catatanInstance);
             return(catatanInstance.Id);
         }
         else
         {
             database.Insert(catatanInstance);
             return(catatanInstance.Id);
         }
     }
 }