public ActionResult Edit(int Id) { DisciplineHelper disciplineHelper = new DisciplineHelper(); DisciplineModel DisciplineModel = new DisciplineModel(); DisciplineModel = disciplineHelper.GetByID(Id); ViewBag.StatusList = AppLogic.BindDDStatus(Convert.ToInt32(DisciplineModel.Status)); return(View(DisciplineModel)); }
public ActionResult Delete(int Id) { DisciplineHelper disciplineHelper = new DisciplineHelper(); DisciplineModel disciplineModel = new DisciplineModel(); disciplineModel = disciplineHelper.GetByID(Id); int count = disciplineHelper.Delete(disciplineModel); if (count == 0) { TempData["CommonMessage"] = AppLogic.setMessage(count, "Record deleted successfully."); } else if (count == -2) { TempData["CommonMessage"] = AppLogic.setMessage(count, "Discipline is associated with vendor. it can't be deleted?"); } else { TempData["CommonMessage"] = AppLogic.setMessage(count, "Record deletion failed."); } return(RedirectToAction("Index")); }