public static void CreateTreeViewNodesRecursive(List <Role_AuthModel> items, MVCxTreeViewNodeCollection nodesCollection, string parentCode = "")
        {
            if (items != null)
            {
                List <Role_AuthModel> items_ = items.Where(x => x.ParentCode == parentCode).ToList();

                foreach (Role_AuthModel item in items_)
                {
                    MVCxTreeViewNode node = nodesCollection.Add(item.MenuName, item.MenuCode);

                    if (item.IsAccess == "Y")
                    {
                        node.Checked = true;
                    }
                    else
                    {
                        node.Checked = false;
                    }


                    CreateTreeViewNodesRecursive(items, node.Nodes, item.MenuCode);

                    if (!string.IsNullOrEmpty(item.Url))
                    {
                        node.NodeStyle.Paddings.PaddingLeft = System.Web.UI.WebControls.Unit.Pixel(40);
                    }
                }
            }
        }
Exemplo n.º 2
0
        public static void CreateTreeViewNodesRecursive(List <TreeListModelItem> model, MVCxTreeViewNodeCollection nodesCollection, string parentID)
        {
            List <TreeListModelItem> rows = model.Where(x => x.ParentID == parentID).ToList(); // model.Select("[ParentID] = " + parentID);

            foreach (TreeListModelItem row in rows)
            {
                MVCxTreeViewNode node = nodesCollection.Add(row.Name, row.ID);
                CreateTreeViewNodesRecursive(model, node.Nodes, row.ID);
            }
        }
Exemplo n.º 3
0
        public static void CreateTreeViewNodesRecursive(List <seg_Menu_x_Empresa_x_Usuario_Info> model, MVCxTreeViewNodeCollection nodesCollection, Int32 parentID, int IdEmpresa = 0, string IdUsuario = "")
        {
            var rows = bus_menu_x_empresa_x_usuario.get_list(IdEmpresa, IdUsuario, parentID);

            foreach (seg_Menu_x_Empresa_x_Usuario_Info row in rows)
            {
                var url = string.IsNullOrEmpty(row.info_menu.web_nom_Controller) ? null :
                          ("~/" + row.info_menu.web_nom_Area + "/" + row.info_menu.web_nom_Controller + "/" + row.info_menu.web_nom_Action + "/");
                MVCxTreeViewNode node = nodesCollection.Add(row.info_menu.DescripcionMenu, row.IdMenu.ToString(), null, url);
                CreateTreeViewNodesRecursive(model, node.Nodes, row.IdMenu, IdEmpresa, IdUsuario);
            }
        }
Exemplo n.º 4
0
        public static void CreateTreeViewNodesRecursive(List <aca_Menu_x_seg_usuario_Info> model, MVCxTreeViewNodeCollection nodesCollection, Int32 parentID, int IdEmpresa = 0, int IdSede = 0, string IdUsuario = "")
        {
            //var rows = bus_menu_x_empresa_x_usuario.get_list(IdEmpresa, IdUsuario, parentID);
            var rows = seg_Menu_x_Sede_x_Usuario_Lista.get_list().Where(q => q.IdEmpresa == IdEmpresa && q.IdSede == IdSede && q.IdUsuario.ToLower() == IdUsuario.ToLower() && q.info_menu.IdMenuPadre == parentID).ToList();

            foreach (aca_Menu_x_seg_usuario_Info row in rows)
            {
                var url = string.IsNullOrEmpty(row.info_menu.web_nom_Controller) ? null :
                          ("~/" + row.info_menu.web_nom_Area + "/" + row.info_menu.web_nom_Controller + "/" + row.info_menu.web_nom_Action + "/");
                MVCxTreeViewNode node = nodesCollection.Add(row.info_menu.DescripcionMenu, row.IdMenu.ToString(), null, url);
                CreateTreeViewNodesRecursive(model, node.Nodes, row.IdMenu, IdEmpresa, IdSede, IdUsuario);
            }
        }
Exemplo n.º 5
0
        public static void CreateTreeViewNodesRecursive(DataTable data, MVCxTreeViewNodeCollection nodes, long parentId)
        {
            if (data == null || data.Rows.Count == 0)
            {
                data = Metodos.GetDataTableUnidadesOrganizativas();
            }
            var rows = data.Select("[IdUnidadPadre] = " + parentId);

            foreach (DataRow row in rows)
            {
                MVCxTreeViewNode node = nodes.Add(row["Nombre"].ToString(), row["IdUnidad"].ToString());
                CreateTreeViewNodesRecursive(data, node.Nodes, Convert.ToInt64(row["IdUnidad"]));
            }
        }
Exemplo n.º 6
0
        public static void CreateTreeViewNodesRecursive(List <ReportQueryModel> reportQueryModels, MVCxTreeViewNodeCollection nodesCollection, string parentCode = "")
        {
            if (reportQueryModels != null)
            {
                foreach (var item in reportQueryModels)
                {
                    MVCxTreeViewNode node1 = nodesCollection.Add(item.GroupName, "TvGroupQuery_" + item.GroupId.ToString());

                    var reports = item.ListQueryNames_;
                    if (reports != null)
                    {
                        foreach (var query in reports)
                        {
                            MVCxTreeViewNode node = node1.Nodes.Add(query.QueryName, "TvQuery_" + query.Id.ToString());
                            node.Image.Url         = "~/Content/Images/button/menu_default.png";
                            node.Image.Height      = 15;
                            node.Image.UrlSelected = "~/Content/Images/button/menu_selected.png";
                            //node.NodeStyle.Font.Underline = true;
                            node.NavigateUrl = "javascript:void(0)";
                        }
                    }
                }
            }
        }