public async Task <IActionResult> GetSystemParametersService(string code)
        {
            if (!User.Identity.IsAuthenticated)
            {
                throw new AuthenticationException();
            }
            var systemParametersService = await _systemParametersService.GetSystemParameters(code);

            var systemParametersServiceDto = _mapper.Map <SystemParametersDto>(systemParametersService);
            var response = new ApiResponse <SystemParametersDto>(systemParametersServiceDto);

            return(Ok(response));
        }
Beispiel #2
0
        public SPRes GetSystemParameters()
        {
            logger.Info(Environment.NewLine + DateTime.Now.ToString("dd/MM/yyyy HH:mm:ss") + Environment.NewLine);

            logger.Info(string.Format("{0}.{1} - START", this.GetType().Name, MethodBase.GetCurrentMethod().Name));

            var requestHeader = Request;

            var headers = requestHeader.Headers;

            if (headers.Contains("esFilters"))
            {
                searchFilters = headers.GetValues("esFilters").First();
            }

            SearchFiltersReq req = Newtonsoft.Json.JsonConvert.DeserializeObject <SearchFiltersReq>(searchFilters);

            SPRes objRes = _spService.GetSystemParameters(req);

            logger.Info(string.Format("{0}.{1} - END", this.GetType().Name, MethodBase.GetCurrentMethod().Name));

            return(objRes);
        }