public ActionResult Delete(int?assessmentGroupPK) { IAssessmentGroupsRepository assessmentGroupsRepository = new AssessmentGroupsRepository(db); if (assessmentGroupPK != null) { AssessmentGroup assessmentGroup = assessmentGroupsRepository.GetAssessmentGroupByPK((int)assessmentGroupPK); assessmentGroup.Deleted = true; assessmentGroupsRepository.SaveChanges(); TempData["message"] = LayoutHelper.GetMessage("DELETE", assessmentGroup.AssessmentGroupPK); } return(Redirect(Request.UrlReferrer.AbsoluteUri)); }
public ActionResult Edit(AssessmentGroupView assessmentGroupView, FormCollection form) { if (ModelState.IsValid) { IAssessmentGroupsRepository assessmentGroupsRepository = new AssessmentGroupsRepository(db); AssessmentGroup assessmentGroup = assessmentGroupsRepository.GetAssessmentGroupByPK((int)assessmentGroupView.AssessmentGroupPK); assessmentGroupView.ConvertTo(assessmentGroupView, assessmentGroup); assessmentGroupsRepository.SaveChanges(); TempData["message"] = LayoutHelper.GetMessage("UPDATE", assessmentGroup.AssessmentGroupPK); return(RedirectToAction("Index", "AssessmentGroup")); } else { assessmentGroupView.BindDDLs(assessmentGroupView, db); return(View(assessmentGroupView)); } }