public static bool ChangePassword(BOM.User user, String pass) { String encrypted = Encrypted.GetEncrypted(pass); if (DAL.AuthenticationDal.UpdatePassword(user, encrypted)) { String res = BOL.SendMail(user.email, "password for watershed is updated", "updated password is: " + pass); return(true); } return(false); }
public static String ForgetPassword(BOM.User user) { BOM.User users = DAL.AuthenticationDal.checkEmail(user); if (null == users) { return("fail"); } String newpass = BOL.RandomNum(); if (ChangePassword(users, newpass)) { return("success"); } return("fail"); }