private string GetPmrCycleName(int pmrCycleId)
        {
            var pmrCycles = ClientPMRForCycleModel
                            .GetPMRCycles(IDBContext.Current.CurrentLanguage)
                            .OrderByDescending(x => x.StartDate)
                            .ToList();

            return(pmrCycles
                   .Where(pc => pc.PmrCycleId == pmrCycleId)
                   .Select(p => p.PmrCycleName)
                   .FirstOrDefault());
        }
        private PMRPublicReportModel CreateModel(PMRPublicFilterModel filterModel)
        {
            PMRPublicReportModel result = new PMRPublicReportModel();
            string language             = IDBContext.Current.CurrentLanguage;

            _filterBusinesslogic = new PMRPublicBusinessLogic();

            result.CountryDepartments =
                _filterBusinesslogic.FilterCountryDepartments(
                    ClientForGenericReports.GetCountryDepartments(language));

            result.PMRCycles = ClientPMRForCycleModel
                               .GetPMRCycles(language).OrderByDescending(x => x.StartDate).ToList();

            // don't include DRAFT validation stages, no necessary to list them
            result.PMRValidationStages =
                _filterBusinesslogic.FilterPMRValidationStages(
                    ClientForGenericReports.GetPMRValidationStages(language));

            result.OperationOverallStages =
                ClientForGenericReports.GetOperationOverallStages(language)
                .OrderBy(x => x.Name).ToList();

            result.Countries = _filterBusinesslogic.FilterCountries(
                ClientForGenericReports.GetCountries(language));

            LoadSectorsAndDivisions(result);

            List <TriStateFilter> triState = new List <TriStateFilter>();

            triState.Add(new TriStateFilter {
                Name = Localization.GetText("All"), Value = -1
            });
            triState.Add(new TriStateFilter {
                Name = Localization.GetText("Yes"), Value = 1
            });
            triState.Add(new TriStateFilter {
                Name = Localization.GetText("No"), Value = 0
            });

            result.IsActive    = triState;
            result.IsAuthorize = triState;

            result.Table = ClientForPMRPublic.GetPMRPublicTableData(filterModel);

            return(result);
        }