public ActionResult EducationEdit(int id) { MemberState state = MemberStateBL.State; EducationVO model = new EducationVO(); try { IEducationBL bl = new EducationBL(); model = bl.GetEducationById(id); if (model.MemberId != state.Member.Id) { throw new AuthenticationException(Resource.NotAuthorized); } EducationCreateViewBag(); return(PartialView("_EducationEdit", model)); } catch (AuthenticationException ex) { TempData["UIMsg"] = new UIMessage(ex.Message, eUIMsgType.danger); return(Json(new { error = true, message = ex.Message })); } catch (Exception ex) { TempData["UIMsg"] = new UIMessage(ex.Message, eUIMsgType.danger); return(Json(new { error = true, message = ex.Message })); } }
public ActionResult UpdateEducation(EducationVO model, FormCollection collection) { try { IEducationBL bl = new EducationBL(); bl.Save(model); } catch (Exception ex) { TempData["UIMsg"] = new UIMessage(ex.Message, eUIMsgType.danger); } return(RedirectToAction("Index")); }
public ActionResult EducationCreate(EducationVO model, FormCollection collection) { try { model.Grade = Decimal.Parse(collection["Grade"].Replace(".", ",")); model = new EducationBL().Save(model); } catch (Exception ex) { TempData["UIMsg"] = new UIMessage(ex.Message, eUIMsgType.danger); return(RedirectToAction("Index")); } TempData["UIMsg"] = new UIMessage(Resource.M0003, eUIMsgType.success); return(RedirectToAction("Index")); }
public IEnumerable <EducationDTO> GetEducations() { var DTOs = new EducationBL().Get(); if (DTOs != null) { foreach (var DTO in DTOs) { if (DTO.User != null) { DTO.User = new UsersBL().Get(DTO.UserID); } } } return(DTOs.ToList()); }