예제 #1
0
        public ActionResult EditProfile()
        {
            ProfileViewModel profileViewModel = new ProfileViewModel();
            if (Session["user"] == null)
                return RedirectToAction("Login", "Account");

            profileViewModel.Heights = GetAllHeights();

            profileViewModel.Occupations = GetAllOccupations();
            var temp = (UserProfileModel) Session["user"];
            profileViewModel.UserProfile = _entityUser.GetUser(temp.Email).MapServerToClient();
            profileViewModel.DateOfBirthString = profileViewModel.UserProfile.DateOfBirth.ToShortDateString();
           
            return View(profileViewModel);
        }
예제 #2
0
 public ActionResult EditProfile(ProfileViewModel user)
 {
     var temp = (UserProfileModel) Session["user"];
     
     if (_entityUser.UpdateProfile(user.UserProfile.MapClientToServer()))
     {
         ViewBag.changed = true;
         temp = _entityUser.GetUser(temp.Email).MapServerToClient();
         Session["user"] = temp;
         return RedirectToAction("EditProfile", Session["user"]);
     }
     return View("Error");
 }