public void AddNewNoteProfileToStudentByStudentId(NoteProfileFullServiceModel noteToAdd) { this.db.Notes.Add(new Note { StatusNote = (EnumStatusNote)noteToAdd.StatusNote, Title = noteToAdd.Title, Comment = noteToAdd.Comment, DateReceived = noteToAdd.DateReceived, DateConfirmed = noteToAdd.DateConfirmed, StudentId = noteToAdd.StudentId, SubjectId = noteToAdd.SubjectId, TeacherId = noteToAdd.TeacherId, }); db.SaveChanges(); }
public IActionResult AddNote(NoteProfileFullToAddViewModel noteProfileToAdd, int id) { var noteProfileServiceModelToAdd = new NoteProfileFullServiceModel { StudentId = id, SubjectId = (int)noteProfileToAdd.Subject, Title = noteProfileToAdd.Title, Comment = noteProfileToAdd.Comment, DateReceived = noteProfileToAdd.DateReceived, TeacherId = 25, StatusNote = (int)noteProfileToAdd.StatusNote, }; this.noteService.AddNewNoteProfileToStudentByStudentId(noteProfileServiceModelToAdd); return(this.RedirectToAction("NoteApproved", new { id = id })); }