private void ReloadPageAndFilters(dtoModuleContext context, dtoBaseFilters filters, int pageIndex, int pageSize) { List <TemplateDisplay> items = Service.GetAvailableTemplateDisplay(context.GetStandardType(), context.IdCommunity, UserContext.CurrentUserID, context.ModuleCode); items = items.Where(i => View.AvailableDisplay.Contains(i)).ToList(); if (!items.Contains(filters.TemplateDisplay)) { filters.TemplateDisplay = items[0]; filters.PageIndex = 0; pageIndex = 0; } View.ReloadPageAndFilters(filters, items, filters.TemplateDisplay); LoadTemplates(context, filters, pageIndex, pageSize); }
private void InitializeView(dtoModuleContext context, dtoBaseFilters filters, List <TemplateType> availableType, List <TemplateDisplay> availableDisplay) { View.AvailableDisplay = availableDisplay; View.AvailableTypes = availableType; View.ContainerContext = context; View.CurrentType = filters.TemplateType; View.CurrentFilters = filters; List <TemplateDisplay> items = Service.GetAvailableTemplateDisplay(context.GetStandardType(), context.IdCommunity, UserContext.CurrentUserID, context.ModuleCode); items = items.Where(i => availableDisplay.Contains(i)).ToList(); if (!items.Contains(filters.TemplateDisplay)) { filters.TemplateDisplay = items[0]; } View.LoadTemplateDisplay(items, filters.TemplateDisplay); //filters.CallType = type; //View.LoadSubmissionStatus(items, filters.Status); InternalTemplates(context, filters, filters.PageIndex, (filters.PageSize == 0) ? View.CurrentPageSize : filters.PageSize); }