Пример #1
0
        public ResultList <DepartmentEditModel> GetDepartments(QueryOptions queryOptions, PrimeActs.Domain.ViewModels.Department.SearchObject searchObject)
        {
            int totalCount;
            var departments = _departmentService.GetDepartments(queryOptions, searchObject, out totalCount);

            queryOptions.TotalPages = (int)Math.Ceiling((double)totalCount / queryOptions.PageSize);
            return
                (new ResultList <DepartmentEditModel>(departments != null ? departments.Select(CreateFrom).ToList() : null,
                                                      queryOptions));
        }
Пример #2
0
        public DepartmentPagingModel GetDeparmentsWithPaging(QueryOptions queryOptions, PrimeActs.Domain.ViewModels.Department.SearchObject searchObject)
        {
            var totalCount            = 0;
            var departmentPagingModel = new DepartmentPagingModel();
            var departments           = _departmentService.GetDepartments(queryOptions, searchObject, out totalCount);

            queryOptions.TotalPages = (int)Math.Ceiling((double)totalCount / queryOptions.PageSize);
            var result = new ResultList <DepartmentEditModel>(departments.Select(CreateFrom).ToList(), queryOptions);

            departmentPagingModel.DepartmentEditModels = result;
            departmentPagingModel.SearchObject         = new PrimeActs.Domain.ViewModels.Department.SearchObject
            {
                DepartmentName = searchObject.DepartmentName,
            };
            return(departmentPagingModel);
        }