public async Task <JsonResult> Delete(string id) { IdentityResult deleteResult = await _staffManager.DeleteAsync(id); var message = deleteResult.Succeeded ? "The employee account has been successfully deleted." : deleteResult.BuildMessage(); var title = deleteResult.Succeeded ? "Completed" : "Attention"; var messageType = deleteResult.Succeeded ? "success" : "error"; return(Json(new { message, title, messageType })); }
public async Task <JsonResult> ResetPassword(string id, string password) { IdentityResult resetResult = await _staffManager .ResetPasswordWithSendOnEmail(id, password); var message = resetResult.Succeeded ? "The password was successfully changed and sent to the mail." : resetResult.BuildMessage(); var title = resetResult.Succeeded ? "Completed" : "Attention"; var messageType = resetResult.Succeeded ? "success" : "error"; return(Json(new { message, title, messageType })); }