Example #1
0
        private List <DOADM_AlertDetails> GetAlerts(long lUserId)
        {
            long?              TimeZone = currentUser.ADM_UserPreference.TimezoneLkup != null ? currentUser.ADM_UserPreference.TimezoneLkup : (long)DefaultTimeZone.CentralStandardTime;
            ExceptionTypes     result;
            BLAlerts           objBLAlerts           = new BLAlerts();
            DOADM_AlertDetails objDOADM_AlertDetails = new DOADM_AlertDetails();

            objDOADM_AlertDetails.LoginUserId   = lUserId;//CreatedByRef is mapped to @loginID SQL Parameter
            objDOADM_AlertDetails.IsActive      = true;
            objDOADM_AlertDetails.ConsiderDates = true;
            result = objBLAlerts.SearchAlerts(TimeZone, objDOADM_AlertDetails, out List <DOADM_AlertDetails> lstDOADM_AlertDetails, out string strErrorMessage);
            lstDOADM_AlertDetails = lstDOADM_AlertDetails.OrderByDescending(x => x.AlertCriticalityLkup).ToList();
            //check result for DB action
            if (result != (long)ExceptionTypes.Success)
            {
                BLCommon.LogError(currentUser.ADM_UserMasterId, MethodBase.GetCurrentMethod().Name, (long)ErrorModuleName.Home, (long)ExceptionTypes.Uncategorized, strErrorMessage, strErrorMessage);
            }
            return(lstDOADM_AlertDetails);
        }