Example #1
0
 public IActionResult Index(string name, string pass, DateTime birthDay, string skype, string phone)
 {
     if (User.Identity.IsAuthenticated)
     {
         if (!string.IsNullOrEmpty(name))
         {
             currentUser.Name = name;
         }
         if (!string.IsNullOrEmpty(pass) && currentUser.Pass != Security.Encrypt(pass))
         {
             currentUser.Pass = Security.Encrypt(pass);
         }
         if (!string.IsNullOrEmpty(skype))
         {
             currentUser.Skype = skype;
         }
         if (!string.IsNullOrEmpty(phone))
         {
             currentUser.Phone = phone;
         }
         if (birthDay > DateTime.MinValue)
         {
             currentUser.BirthDay = birthDay;
         }
         _userService.Save(currentUser);
     }
     return(View());
 }