Example #1
0
        public ProfileModel GetProfile(int userId)
        {
            User user = session.Load<User>(userId);

            ProfileModel model = new ProfileModel();
            return Mapper.Map<ProfileModel>(user.Profile);
        }
        private ProfileModel nullProvinceAndCity(ProfileModel model)
        {
            model.Province = model.Province == "------" ?
                null :
                AddressHelper.GetLiteral(model.Province);

            if (model.City == "--------")
            {
                model.City = null;
            }

            return model;
        }
        public new ActionResult Profile(string button, ProfileModel model)
        {
            if (button != "跳过")
            {
                if (!ModelState.IsValid)
                {
                    return View(model);
                }

                model = nullProvinceAndCity(model);

                _userService.SaveProfile(model, userHelper.CurrentUserId.Value);
            }

            if (model.BuildProject)
            {
                return RedirectToAction("Create", "Project");
            }
            else
            {
                return RedirectToAction("Search", "Project");
            }
        }
Example #4
0
 public void SaveProfile(ProfileModel model, int userId)
 {
     User user = session.Load<User>(userId);
     user.Profile = Mapper.Map<FFLTask.BLL.Entity.Profile>(model);
 }