private void btnUpdateChild_Click(object sender, EventArgs e) { try { ChildUpdateClass UpChil = new ChildUpdateClass(); UpChil._childNo = dgvDataList.CurrentRow.Cells[0].Value.ToString(); UpChil._childName = dgvDataList.CurrentRow.Cells[1].Value.ToString(); UpChil._age = dgvDataList.CurrentRow.Cells[2].Value.ToString(); UpChil._gender = dgvDataList.CurrentRow.Cells[3].Value.ToString(); UpChil._address = dgvDataList.CurrentRow.Cells[4].Value.ToString(); UpChil._gnDivision = dgvDataList.CurrentRow.Cells[5].Value.ToString(); UpChil._motherName = dgvDataList.CurrentRow.Cells[6].Value.ToString(); UpChil._motherEdu = dgvDataList.CurrentRow.Cells[7].Value.ToString(); UpChil._fatherName = dgvDataList.CurrentRow.Cells[8].Value.ToString(); UpChil._fatherEdu = dgvDataList.CurrentRow.Cells[9].Value.ToString(); UpChil._income = dgvDataList.CurrentRow.Cells[10].Value.ToString(); UpChil.childInEdu = dgvDataList.CurrentRow.Cells[11].Value.ToString(); UpChil._contactNo = dgvDataList.CurrentRow.Cells[12].Value.ToString(); UpChil.disabilities = dgvDataList.CurrentRow.Cells[13].Value.ToString(); UpChil._birthday = dgvDataList.CurrentRow.Cells[14].Value.ToString(); UpChil._rehabilitationAct = dgvDataList.CurrentRow.Cells[15].Value.ToString(); UpChil._house = dgvDataList.CurrentRow.Cells[16].Value.ToString(); UpChil._sanitationFacilities = dgvDataList.CurrentRow.Cells[17].Value.ToString(); UpChil._donationGOV = dgvDataList.CurrentRow.Cells[18].Value.ToString(); UpChil._donation_NGO = dgvDataList.CurrentRow.Cells[19].Value.ToString(); frm_UpdateChild frmUC = new frm_UpdateChild(UpChil); frmUC.ShowDialog(); } catch (Exception ex) { MessageBox.Show(ex.Message, "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public frm_UpdateChild(ChildUpdateClass chc) { InitializeComponent(); chilData = chc; }