Ejemplo n.º 1
0
        public async Task <IActionResult> Create([FromBody] CreateLogNoteModel model)
        {
            try
            {
                var user = await GetLoggedInUser();

                await _logNoteService.Create(user.Id.Value, model);

                return(Ok());
            }
            catch (Exception e)
            {
                return(HandleException(e));
            }
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> Create([FromBody] CreateLogNoteModel model)
        {
            return(await ProcessAsync(async() =>
            {
                var logNote = new LogNoteModel
                {
                    StudentId = model.StudentId,
                    TypeId = model.TypeId,
                    Message = model.Message
                };

                var author = await UserService.GetUserByPrincipal(User);

                logNote.CreatedById = author.Id;
                logNote.UpdatedById = author.Id;

                await _logNoteService.Create(logNote);

                return Ok("Log note created successfully.");
            }, Permissions.Student.StudentLogNotes.EditLogNotes));
        }