public ActionResult SaveJobInfo(Models.JobInfoDTO infoDTO) { AjaxResult result = new AjaxResult(); if (ModelState.IsValid) { TransactionManager.Excute(delegate { IJobInfoService jobService = ContainerManager.Resolve <IJobInfoService>(); UserInfo logUser = UserContext.LoginUser; HxBlogs.Model.UserInfo user = MapperManager.Map <UserInfo>(logUser); JobInfo jobInfo = MapperManager.Map <JobInfo>(infoDTO); jobInfo.Id = user.JobId; user.JobInfo = jobInfo; List <string> fields = new List <string>(); fields.AddRange(new string[] { "Position", "Industry", "WorkUnit", "WorkYear", "Status", "Skills", "GoodAreas" }); jobService.UpdateEntityFields(jobInfo, fields); _userService.UpdateEntityFields(user); UserContext.UpdateUser(user); }); } else { result = GetErrorResult(); } return(Json(result, JsonRequestBehavior.AllowGet)); }
public ActionResult Profiles() { Models.BasicInfoDTO basicInfo = MapperManager.Map <Models.BasicInfoDTO>(UserContext.LoginUser.BasicInfo); basicInfo.NickName = UserContext.LoginUser.NickName; Models.JobInfoDTO jobInfo = MapperManager.Map <Models.JobInfoDTO>(UserContext.LoginUser.JobInfo); ViewBag.JobInfo = jobInfo; ViewBag.AvatarUrl = UserContext.LoginUser.AvatarUrl; return(View(basicInfo)); }