private void eDITREMOVEPATIENTToolStripMenuItem_Click(object sender, EventArgs e) { this.Hide(); EditRemove_Mgonjwa mgonjwa = new EditRemove_Mgonjwa(); mgonjwa.Show(); }
private void dataGridView2_DoubleClick(object sender, EventArgs e) { // dispalay the selected nurse in a new form to edit/remove EditRemove_Mgonjwa edit = new EditRemove_Mgonjwa(); 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.pictureBox1.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.textBoxDisease.Text = dataGridView2.CurrentRow.Cells[12].Value.ToString(); edit.textBoxDoctorsName.Text = dataGridView2.CurrentRow.Cells[13].Value.ToString(); edit.Show(); }