private void llenarGrillaAsignar() { RolesComponent rolesComponent = new RolesComponent(); Roles roles = new Roles(); mgDisponible.Rows.Clear(); int id = int.Parse(mgAsignarLista.CurrentRow.Cells[0].Value.ToString()); roles = rolesComponent.RolesDiponibles(id); int n = 0; foreach (var item in roles.ListaPermiso) { n = mgDisponible.Rows.Add(); mgDisponible.Rows[n].Cells[0].Value = item.Id; mgDisponible.Rows[n].Cells[1].Value = item.name; n++; } }
public ActionResult Agregar(int id) { RolesComponent rolesComponent = new RolesComponent(); Roles roles = new Roles(); roles = rolesComponent.RolesDiponibles(id); roles.listaRol.Select(y => new { y.Id, y.name }); ViewBag.ListaSedes = new SelectList(roles.listaRol, "Id", "name"); return(View(roles)); }