private void eDITREMOVESTAFFToolStripMenuItem_Click(object sender, EventArgs e) { this.Hide(); EditRemove_Doctor editRemove_Doctor = new EditRemove_Doctor(); editRemove_Doctor.Show(); }
private void dataGridView2_DoubleClick(object sender, EventArgs e) { //// dispalay the selected doctor in a new form to edit/remove // dispalay the selected nurse in a new form to edit/remove EditRemove_Doctor edit = new EditRemove_Doctor(); edit.textBoxID.Text = dataGridView2.CurrentRow.Cells[0].Value.ToString(); edit.textBoxFirstName.Text = dataGridView2.CurrentRow.Cells[1].Value.ToString(); edit.textBoxLastName.Text = dataGridView2.CurrentRow.Cells[2].Value.ToString(); //gender if (dataGridView2.CurrentRow.Cells[3].Value.ToString() == "Female") { edit.radioButtonFemale.Checked = true; } edit.dateTimePicker1.Value = (DateTime)dataGridView2.CurrentRow.Cells[4].Value; edit.textBoxPhoneNumber.Text = dataGridView2.CurrentRow.Cells[5].Value.ToString(); edit.textBoxAddress.Text = dataGridView2.CurrentRow.Cells[6].Value.ToString(); //the image byte[] pic; pic = (byte[])dataGridView2.CurrentRow.Cells[7].Value; MemoryStream Picture = new MemoryStream(pic); edit.pictureBox2.Image = Image.FromStream(Picture); edit.textBoxCountry.Text = dataGridView2.CurrentRow.Cells[8].Value.ToString(); edit.textBoxCity.Text = dataGridView2.CurrentRow.Cells[9].Value.ToString(); edit.textBoxEmail.Text = dataGridView2.CurrentRow.Cells[10].Value.ToString(); edit.textBoxPassport.Text = dataGridView2.CurrentRow.Cells[11].Value.ToString(); edit.comboBoxAuthentication.Text = dataGridView2.CurrentRow.Cells[12].Value.ToString(); edit.Show(); }