Exemplo n.º 1
0
        public async Task <IActionResult> View(int noteId)
        {
            ViewNoteView model = new ViewNoteView();

            var note = await _notesService.GetNoteByIdAsync(noteId);

            if (note.DepartmentId != DepartmentId)
            {
                Unauthorized();
            }

            model.Note       = note;
            model.Department = await _departmentsService.GetDepartmentByIdAsync(note.DepartmentId);

            return(View(model));
        }
Exemplo n.º 2
0
        public IActionResult View(int noteId)
        {
            ViewNoteView model = new ViewNoteView();

            var note = _notesService.GetNoteById(noteId);

            if (note.DepartmentId != DepartmentId)
            {
                Unauthorized();
            }

            model.Note       = note;
            model.Department = _departmentsService.GetDepartmentById(note.DepartmentId);

            return(View(model));
        }