public string ChangePassword(string EmailId, string Password, string NewPassword, string access_token) { //if (!User.Identity.IsAuthenticated) //{ // return "Unauthorized access"; //} try { User user = new User(); UserRepository userrepo = new UserRepository(); int i = userrepo.ChangePassword(Utility.MD5Hash(NewPassword), Utility.MD5Hash(Password), EmailId); if (i == 1) { return "Password Changed Successfully"; } else { return "Invalid EmailId"; } } catch (Exception ex) { Console.WriteLine(ex.StackTrace); return "Please Try Again"; } }
public string ChangePassword(string EmailId, string Password, string NewPassword) { try { User user = new User(); UserRepository userrepo = new UserRepository(); int i = userrepo.ChangePassword(Utility.MD5Hash(NewPassword), Utility.MD5Hash(Password), EmailId); if (i == 1) { return "Password Changed Successfully"; } else { return "Invalid EmailId"; } } catch (Exception ex) { Console.WriteLine(ex.StackTrace); return "Please Try Again"; } }