Наследование: Entity
 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;
 }
Пример #2
0
        public Note AddNote(Note note)
        {
            if (note.Id <= 0)
            {
                _context.Notes.Add(note);
            }
            _context.SaveChanges();

            return note;
        }
Пример #3
0
        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);
        }