public ActionResult Delete(int id, FormCollection collection) { Mst_CommPlan_Detail mstp = db.Mst_CommPlan_Details.Find(id); //return Json(mstp,JsonRequestBehavior.AllowGet); db.Mst_CommPlan_Details.Remove(mstp); db.SaveChanges(); return(RedirectToAction("Index")); }
// GET: CommPlanDetail/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(HttpNotFound()); } Mst_CommPlan_Detail user = db.Mst_CommPlan_Details.Include(m => m.Mst_CommPlan).Include(m => m.Mst_Role).Where(m => m.CommPlanDetailId == id).Single(); if (user == null) { return(HttpNotFound()); } return(View(user)); }
// GET: CommPlanDetail/Edit/5 public ActionResult Edit(int?id) { Mst_CommPlan_Detail mstcomplandtl = db.Mst_CommPlan_Details.Find(id); if (id == null) { return(HttpNotFound()); } //string data = mstperform.ToString(); //return View(mstperform); ViewBag.CommPlanid = new SelectList(db.Mst_CommPlans, "CommPlanid", "CommPlanDesc"); ViewBag.RoleId = new SelectList(db.Mst_Roles, "RoleId", "RoleName"); string data = mstcomplandtl.ToString(); return(View(mstcomplandtl)); }
public ActionResult Create(Mst_CommPlan_Detail tambah) { try { //return Json(tambah,JsonRequestBehavior.AllowGet); // TODO: Add insert logic here //ViewBag.CommPlanid = new SelectList(db.Mst_CommPlans, "CommPlanid", "CommPlanDesc"); //ViewBag.RoleId = new SelectList(db.Mst_Role, "RoleId", "RoleName"); db.Mst_CommPlan_Details.Add(tambah); db.SaveChanges(); return(RedirectToAction("Index")); } catch { return(View()); } }
public ActionResult Edit(int?id, Mst_CommPlan_Detail dEdit) { try { // TODO: Add update logic here if (id == null) { return(HttpNotFound()); } Mst_CommPlan_Detail mstcomplandtl = db.Mst_CommPlan_Details.Find(id); mstcomplandtl.CommPlanDetailId = dEdit.CommPlanDetailId; mstcomplandtl.CommPlanid = dEdit.CommPlanid; mstcomplandtl.Detail_Description = dEdit.Detail_Description; mstcomplandtl.RoleId = dEdit.RoleId; db.SaveChanges(); return(RedirectToAction("Index")); } catch { return(View()); } }