Ejemplo n.º 1
0
        public ProfileModel GetProfile(int userId)
        {
            User user = session.Load<User>(userId);

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

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

            return model;
        }
Ejemplo n.º 3
0
        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");
            }
        }
Ejemplo n.º 4
0
 public void SaveProfile(ProfileModel model, int userId)
 {
     User user = session.Load<User>(userId);
     user.Profile = Mapper.Map<FFLTask.BLL.Entity.Profile>(model);
 }