public static async Task <bool> CmdUserChangePassword(TSUser ParTSUser) { string a = await WebApiFunctions.CmdTSUserChangePassword(ParTSUser); if (a.Equals("OK")) { LocalFunctions.AddMessage("Password was changed successfully, please login again", true, false); LocalData.btModal.Close(); LocalFunctions.Logout(); return(true); } else { LocalFunctions.AddError(a, MethodBase.GetCurrentMethod(), true, false); return(false); } }
public static async Task <bool> CmdSendMail(string ParTo, EmailOperationsEnum ParEmailOperationsEnum) { TSEmail ParTSEmail = new TSEmail { To = ParTo, OperationCode = (int)ParEmailOperationsEnum }; TSEmail tsEmail = await WebApiFunctions.CmdSendEmail(ParTSEmail); if (tsEmail.Result.Equals("OK")) { LocalFunctions.AddMessage("Email was sent successfully, please check inbox, code is valid for 2 minutes", true, false); return(true); } else { LocalFunctions.AddError(tsEmail.Result, MethodBase.GetCurrentMethod(), true, false); return(false); } }
public static async Task <bool> CmdRecoverPass(string ParUserName, EmailOperationsEnum ParEmailOperationsEnum) { TSEmail ParTSEmail = new TSEmail { To = ParUserName, OperationCode = (int)ParEmailOperationsEnum }; TSEmail tsEmail = await WebApiFunctions.CmdRecoverPass(ParTSEmail); if (tsEmail.Result.Equals("OK")) { LocalFunctions.AddMessage("Password recovered successfully, new password was sent to your email", true, false); return(true); } else { LocalFunctions.AddError(tsEmail.Result, MethodBase.GetCurrentMethod(), true, false); return(false); } }