Ejemplo n.º 1
0
 public virtual void Delete(Basket entityToDelete)
 {
     if (db.Entry(entityToDelete).State == EntityState.Detached)
     {
         dbSet.Attach(entityToDelete);
     }
     dbSet.Remove(entityToDelete);
     db.SaveChanges();
 }
Ejemplo n.º 2
0
 public ActionResult Edit([Bind(Include = "IDUser,Password,ConfirmPassword,Surname,Name,Patronymic,BirthDay,Mail,Phone,Address")] User user)
 {
     if (ModelState.IsValid)
     {
         db.Entry(user).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(user));
 }
 public ActionResult Edit([Bind(Include = "IDOrder,Count,Date,Status,Address")] Order order)
 {
     if (ModelState.IsValid)
     {
         db.Entry(order).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(order));
 }
        public ActionResult Edit(Basket basket)
        {
            if (ModelState.IsValid)
            {
                db.Entry(basket).State = EntityState.Modified;
                db.SaveChanges();

                return(RedirectToAction("Index"));
            }
            return(View("Edit", basket));
        }
Ejemplo n.º 5
0
 public void Update(OrderItem item)
 {
     db.Entry(item).State = EntityState.Modified;
 }
Ejemplo n.º 6
0
 public void Update(Customer item)
 {
     db.Entry(item).State = EntityState.Modified;
 }
Ejemplo n.º 7
0
 public ActionResult Edit(Product product)
 {
     db.Entry(product).State = EntityState.Modified;
     db.SaveChanges();
     return(RedirectToAction("Index"));
 }