public static string GetDisplayCssByRole(this usp_ValidateUser_Result userInfo) { var userRole = userInfo == null ? string.Empty : userInfo.ROLENAME; var hiddenClass = userRole.ToUpper() == "ADMIN" || userRole.ToUpper() == "DOCTOR" ? "display-by-role" : "hidden-by-role"; return(hiddenClass); }
public static bool IsTestUser(this usp_ValidateUser_Result userInfo) { var userRole = userInfo == null ? string.Empty : userInfo.ROLENAME; //if(userRole==null) //{ // return false; //} return(userRole.ToUpper() == "TEST"); }
public static bool IsAdmin(this usp_ValidateUser_Result userInfo) { var userRole = userInfo == null ? string.Empty : userInfo.ROLENAME; if (userRole == null) { return(false); } return(userRole.ToUpper() == "ADMIN" || userRole.ToUpper() == "DOCTOR"); }
public usp_ValidateUser_Result ValidateUser(string userName, string password) { var isValidaUser = new usp_ValidateUser_Result(); try { var resultDetails = _objLabManagementEntities.usp_ValidateUser(userName).ToList(); if (!resultDetails.Any()) { return(null); } var userData = resultDetails.FirstOrDefault(); var plainPassword = CryptoManager.passwordDecrypt(userData.LOGINPASSWORD); return(plainPassword == password ? userData : null); } catch (Exception ex) { _objIAppLogger.LogError(ex); return(isValidaUser); } }