예제 #1
0
        public TaskPerCampaignViewModel GetTaskPerCampaignViewModel(Guid idCampaign, Guid idAccount, List <FilterValue> filters)
        {
            filters = filters ?? new List <FilterValue>();

            var itemResult = new TaskPerCampaignViewModel();

            filters = AddHiddenFilter("IdCampaign", idCampaign.ToString(), filters, itemResult.FilterName);

            itemResult = new TaskPerCampaignViewModel
            {
                IdCampaign           = idCampaign,
                ImplementedTasksList =
                    ConvertTask.ConvertTaskToMyTaskViewItemModel(_taskCampaignDao.GetPaginatedTasksByCampaignAndStatus(
                                                                     CTask.StatusImplemented, 1, int.MaxValue, filters, idAccount)),
                NotImplementedTasksList =
                    ConvertTask.ConvertTaskToMyTaskViewItemModel(_taskCampaignDao.GetPaginatedTasksByCampaignAndStatus(
                                                                     CTask.StatusNotImplemented, 1, int.MaxValue, filters, idAccount)),
                PendingTasksList =
                    ConvertTask.ConvertTaskToMyTaskViewItemModel(_taskCampaignDao.GetPaginatedTasksByCampaignAndStatus(
                                                                     CTask.StatusPending, 1, int.MaxValue, filters, idAccount)),
                StartedTasksList =
                    ConvertTask.ConvertTaskToMyTaskViewItemModel(_taskCampaignDao.GetPaginatedTasksByCampaignAndStatus(
                                                                     CTask.StatusStarted, 1, int.MaxValue, filters, idAccount))
            };
            return(ConfigurePagination(itemResult, 1, int.MaxValue, filters, int.MaxValue));
        }
        private List <MyTaskItemViewModel> GetTaskList(int pageIndex, int pageSize, List <FilterValue> filters, Guid idAccount, string statusTask)
        {
            var tasks = _taskCampaignDao.GetPaginatedTasksByCampaignAndStatus(statusTask, pageIndex, pageSize, filters,
                                                                              idAccount);

            return(ConvertTask.ConvertTaskToMyTaskViewItemModel(tasks));
        }