Пример #1
0
        public async Task <IActionResult> ListByOrganisationAsync(int organisationId, int pageNumber = 1)
        {
            try
            {
                CurrentPageNumber = pageNumber;


                var entities = await BusinessServiceManager.ListByOrganisationAsync(organisationId, CurrentPageNumber);

                CurrentPageNumber = 0;

                if (entities == null || !entities.Any())
                {
                    return(NotFound());
                }

                var result = IMapper.Map <List <Employee>, List <EmployeeViewModel> >(entities);

                return(Ok(result));
            }
            catch (Exception ex)
            {
                LogException(ex);
                return(StatusCode(500));
            }
        }
Пример #2
0
        public async Task <IActionResult> List(int organisationId, int pageNumber = 1)
        {
            var entities = await BusinessServiceManager.ListByOrganisationAsync(organisationId, pageNumber);

            var viewModels = ConvertEntityToViewModel(entities);

            return(View(viewModels));
        }