コード例 #1
0
ファイル: ProtocolsController.cs プロジェクト: Resgrid/Core
        public async Task <IActionResult> Index()
        {
            var model = new ProtocolIndexModel();

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

            return(View(model));
        }
コード例 #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));
        }