public virtual JsonResult Search(PmrCycleFilter filter)
        {
            if (!IDBContext.Current.HasRole(Role.RM_ADMINISTRATOR))
            {
                return(Json(new { }));
            }

            // Set page and pagesize values according to the needs of every view
            PagingHelper      pageHelper        = new PagingHelper();
            QuerySettingsPage querySettingsPage = pageHelper.GetQueryPageConfiguration(
                filter.Page,
                PageDefaultSetUp.DefaultPagePmrCycle,
                filter.Size,
                PageDefaultSetUp.DefaultPageSizePmrCycle);

            // Get paged data
            var pmrCycles = this.Close_PMR_Cycle.Search(ref querySettingsPage, filter);

            // Set Paging information to send to the view
            PageSettings pageSettings = pageHelper.GetPagingInformation(querySettingsPage);

            pageSettings.BaseURL = Url.Action("Search", "CloseOfPMRCycle");

            pmrCycles.ForEach(x =>
            {
                x.CycleClosingDateString = string.Format("{0:dd MMM yyy}", x.CycleClosingDate);
                x.CycleClosingDate       = null;
            });

            return(Json(new { PmrCycles = pmrCycles, PageSettings = pageSettings }));
        }
        public virtual JsonResult Search(PredefinedIndicatorFilter filter)
        {
            // Set page and pagesize values according to the needs of every view
            PagingHelper      pageHelper        = new PagingHelper();
            QuerySettingsPage querySettingsPage = pageHelper.GetQueryPageConfiguration(
                filter.Page,
                PageDefaultSetUp.DefaultPagePredefineIndicator,
                filter.Size,
                PageDefaultSetUp.DefaultPageSizePredefineIndicator);

            // Get paged data
            var indicators = this.ClientPredefinedIndicator.GetFilteredIndicators(
                ref querySettingsPage, filter);

            // Set Paging information to send to the view
            PageSettings pageSettings = pageHelper.GetPagingInformation(querySettingsPage);

            pageSettings.BaseURL = Url.Action("Search", "PredefinedIndicator");

            return(Json(new { Indicators = indicators, PageSettings = pageSettings }));
        }
Exemplo n.º 3
0
        public virtual JsonResult Search(PredefinedIndicatorFilter filter = null)
        {
            // Set page and pagesize values according to the needs of every view
            PagingHelper      pageHelper        = new PagingHelper();
            QuerySettingsPage querySettingsPage = pageHelper.GetQueryPageConfiguration(
                filter.Page,
                PageDefaultSetUp.DefaultPagePredefineIndicator,
                filter.Size,
                PageDefaultSetUp.DefaultPageSizePredefineIndicator);

            // Get paged data
            var indicators = this.PredefinedIndicatorModelRepository.GetFilteredIndicators(ref querySettingsPage, filter);

            // Set detail url
            indicators.ForEach(ind => ind.DetailUri = Url.Action("Detail", "PredefinedIndicators", new { area = "Administration" }));

            // Set Paging information to send to the view
            PageSettings pageSettings = pageHelper.GetPagingInformation(querySettingsPage);

            pageSettings.BaseURL = Url.Action("Search", "PredefinedIndicators", new { area = "Administration" });

            return(Json(indicators));
        }