private void HRdatagridcell(object sender, DataGridViewCellEventArgs e) { HRagentID.Clear(); try { if (e.RowIndex >= 0) { HRagentID.Text = HRdatagrid.Rows[e.RowIndex].Cells["AgentID"].Value.ToString(); hragentfn.Text = HRdatagrid.Rows[e.RowIndex].Cells["AgentFirstName"].Value.ToString(); hragentln.Text = HRdatagrid.Rows[e.RowIndex].Cells["AgentLastName"].Value.ToString(); hragentphone.Text = HRdatagrid.Rows[e.RowIndex].Cells["AgentPhone"].Value.ToString(); hragentgovid.Text = HRdatagrid.Rows[e.RowIndex].Cells["Agentgovid"].Value.ToString(); hragentaddress.Text = HRdatagrid.Rows[e.RowIndex].Cells["AgentAddress"].Value.ToString(); hragentpw.Text = HRdatagrid.Rows[e.RowIndex].Cells["PW"].Value.ToString(); if (HRdatagrid.Rows[e.RowIndex].Cells["Employed"].Value.ToString() == "Y") { hragentemployed.Checked = true; } else { hragentemployed.Checked = false; } //tempdate = HRdatagrid.Rows[e.RowIndex].Cells["DateEmployed"].Value.ToString(); } } catch { } Agentadd.Hide(); }
private void HRreset_Click(object sender, EventArgs e) { HRagentID.Clear(); hragentfn.Clear(); hragentln.Clear(); hragentphone.Clear(); hragentgovid.Clear(); hragentaddress.Clear(); hragentpw.Clear(); hragentemployed.Checked = false; HRdatagrid.Rows.Clear(); Agentadd.Show(); }