Ejemplo n.º 1
0
        private void buttonAddNote_Click(object sender, EventArgs e)
        {
            Hide();
            AddNote note = new AddNote();

            note.ShowDialog();
            Close();
        }
Ejemplo n.º 2
0
 private void dataGridViewNotes_CellContentClick(object sender, DataGridViewCellEventArgs e)
 {
     if (e.ColumnIndex == dataGridViewNotes.Columns["Delete"].Index && e.RowIndex >= 0)
     {
         string title = dataGridViewNotes.Rows[e.RowIndex].Cells[0].Value.ToString();
         DatabaseConnection.GetInstance().Delete(title);
         dataGridViewNotes.Rows.Remove(dataGridViewNotes.Rows[e.RowIndex]);
     }
     else if (e.ColumnIndex == dataGridViewNotes.Columns["ShowEdit"].Index && e.RowIndex >= 0)
     {
         Hide();
         AddNote note        = new AddNote();
         string  title       = dataGridViewNotes.Rows[e.RowIndex].Cells[0].Value.ToString();
         string  noteContent = dataGridViewNotes.Rows[e.RowIndex].Cells[1].Value.ToString();
         int     noteId      = int.Parse(dataGridViewNotes.Rows[e.RowIndex].Cells[5].Value.ToString());
         note.SetValues(title, noteContent, noteId);
         note.ShowDialog();
         Close();
     }
 }