Exemplo n.º 1
0
 internal void SaveFavorite(as_favorites favorite)
 {
     try
     {
         db.SaveItem(favorite);
     }
     catch (Exception ex)
     {
         RDL.Debug.LogError(ex);
     }
 }
Exemplo n.º 2
0
 internal int AddFavorites(as_favorites favorite)
 {
     try
     {
         return(db.SaveItem(favorite));
     }
     catch (Exception ex)
     {
         RDL.Debug.LogError(ex);
     }
     return(-1);
 }
Exemplo n.º 3
0
 public int SaveItem(as_favorites favorite)
 {
     if (favorite.id == 0)
     {
         db.as_favorites.Add(favorite);
         db.SaveChanges();
     }
     else
     {
         try
         {
             db.Entry(favorite).State = EntityState.Modified;
             db.SaveChanges();
         }
         catch (OptimisticConcurrencyException ex)
         {
             RDL.Debug.LogError(ex);
         }
     }
     return(favorite.id);
 }
Exemplo n.º 4
0
        public as_favorites GetItem(int id)
        {
            as_favorites res = db.as_favorites.FirstOrDefault(x => x.id == id);

            return(res);
        }