private void button2_Click(object sender, EventArgs e) { if (dataGridView1.SelectedRows.Count > 0) { AddEditBookingNote aebn = new AddEditBookingNote(); aebn.UserId = user.Id; int workingindex = dataGridView1.SelectedRows[0].Index; if(allbookingnotes[workingindex].Id!=0) { aebn.noteID = allbookingnotes[workingindex].Id; } else { aebn.WorkingNote = allbookingnotes[workingindex]; } aebn.ShowDialog(); if (aebn.DialogResult == DialogResult.OK) { RebindNotes(); } } }
private void button1_Click_1(object sender, EventArgs e) { AddEditBookingNote aebn = new AddEditBookingNote(); aebn.UserId = user.Id; aebn.ShowDialog(); if(aebn.DialogResult==DialogResult.OK) { newbookingNotes.Add(aebn.WorkingNote); RebindNotes(); } }