public ActionResult Create(Mst_Perform simpan) { try { // TODO: Add insert logic here ViewBag.RoleMapId = new SelectList(db.Mst_RoleMaps, "RoleMapId", "RoleMapName"); db.Mst_Performs.Add(simpan); db.SaveChanges(); return(RedirectToAction("Index")); } catch { return(View()); } }
public ActionResult Delete(int id, Mst_Perform collection) { try { // TODO: Add delete logic here Mst_Perform mst = db.Mst_Performs.Find(id); db.Mst_Performs.Remove(mst); db.SaveChanges(); return(RedirectToAction("Index")); } catch (DbUpdateException) { ViewBag.message = "Delete failed. Plese check if record is used by another table."; Mst_Perform mst2 = db.Mst_Performs.Find(id); return(View()); } }
public ActionResult Edit(int?id, Mst_Perform simpanEdit) { try { if (id == null) { return(HttpNotFound()); } // TODO: Add update logic here Mst_Perform sedit = db.Mst_Performs.Find(id); //return Json(simpanEdit, JsonRequestBehavior.AllowGet); sedit.IsActive = simpanEdit.IsActive; sedit.PerformDesc = simpanEdit.PerformDesc; sedit.RoleMapId = simpanEdit.RoleMapId; db.SaveChanges(); return(RedirectToAction("Index")); } catch { return(View()); } }