Esempio n. 1
0
 public ActionResult Edit([Bind(Include = "cid,cname")] tbl_category tbl_category)
 {
     if (ModelState.IsValid)
     {
         db.Entry(tbl_category).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(tbl_category));
 }
Esempio n. 2
0
 public ActionResult Edit([Bind(Include = "pid,pname,pprice,pdetails,cid")] tbl_product tbl_product)
 {
     if (ModelState.IsValid)
     {
         db.Entry(tbl_product).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.cid = new SelectList(db.tbl_category, "cid", "cname", tbl_product.cid);
     return(View(tbl_product));
 }