private void DisplayNoteInGrid(int rowIndex, Note note) { NotesGrid.Rows[rowIndex].Cells["IDColumn"].Value = note.Id; NotesGrid.Rows[rowIndex].Cells["ConversationIDColumn"].Value = note.ConversationID; NotesGrid.Rows[rowIndex].Cells["DateColumn"].Value = note.NoteDate; NotesGrid.Rows[rowIndex].Cells["NoteColumn"].Value = note.Notes; }
public Note AddNote(Note note) { if (note.Id <= 0) { _context.Notes.Add(note); } _context.SaveChanges(); return note; }
public Note AddNote(int noteId, string ConversationID, DateTime NoteDate, string Notes) { Note newNote; if (noteId <= 0) { newNote = new Note(); } else { newNote = (from note in _context.Notes where note.Id == noteId select note).FirstOrDefault(); } newNote.ConversationID = ConversationID; newNote.NoteDate = NoteDate; newNote.Notes = Notes; return AddNote(newNote); }