Exemplo n.º 1
0
 public ActionResult EditProfileBasic(ProfileModel model)
 {
     if(ModelState.IsValid)
     {
         if (string.IsNullOrWhiteSpace(model.EmailAddress))
         {
             ModelState.AddModelError("", "Email address may not be empty.");
         }
         else
         if (MembershipService.ChangeEmail(User.Identity.Name, model.EmailAddress) == false)
         {
             ModelState.AddModelError("", "New email address is not valid.");
         }
     }
     return RedirectToAction("EditProfile");
 }
Exemplo n.º 2
0
 public ActionResult EditProfileDetails(ProfileModel model)
 {
     if (ModelState.IsValid)
     {
         if (string.IsNullOrWhiteSpace(model.Theme))
         {
             ModelState.AddModelError("", "A theme must be selected.");
         }
         else
         {
             this.HttpContext.Profile.SetPropertyValue("Theme", model.Theme);
         }
     }
     return RedirectToAction("EditProfile");
 }