Example #1
0
        public Data.Occupancy UpdateOccupancy(Data.Occupancy occupancy)
        {
            if (!_context.Users.Local.Any(a => a.ID == occupancy.ID))
            {
                _context.Occupancies.Attach(occupancy);
            }

            _context.Entry(occupancy).State = EntityState.Modified;
            _context.SaveChanges();
            return(occupancy);
        }
Example #2
0
 public Data.Ingredient UpdateIngredient(Data.Ingredient ingredient)
 {
     if (!_context.Ingredients.Local.Any(i => i.Id == ingredient.Id))
     {
         _context.Ingredients.Attach(ingredient);
     }
     _context.Entry(ingredient).State = EntityState.Modified;
     _context.SaveChanges();
     return(ingredient);
 }
Example #3
0
 public Data.Product UpdateProduct(Data.Product product)
 {
     if (!_context.Products.Local.Any(sal => sal.ID == product.ID))
     {
         _context.Products.Attach(product);
     }
     _context.Entry(product).State = EntityState.Modified;
     _context.SaveChanges();
     return(product);
 }
Example #4
0
 public Data.Log UpdateLog(Data.Log log)
 {
     if (!_context.Logs.Local.Any(rec => rec.ID == log.ID))
     {
         _context.Logs.Attach(log);
     }
     _context.Entry(log).State = EntityState.Modified;
     _context.SaveChanges();
     return(log);
 }
Example #5
0
 public Data.Sale UpdateSale(Data.Sale sale)
 {
     if (!_context.Sales.Local.Any(sal => sal.ID == sale.ID))
     {
         _context.Sales.Attach(sale);
     }
     _context.Entry(sale).State = EntityState.Modified;
     _context.SaveChanges();
     return(sale);
 }
Example #6
0
 public Data.Category UpdateCategory(Data.Category category)
 {
     if (!_context.Categories.Local.Any(c => c.ID == category.ID))
     {
         _context.Categories.Attach(category);
     }
     _context.Entry(category).State = EntityState.Modified;
     _context.SaveChanges();
     return(category);
 }
Example #7
0
 public Data.Product UpdateProduct(Data.Product agenda)
 {
     if (!_context.Products.Local.Any(a => a.Id == agenda.Id))
     {
         _context.Products.Attach(agenda);
     }
     _context.Entry(agenda).State = EntityState.Modified;
     _context.SaveChanges();
     return(agenda);
 }
Example #8
0
 public Data.Table UpdateTable(Data.Table table)
 {
     if (!_context.Tables.Local.Any(i => i.Id == table.Id))
     {
         _context.Tables.Attach(table);
     }
     _context.Entry(table).State = EntityState.Modified;
     _context.SaveChanges();
     return(table);
 }
Example #9
0
 public Data.Reservation UpdateReservation(Data.Reservation reservation)
 {
     if (!_context.Reservations.Local.Any(res => res.ID == reservation.ID))
     {
         _context.Reservations.Attach(reservation);
     }
     _context.Entry(reservation).State = EntityState.Modified;
     _context.SaveChanges();
     return(reservation);
 }
Example #10
0
 public Data.RecipeItem UpdateRecipe(Data.RecipeItem recipe)
 {
     if (!_context.RecipeItems.Local.Any(rec => rec.ID == recipe.ID))
     {
         _context.RecipeItems.Attach(recipe);
     }
     _context.Entry(recipe).State = EntityState.Modified;
     _context.SaveChanges();
     return(recipe);
 }
Example #11
0
 public Data.Supplier UpdateSupplier(Data.Supplier supplier)
 {
     if (!_context.Suppliers.Local.Any(i => i.ID == supplier.ID))
     {
         _context.Suppliers.Attach(supplier);
     }
     _context.Entry(supplier).State = EntityState.Modified;
     _context.SaveChanges();
     return(supplier);
 }
Example #12
0
        public Data.User UpdateUser(Data.User user)
        {
            if (!_context.Users.Local.Any(a => a.ID == user.ID))
            {
                _context.Users.Attach(user);
            }

            _context.Entry(user).State = EntityState.Modified;
            _context.SaveChanges();
            return(user);
        }