private void btnDelete_Click(object sender, EventArgs e) { DialogResult dialogResult = MessageBox.Show("Are you sure you wanna delete this? ", "Delete Employee", MessageBoxButtons.YesNo); if (dialogResult == DialogResult.Yes) { int index = this.gridServiceStaff.Rows.IndexOf((GridViewDataRowInfo)this.gridServiceStaff.CurrentRow); if (index < 0) { return; } Employess employess = (Employess)gridServiceStaff.Rows[index].DataBoundItem; if (employess != null) { employessBll.Remove(employess.ID); } } else if (dialogResult == DialogResult.No) { this.Hide(); StaffForm form = new StaffForm(); form.ShowDialog(); } }
private void btnRefresh_Click(object sender, EventArgs e) { this.Hide(); StaffForm stf = new StaffForm(); stf.ShowDialog(); }