public void ChangePassword(int id, string password) { var user = GetByID(id); user.Password = EncriptServise.EncryptData(password); Save(user); }
public SingIn ResetPassword(List <SingIn> users, string email) { string decriptedEmail; for (int i = 0; i < users.Count; i++) { decriptedEmail = EncriptServise.DencryptData(users[i].Email); if (email == decriptedEmail) { return(users[i]); } } return(null); }
public List <string> AutoLogin() { List <string> loginInfo = new List <string>(); HttpCookie cookie = HttpContext.Current.Request.Cookies["UserInformation"]; try { loginInfo.Add(EncriptServise.DencryptData(cookie["username"])); loginInfo.Add(EncriptServise.DencryptData(cookie["password"])); } catch (NullReferenceException) { } return(loginInfo); }