private void dataGridViewAppointments_CellClick(object sender, DataGridViewCellEventArgs e) { int selectIDappointment = int.Parse(dataGridViewAppointments.Rows[e.RowIndex].Cells["registration_id"].Value.ToString()); string firstname = dataGridViewAppointments.Rows[e.RowIndex].Cells["patient_Fname"].Value.ToString(); string middlename = dataGridViewAppointments.Rows[e.RowIndex].Cells["patient_Mname"].Value.ToString(); string lastname = dataGridViewAppointments.Rows[e.RowIndex].Cells["patient_Lname"].Value.ToString(); string patient_status = dataGridViewAppointments.Rows[e.RowIndex].Cells["patient_status"].Value.ToString(); string patient_gender = dataGridViewAppointments.Rows[e.RowIndex].Cells["patient_gender"].Value.ToString(); string services = dataGridViewAppointments.Rows[e.RowIndex].Cells["services"].Value.ToString(); //string = dataGridViewPatients.Rows[e.RowIndex].Cells["appointmentDate"].Value.ToString(); string age = dataGridViewAppointments.Rows[e.RowIndex].Cells["age"].Value.ToString(); string address = dataGridViewAppointments.Rows[e.RowIndex].Cells["address"].Value.ToString(); string contact_num1 = dataGridViewAppointments.Rows[e.RowIndex].Cells["contact_num1"].Value.ToString(); string ref_Phys = dataGridViewAppointments.Rows[e.RowIndex].Cells["ref_Phys"].Value.ToString(); string occupation = dataGridViewAppointments.Rows[e.RowIndex].Cells["occupation"].Value.ToString(); string CPLname = dataGridViewAppointments.Rows[e.RowIndex].Cells["CPLname"].Value.ToString(); string CPFname = dataGridViewAppointments.Rows[e.RowIndex].Cells["CPFname"].Value.ToString(); string CPMname = dataGridViewAppointments.Rows[e.RowIndex].Cells["CPMname"].Value.ToString(); string CPaddress = dataGridViewAppointments.Rows[e.RowIndex].Cells["CPaddress"].Value.ToString(); string CPrelation = dataGridViewAppointments.Rows[e.RowIndex].Cells["CPrelation"].Value.ToString(); string CPcontact = dataGridViewAppointments.Rows[e.RowIndex].Cells["CPcontact"].Value.ToString(); string weight = dataGridViewAppointments.Rows[e.RowIndex].Cells["weight"].Value.ToString(); var reg = new formRegistration(selectIDappointment, firstname, middlename, lastname, patient_status, patient_gender, services, age, address, contact_num1, ref_Phys, occupation, CPLname, CPFname, CPMname, CPaddress, CPrelation, CPcontact, weight); reg.ref_To_Main = this; reg.ShowDialog(); }
private void button3_Click(object sender, EventArgs e) { formRegistration reg = new formRegistration(); reg.Show(); }