Exemplo n.º 1
0
        /// <summary>
        /// Getting kpi based on ID
        /// </summary>
        /// <param name="KPIId"></param>
        /// <returns></returns>
        public KPIViewModel GetKPIById(int KPIId)
        {
            KPIViewModel kpi = new KPIViewModel();

            try
            {
                KPI kpiDTO = _kpiRepository.GetKPIById(KPIId);
                return(BusinessMapper.MappingKPIBusinessToKPIViewModel(kpiDTO));;
            }
            catch (Exception ex)
            {
                _logger.Log(ex, LogLevel.Error, ex.Message);
                return(null);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Getting all M3Metrics KPIs
        /// </summary>
        /// <returns></returns>
        public List <KPIViewModel> GetAllM3MetricsKPIs()
        {
            List <KPIViewModel> kpisDTO = new List <KPIViewModel>();

            try
            {
                List <KPI> kpis = _kpiRepository.GetM3MetricsKPIs();
                if (kpisDTO != null)
                {
                    foreach (KPI item in kpis)
                    {
                        KPIViewModel kpiDTO = BusinessMapper.MappingKPIBusinessToKPIViewModel(item);
                        kpisDTO.Add(kpiDTO);
                    }
                }
                return(kpisDTO);
            }
            catch (Exception ex)
            {
                _logger.Log(ex, LogLevel.Error, ex.Message);
                return(null);
            }
        }