예제 #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));
 }
예제 #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));
 }