示例#1
0
        private List <DOADM_AlertDetails> PGetAlerts(string strTitle = "", string strDescription = "", bool bolIsActive = true)
        {
            long?TimeZone = currentUser.ADM_UserPreference.TimezoneLkup != null ? currentUser.ADM_UserPreference.TimezoneLkup : (long)DefaultTimeZone.CentralStandardTime;
            //temporary object for search alert function
            DOADM_AlertDetails objDOADM_AlertDetails = new DOADM_AlertDetails();

            objDOADM_AlertDetails.IsActive         = bolIsActive;
            objDOADM_AlertDetails.AlertTitle       = strTitle;
            objDOADM_AlertDetails.AlertDescription = strDescription;
            objDOADM_AlertDetails.ConsiderDates    = false;
            List <DOADM_AlertDetails>  lstDOADM_AlertDetails;
            List <DORPT_ReportsMaster> lstDORPT_ReportsMaster;
            string         errorMessage  = string.Empty;
            ExceptionTypes result        = _objBLAlerts.SearchAlerts(TimeZone, objDOADM_AlertDetails, out lstDOADM_AlertDetails, out errorMessage);
            ExceptionTypes resultReports = _objBLReports.GetAllReports((long)ReportId.AlertsHistoryReport, string.Empty, out lstDORPT_ReportsMaster, out errorMessage);

            //check result for DB action
            if (result != (long)ExceptionTypes.Success)
            {
                BLCommon.LogError(currentUser.ADM_UserMasterId, MethodBase.GetCurrentMethod().Name, (long)ErrorModuleName.Alerts, (long)ExceptionTypes.Uncategorized, errorMessage, errorMessage);
            }
            else if (result == ExceptionTypes.ZeroRecords)
            {
                lstDOADM_AlertDetails = new List <DOADM_AlertDetails>();
            }
            objDOADM_AlertDetails.lstReports = lstDORPT_ReportsMaster;
            return(lstDOADM_AlertDetails);
        }
示例#2
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);
        }