public ActionResult Delete(int id, FormCollection collection) { try { // TODO: Add delete logic here RolesComponent rolesComponent = new RolesComponent(); rolesComponent.Delete(id); return(RedirectToAction("Index")); } catch { return(View()); } }
private void btnEliminarRol_Click(object sender, EventArgs e) { if (txtRol.Text == "") { MetroMessageBox.Show(this, "No selecciono un registro", "error", MessageBoxButtons.OK, MessageBoxIcon.Warning); } else { var confirmar = MetroMessageBox.Show(this, "¿Desea Borrar este registro?", "Borrar", MessageBoxButtons.YesNo, MessageBoxIcon.Information); if (confirmar == DialogResult.Yes) { RolesComponent permisoComponent = new RolesComponent(); permisoComponent.Delete(int.Parse(mgListadoRol.CurrentRow.Cells[0].Value.ToString())); llenarGrillaRoles(); } } }