示例#1
0
        private void MostrarModulos(int idSistema)
        {
            //Muestra modulos e items de la aplicacion
            try
            {
                NegocioAdmin negAdmin = new NegocioAdmin(sistema.USR_LOGIN, sistema.PASS);

                E.VMSistema    sis   = negAdmin.ObtenerInformacionSistemas(idSistema);
                List <E.VMRol> roles = negAdmin.ObtenerRoles(0);
                lblNomModuloSel.InnerText = sis.NombreSistema;
                hidIdApp.Value            = idSistema.ToString();
                CargarArbolSistema(idSistema);
                rtvModulos.DataBind();
                ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "openWinModulo", "openWinModulo()", true);
            }
            catch (Exception ex)
            {
                Master.MostrarMensajeError(ex.Message);
            }
        }
示例#2
0
        private void CargarArbolSistema(int idSistema)
        {
            NegocioAdmin negAdmin = new NegocioAdmin(sistema.USR_LOGIN, sistema.PASS);

            rtvModulos.Nodes.Clear();
            E.VMSistema       sis     = negAdmin.ObtenerInformacionSistemas(idSistema);
            List <E.VMModulo> modulos = negAdmin.ObtenerModulosSistema(idSistema, null);//todos


            /*LIST_ITEMS = null;
             *
             *
             *
             * List<E.VMItemModulo> items = LIST_ITEMS;
             * var sistem = (from x in items
             *            group x by x.IdSistema into g
             *            select new
             *            {
             *                IdSistema = g.Key,
             *                item = g.ToList()
             *            }
             *                  ).ToList();*/
            //Agrega sistemas

            RadTreeNode nodeSistema = new RadTreeNode(sis.NombreSistema, sis.IdSistema.ToString());

            nodeSistema.Category = "SISTEMA";

            /*   var modulos = (from x in sistem[i].item
             *                group x by x.IdModulo into g
             *                select new
             *                {
             *                    IdModulo = g.Key,
             *                    item = g.ToList()
             *                }
             *                 ).ToList();*/
            //Agregar modulos de sistema
            for (int j = 0; j < modulos.Count; j++)
            {
                /*List<E.VMItemModulo> itemsAsignados = new NegocioAdmin(sistema.USR_LOGIN, sistema.PASS).ObtenerItemsRolAsignados(
                 *  Convert.ToInt32(hidIdRolPermisos.Value));*/
                RadTreeNode nodeModulo = new RadTreeNode(modulos[j].Nombre /*modulos[j].item[0].Modulo*/, modulos[j].IdModulo.ToString() /* modulos[j].IdModulo.ToString()*/);
                nodeModulo.Category = "MODULO";
                TemplateNode template = new TemplateNode();
                template.eventoAgregar  = linkRegistrarPaginaModulo_Click;
                template.eventoDetalles = linkDetalleModuloItem_Click;
                template.eventoEditar   = linkEditarModuloItem_Click;
                template.eventoEliminar = linkEliminarModuloItem_Click;

                nodeModulo.NodeTemplate = template;
                if (modulos[j].Items != null)
                {
                    List <E.VMItemModulo> nodosHijos = (from x in modulos[j].Items
                                                        where x.IdItemPadre == 0
                                                        select x).ToList();

                    AgregarNodosHijos(nodeModulo,
                                      nodosHijos
                                      , 0, modulos[j].Items.ToList());
                    nodeSistema.Nodes.Add(nodeModulo);
                }
            }

            rtvModulos.Nodes.Add(nodeSistema);


            rtvModulos.DataBind();
            rtvModulos.ExpandAllNodes();
        }