Ejemplo n.º 1
0
 public ActionResult Edit([Bind(Include = "cat_id,cat_name")] category category)
 {
     if (ModelState.IsValid)
     {
         db.Entry(category).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(category));
 }
Ejemplo n.º 2
0
 public ActionResult Edit([Bind(Include = "u_id,u_name,u_password,u_type")] user user)
 {
     if (ModelState.IsValid)
     {
         db.Entry(user).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(user));
 }
 public ActionResult Edit([Bind(Include = "p_id,p_name,p_price,p_qty,p_details,cat_id,o_id")] product product)
 {
     if (ModelState.IsValid)
     {
         db.Entry(product).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.cat_id = new SelectList(db.categories, "cat_id", "cat_name", product.cat_id);
     ViewBag.o_id   = new SelectList(db.orders, "o_id", "o_name", product.o_id);
     return(View(product));
 }