public ActionResult DeleteComposite(int id) { RolesComponent rolesComponent = new RolesComponent(); Roles roles = new Roles(); roles = rolesComponent.ReadBy(id); roles.listaRol = rolesComponent.ObtenerPermisosORolesDeUnRol(id); roles.listaRol.Select(y => new { y.Id, y.name }); ViewBag.ListaSedes = new SelectList(roles.listaRol, "Id", "name"); return(View(roles)); }
private void llenarGrillaABM() { if (mgABMComposite.CurrentRow.Cells[0].Value == null) { MetroMessageBox.Show(this, "No selecciono un rol", "error", MessageBoxButtons.YesNo, MessageBoxIcon.Warning); } else { mgABMQuitar.Rows.Clear(); List <Arbol> roles = new List <Arbol>(); int n = 0; RolesComponent rolesComponent = new RolesComponent(); roles = rolesComponent.ObtenerPermisosORolesDeUnRol(int.Parse(mgABMComposite.CurrentRow.Cells[0].Value.ToString())); foreach (var item in roles) { n = mgABMQuitar.Rows.Add(); mgABMQuitar.Rows[n].Cells[0].Value = item.Id; mgABMQuitar.Rows[n].Cells[1].Value = item.name; n++; } } }