private void Button1_Click(object sender, EventArgs e) { Add_appointment ad = new Add_appointment(); Close(); ad.Show(); }
private void Button2_Click(object sender, EventArgs e) { if (dataGridView1.CurrentRow.Index != -1) { Add_appointment ad = new Add_appointment(Convert.ToInt32(dataGridView1.CurrentRow.Cells[0].Value), Convert.ToInt32(dataGridView1.CurrentRow.Cells[1].Value), Convert.ToDateTime(dataGridView1.CurrentRow.Cells[2].Value), dataGridView1.CurrentRow.Cells[3].Value.ToString()); Close(); ad.Show(); } }