public ActionResult Edit([Bind(Include = "CustomerID,Name,SurName,BirthDay,Email,ProfilePhoto,PhoneNumber,Adres")] Customer customer)
 {
     if (ModelState.IsValid)
     {
         db.Entry(customer).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(customer));
 }
Ejemplo n.º 2
0
 public ActionResult Edit([Bind(Include = "ProductID,ProdName,ProdNo,ProdKind,prodImage,ProdPrice")] Product product)
 {
     if (ModelState.IsValid)
     {
         db.Entry(product).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(product));
 }
Ejemplo n.º 3
0
 public ActionResult Edit([Bind(Include = "OrderID,CustomerID,ProductID")] Order order)
 {
     if (ModelState.IsValid)
     {
         db.Entry(order).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.CustomerID = new SelectList(db.Customers, "CustomerID", "Name", order.CustomerID);
     ViewBag.ProductID  = new SelectList(db.Products, "ProductID", "ProdName", order.ProductID);
     return(View(order));
 }