예제 #1
0
        public async Task <IActionResult> Details(int?id)
        {
            if (id == null)
            {
                return(StatusCode(StatusCodes.Status400BadRequest));
            }
            var model = (RequestsViewModel)modelMapper.Map(await repository.GetRequest((int)id), typeof(Requests), typeof(RequestsViewModel));

            if (model == null)
            {
                return(StatusCode(StatusCodes.Status404NotFound));
            }
            return(View(model));
        }
예제 #2
0
        /// <summary>
        /// Process a received FastCGI message
        /// </summary>
        /// <param name="message"></param>
        protected virtual void ReceiveMessage(Message message)
        {
            var requestId   = message.Header.RequestId;
            var requestType = message.Header.MessageType;

            _logger.Log(LogLevel.Verbose, "Received message (request {0}) {1} of length {2}", requestId, requestType, message.Body.Count);

            switch (requestType)
            {
            case MessageType.BeginRequest:
                this.BeginRequest(message);
                break;

            case MessageType.AbortRequest:
                _requestsRepository.GetRequest(requestId).Abort();
                break;

            case MessageType.Params:
                _requestsRepository.GetRequest(requestId).ParametersStream.Append(message.Body);
                break;

            case MessageType.StandardInput:
                if (message.Header.ContentLength > 0)
                {
                    _requestsRepository.GetRequest(requestId).InputStream.Append(message.Body);
                }
                else
                {
                    _requestsRepository.GetRequest(requestId).Execute();
                }
                break;

            case MessageType.Data:
                _requestsRepository.GetRequest(requestId).DataStream.Append(message.Body);
                break;

            case MessageType.GetValues:
                this.SendGetValuesResult(message.Body);
                break;

            default:
                break;
            }
        }
예제 #3
0
        public async Task <IActionResult> OnGetAsync(int id)
        {
            Requests = await _db.GetRequest(id); //получаем запись из БД

            if (Requests == null)
            {
                return(NotFound());
            }
            return(Page());
        }
예제 #4
0
        public async Task <IActionResult> OnGetAsync(int id)
        {
            Requests = await _db.GetRequest(id); //получаем запись из БД

            if (Requests == null)
            {
                return(NotFound());
            }
            await _db.UpdateStatus(Requests); //меняем статус сообщения на 'Прочитано'

            return(Page());
        }
        public PartialViewResult ConfirmDenyRequest(Guid requestId)
        {
            var request = _rep.GetRequest(requestId);

            return(PartialView("Delete", request));
        }