private void gridEmpleados_CellClick(object sender, DataGridViewCellEventArgs e) { try { string sId = gridEmpleados.Rows[e.RowIndex].Cells[0].Value.ToString(); string sOpcion = MessageBoxEditarEliminar.ShowBox(); if (sOpcion == "1") { EmployeeAddEdit frmAdd = new EmployeeAddEdit(Int32.Parse(sId)); frmAdd.ShowDialog(); this.CargarEmpleados(); } else if (sOpcion == "2") { Servicio.DeleteEmployee(Int32.Parse(sId)); this.CargarEmpleados(); } } catch { throw; } }
public static string ShowBox() { newMessageBox = new MessageBoxEditarEliminar(); newMessageBox.ShowDialog(); return(sOpcion); }