示例#1
0
        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);
        }
示例#2
0
        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");
        }
示例#3
0
        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");
        }
示例#4
0
        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);
            }
        }