コード例 #1
0
 public ActionResult Edit(Tab_Categoria tab_categoria)
 {
     if (ModelState.IsValid)
     {
         db.Entry(tab_categoria).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(tab_categoria));
 }
コード例 #2
0
 public ActionResult Edit(Tab_Subcategoria tab_subcategoria)
 {
     if (ModelState.IsValid)
     {
         db.Entry(tab_subcategoria).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.idcategoria = new SelectList(db.Tab_Categoria, "idcategoria", "descricao", tab_subcategoria.idcategoria);
     return(View(tab_subcategoria));
 }