示例#1
0
 public ActionResult Edit([Bind(Include = "cat_id,cat_name")] category_table category_table)
 {
     if (ModelState.IsValid)
     {
         db.Entry(category_table).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(category_table));
 }
示例#2
0
 public ActionResult Edit([Bind(Include = "user_id,user_name,user_password,user_type")] user_table user_table)
 {
     if (ModelState.IsValid)
     {
         db.Entry(user_table).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(user_table));
 }
示例#3
0
 public ActionResult Edit([Bind(Include = "product_id,product_name,product_price,product_quantity,product_details,cat_id")] product_table product_table)
 {
     if (ModelState.IsValid)
     {
         db.Entry(product_table).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.cat_id = new SelectList(db.category_tables, "cat_id", "cat_name", product_table.cat_id);
     return(View(product_table));
 }