Esempio n. 1
0
        public IActionResult View(int id)
        {
            if (!_authorizationService.CanUserViewProtocol(UserId, id))
            {
                Unauthorized();
            }

            var model = new ViewProtocolModel();

            model.Protocol   = _protocolsService.GetProcotolById(id);
            model.Department = _departmentsService.GetDepartmentById(DepartmentId, false);

            return(View(model));
        }
Esempio n. 2
0
        public async Task <IActionResult> View(int id)
        {
            if (!await _authorizationService.CanUserViewProtocolAsync(UserId, id))
            {
                Unauthorized();
            }

            var model = new ViewProtocolModel();

            model.Protocol = await _protocolsService.GetProtocolByIdAsync(id);

            model.Department = await _departmentsService.GetDepartmentByIdAsync(DepartmentId, false);

            return(View(model));
        }