Example #1
0
        //TODO возможно информацию нужно будет брать еще и с материалов
        public void GetRequisitionInfo(GetRequisitionInfoArgument argument, GetRequisitionInfoResult result)
        {
            var image = _niisContext.Requests
                        .Where(x => x.Barcode == argument.DocumentID)
                        .Select(x => x.Image)
                        .FirstOrDefault();

            if (image != null)
            {
                if (_validationHelper.SenderIsPep(argument.SystemInfo.Sender))
                {
                    var shepFile = _attachFileHelper.ShepFileUpload(image, ImageName);
                    result.Image = new File {
                        ShepFile = shepFile
                    };
                }
                else
                {
                    result.Image = new File {
                        Content = image, Name = ImageName
                    };
                }
            }
            result.ApplicantList = GetApplicants(argument.DocumentID).ToArray();
            result.DocumentID    = argument.DocumentID;
        }
        public GetRequisitionInfoResult GetRequisitionInfo(GetRequisitionInfoArgument argument)
        {
            var result = new GetRequisitionInfoResult();
            var query  = new GetRequisitionInfo.Query {
                Argument = argument, Result = result
            };

            _mediator.Send(query).Wait();
            return(result);
        }