//********************Update category


        public void UpdateCategory(Category category)
        {
            using (var context = new FAContext())
            {
                context.Entry(category).State = System.Data.Entity.EntityState.Modified;
                context.SaveChanges();
            }
        }
Exemplo n.º 2
0
        //********************Update Products

        public void UpdateProduct(Product Product)
        {
            using (var context = new FAContext())
            {
                context.Entry(Product).State = System.Data.Entity.EntityState.Modified;
                context.SaveChanges();
            }
        }
Exemplo n.º 3
0
 public object UpdateOrderStatus(int ID, string status)
 {
     using (var context = new FAContext())
     {
         var order = context.Orders.Find(ID);
         order.status = status;
         context.Entry(order).State = EntityState.Modified;
         return(context.SaveChanges() > 0);
     }
 }
Exemplo n.º 4
0
        //********************Save Products

        public void SaveProduct(Product Product)
        {
            using (var context = new FAContext())
            {
                context.Entry(Product.Category).State = System.Data.Entity.EntityState.Unchanged;

                context.Products.Add(Product);
                context.SaveChanges();
            }
        }