Exemple #1
0
        //Handover Report
        public IActionResult HandoverIndex(int id)
        {
            PDF_Docs pdf     = new PDF_Docs();
            var      docsOut = _computerRepository.GetComputer(id);

            using (MemoryStream stream = new MemoryStream())
            {
                var document = new PDF_Docs().PdfDocsSchemaHandover(docsOut);
                document.Save(stream, false);
                return(File(stream.ToArray(), "application/pdf"));
            }
        }
Exemple #2
0
        public async Task <ComputerInformation> GetComputer(int id)
        {
            var log = new Log()
            {
                Name  = "GetComputer",
                Time  = DateTime.Now,
                Index = id
            };

            await _collection.InsertOneAsync(log);

            return(await _repository.GetComputer(id));
        }