Exemplo n.º 1
0
        public async Task <OutbreakDocument> Execute(UploadDocument command)
        {
            var documentId = (int)await sequenceGenerator.GetNextAsync(SequenceType.EpiDocument);

            var document = new EpiDocument
            {
                BlEpiDocument     = command.FilesBytes,
                DsMimeContentType = command.MIMEType,
                IdEpiDocument     = documentId
            };

            var obDocument = new OutbreakDocument
            {
                IdEpiDocument     = documentId,
                NmFile            = command.FileName,
                CdEpiDocumentType = command.DocumentType,
                DsDesc            = command.Description,
                DtEpiDocument     = command.DocumentDate,
                IdSequence        = command.Sequence,
                IdOutbreak        = command.OutbreakId
            };

            await writeContext.EpiDocument.AddAsync(document);

            await writeContext.OutbreakDocument.AddAsync(obDocument);

            await writeContext.SaveChangesAsync();

            return(obDocument);
        }
Exemplo n.º 2
0
 public CvlUtility(Configuration cvlUtilConfig, inRiverContext inRiverContext)
 {
     CvlUtilConfig     = cvlUtilConfig;
     _context          = inRiverContext;
     _epiElement       = new EpiElement(inRiverContext);
     _epiMappingHelper = new EpiMappingHelper(inRiverContext);
     _businessHelper   = new BusinessHelper(_context);
     _epiDocument      = new EpiDocument(_context, cvlUtilConfig);
     _channelHelper    = new ChannelHelper(_context);
     _epiApi           = new EpiApi(_context);
 }
Exemplo n.º 3
0
 public AddUtility(Configuration connectorConfig, inRiverContext inRiverContext)
 {
     ConnectorConfig = connectorConfig;
     _context        = inRiverContext;
     _epiDocument    = new EpiDocument(inRiverContext, connectorConfig);
 }