Пример #1
0
 public ActionResult Edit([Bind(Include = "cat_id,cat_name")] catagory catagory)
 {
     if (ModelState.IsValid)
     {
         db.Entry(catagory).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(catagory));
 }
Пример #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.catagories, "cat_id", "cat_name", product.cat_id);
     ViewBag.o_id   = new SelectList(db.Orders, "o_id", "o_name", product.o_id);
     return(View(product));
 }