public ActionResult DeleteConfirmed(int id) { Mst_CommPlan mst_CommPlan = db.Mst_CommPlans.Find(id); db.Mst_CommPlans.Remove(mst_CommPlan); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "CommPlanid,CommPlanDesc,isActive")] Mst_CommPlan mst_CommPlan) { if (ModelState.IsValid) { db.Entry(mst_CommPlan).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(mst_CommPlan)); }
// GET: CommPlan/Delete/5 public ActionResult Delete(int?id) { Mst_CommPlan user = db.Mst_CommPlans.Find(id); if (user == null) { return(HttpNotFound()); } return(View(user)); }
// GET: CommPlan/Details/5 public ActionResult Details(int?id) { Mst_CommPlan mstcommplan = db.Mst_CommPlans.Find(id); if (mstcommplan == null) { return(HttpNotFound()); } return(View(mstcommplan)); }
public ActionResult Create([Bind(Include = "CommPlanid,CommPlanDesc,isActive")] Mst_CommPlan mst_CommPlan) { if (ModelState.IsValid) { db.Mst_CommPlans.Add(mst_CommPlan); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(mst_CommPlan)); }
// GET: Commitment/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Mst_CommPlan mst_CommPlan = db.Mst_CommPlans.Find(id); if (mst_CommPlan == null) { return(HttpNotFound()); } return(View(mst_CommPlan)); }
// GET: CommPlan/Edit/5 public ActionResult Edit(int?id) { Mst_CommPlan mstcomplan = db.Mst_CommPlans.Find(id); if (id == null) { return(HttpNotFound()); } //string data = mstperform.ToString(); //return View(mstperform); string data = mstcomplan.ToString(); return(View(mstcomplan)); }
public ActionResult Delete(int?id, Mst_CommPlan test) { try { Mst_CommPlan mstp = db.Mst_CommPlans.Find(id); //return Json(mstp,JsonRequestBehavior.AllowGet); db.Mst_CommPlans.Remove(mstp); db.SaveChanges(); return(RedirectToAction("index")); } catch (DbUpdateException) { ViewBag.message = "Delete failed. Please check if record is used by another table."; Mst_CommPlan mstp2 = db.Mst_CommPlans.Find(id); return(View(mstp2)); } }
public ActionResult Create(Mst_CommPlan add) { try { // TODO: Add insert logic here if (ModelState.IsValid) { db.Mst_CommPlans.Add(add); db.SaveChanges(); } return(RedirectToAction("Index")); } catch { return(View()); } }
public ActionResult Edit(int?id, Mst_CommPlan cEdit) { try { // TODO: Add update logic here if (id == null) { return(HttpNotFound()); } Mst_CommPlan mstcomplan = db.Mst_CommPlans.Find(id); mstcomplan.CommPlanid = cEdit.CommPlanid; mstcomplan.CommPlanDesc = cEdit.CommPlanDesc; mstcomplan.isActive = cEdit.isActive; db.SaveChanges(); return(RedirectToAction("Index")); } catch { return(View()); } }