private void btnAdd_Click(object sender, EventArgs e) { frmFamily familyDetils = new frmFamily("EmployeeContactDetails"); familyDetils.objEmpContactDetails = this; familyDetils.ShowDialog(); }
private void dgvFamilyDetails_CellClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex > -1) { if (e.ColumnIndex == dgvFamilyDetails.Columns["Edit"].Index) { DataGridViewRow dgvr = dgvFamilyDetails.Rows[e.RowIndex]; string memberName = dgvFamilyDetails.Rows[e.RowIndex].Cells["HAFD_FAMILY_MEMBER_NAME"].Value.ToString(); string relatiom = dgvFamilyDetails.Rows[e.RowIndex].Cells["HAFD_FAMILY_MEMBER_RELATIONSHIP"].Value.ToString(); DateTime dob = Convert.ToDateTime(dgvFamilyDetails.Rows[e.RowIndex].Cells["HAFD_FAMILY_MEMBER_DOB"].Value); string residing = dgvFamilyDetails.Rows[e.RowIndex].Cells["HAFD_RESIDING_WITH_APPLICANT"].Value.ToString(); string depending = dgvFamilyDetails.Rows[e.RowIndex].Cells["HAFD_DEPENDING_ON_APPLICANT"].Value.ToString(); string occupation = dgvFamilyDetails.Rows[e.RowIndex].Cells["HAFD_FAMILY_MEMBER_OCCUPATION"].Value.ToString(); frmFamily familyDetils = new frmFamily("EmployeeContactDetails", memberName, relatiom, dob, residing, depending, occupation, dgvr); familyDetils.objEmpContactDetails = this; familyDetils.ShowDialog(); } } }