Exemplo n.º 1
0
        public async Task <IActionResult> Index()
        {
            var model = new ProtocolIndexModel();

            model.Protocols = await _protocolsService.GetAllProtocolsForDepartmentAsync(DepartmentId);

            return(View(model));
        }
Exemplo n.º 2
0
        public async Task <ActionResult <List <ProtocolResult> > > GetAllProtocols()
        {
            var results    = new List <ProtocolResult>();
            var department = await _departmentsService.GetDepartmentByIdAsync(DepartmentId, false);


            var protocols = await _protocolsService.GetAllProtocolsForDepartmentAsync(DepartmentId);

            foreach (var p in protocols)
            {
                results.Add(ProtocolResult.Convert(p));
            }

            return(Ok(results));
        }