public ActionResult Edit()
        {
            User user = UserBusiness.Get(HttpContext.User.Identity.Name);
            UserViewModel model = new UserViewModel();
            model.Area = user.Area;
            model.BirthDate = user.BirthDate;
            model.Email = user.Email;
            model.FirstName = user.FirstName;
            model.Gender = user.Gender;
            model.LastName = user.LastName;
            //model.Password = user.Password;
            model.PhoneNumber = user.PhoneNumber;
            model.State = user.State;
            model.StreetAddress = user.StreetAddress;

            return View(model);
        }
 public ActionResult Edit(UserViewModel model)
 {
     if (ModelState.IsValid)
     {
         User newUser = BusinessLayer.UserBusiness.Get(model.Email);
         newUser.Area = model.Area;
         newUser.BirthDate = model.BirthDate;
         newUser.FirstName = model.FirstName;
         newUser.Gender = model.Gender;
         newUser.LastName = model.LastName;
         newUser.PhoneNumber = model.PhoneNumber;
         newUser.State = model.State;
         newUser.StreetAddress = model.StreetAddress;
         newUser.Password = CreatePasswordHash(model.Password);
         BusinessLayer.UserBusiness.Update(newUser);
         RedirectToAction("Index", "Dashboard");
     }
     return View();
 }
        public ActionResult Profile(int Id)
        {
            try
            {
                User user = BusinessLayer.UserBusiness.Get(Id);
                UserViewModel viewModel = new UserViewModel
                {
                    FirstName = user.FirstName,
                    LastName = user.LastName,
                    Gender = user.Gender,
                    BirthDate = user.BirthDate,
                    Email = user.Email,
                    StreetAddress = user.StreetAddress,
                    Area = user.Area,
                    State = user.State,
                    PhoneNumber = user.PhoneNumber
                };

                return View(viewModel);
            }
            catch (DomainException e)
            {
                return View("Error", ErrorHelper.ErrorModelForDomainException(e));
            }
        }