示例#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);
         }
     }
 }