private void SaveNote(int rowIndex)
        {
            object note = NotesGrid.Rows[rowIndex].Cells["NoteColumn"].Value;
            if (note == null || note.ToString().Trim() == string.Empty)
            {
                return;
            }

            DateTime noteDate = InsertDateOnNote(rowIndex);

            int noteId;
            if (NotesGrid.Rows[rowIndex].Cells["IDColumn"].Value == null)
            {
                noteId = 0;
            }
            else
            {
                bool isInt = int.TryParse(NotesGrid.Rows[rowIndex].Cells["IDColumn"].Value.ToString(), out noteId);
                if (!isInt)
                {
                    noteId = 0;
                }
            }

            DataMethods tmp = new DataMethods();
            Note savedNote = tmp.AddNote(noteId, ConversationID, noteDate, note.ToString());

            DisplayNoteInGrid(rowIndex, savedNote);
        }
        private void UserDeletingRow(object sender, System.Windows.Forms.DataGridViewRowCancelEventArgs e)
        {
            int noteId = GetNoteIdFromGrid(e.Row.Index);

            if (noteId <= 0)
            {
                // Note not in DB nothing to do.
                return;
            }

            var tmp = new DataMethods();
            tmp.DeleteNote(noteId);
        }
        private void LoadNotes(string conversationId)
        {
            NotesGrid.Rows.Clear();
            DataMethods tmp = new DataMethods();
            List<Note> notes = tmp.GetNotes(conversationId);

            foreach (Note note in notes)
            {
                int newRowIndex = NotesGrid.Rows.Add();
                DisplayNoteInGrid(newRowIndex, note);
            }
        }