public ActionResult Edit(NewLetter.Models.Education education) { try { var s = repo.Single(education.EducationID); if (s == null) { return(HttpNotFound()); } s.educationName = education.educationName; s.dataIsUpdated = BaseUtil.GetCurrentDateTime(); s.isActive = education.isActive; s.isSelected = education.isSelected; s.modifiedBy = Convert.ToInt64(BaseUtil.GetSessionValue(AdminInfo.employerID.ToString())); if (ModelState.IsValid) { repo.Update(s); return(RedirectToAction("Index")); } } catch (Exception e) { BaseUtil.CaptureErrorValues(e); } return(View(education)); }
public ActionResult Create(NewLetter.Models.Education education) { try { education.createdBy = Convert.ToInt64(BaseUtil.GetSessionValue(AdminInfo.UserID.ToString())); education.modifiedBy = Convert.ToInt64(BaseUtil.GetSessionValue(AdminInfo.UserID.ToString())); education.dataIsCreated = BaseUtil.GetCurrentDateTime(); education.dataIsUpdated = BaseUtil.GetCurrentDateTime(); if (ModelState.IsValid) { repo.Insert(education); return(RedirectToAction("Index")); } } catch (Exception e) { BaseUtil.CaptureErrorValues(e); } return(View(education)); }