Exemple #1
0
        public MenuModel(IDataMapper menuDataMapper, EventHandler <EventArgs> e, USUARIO ActualUser)
        {
            List <long> UnidsMenu = new List <long>();

            foreach (USUARIO_ROL ur in ActualUser.USUARIO_ROL)
            {
                if (ur.IS_ACTIVE)
                {
                    foreach (ROL_MENU rm in ur.ROL.ROL_MENU)
                    {
                        if (rm.IS_ACTIVE)
                        {
                            UnidsMenu.Add(rm.UNID_MENU);
                        }
                    }
                }
            }

            MenuDataMapper mdm = menuDataMapper as MenuDataMapper;

            if (mdm != null)
            {
                //Obtener el root del árbol
                DAL.POCOS.MENU menu = (DAL.POCOS.MENU)mdm.getElements();
                this._Parent = null;
                if (menu != null && UnidsMenu.Contains(menu.UNID_MENU))
                {
                    this.MenuName             = menu.MENU_NAME;
                    this.dataMapper           = mdm;
                    this.SelectedItemChanged += e;
                    this.GetChildren(menu, null, UnidsMenu);
                }
            }
        }
Exemple #2
0
        public MenuModel(IDataMapper menuDataMapper, EventHandler <EventArgs> e, bool b)
        {
            MenuDataMapper mdm = menuDataMapper as MenuDataMapper;

            if (mdm != null)
            {
                //Obtener el root del árbol
                DAL.POCOS.MENU menu = (DAL.POCOS.MENU)mdm.getElements();
                this._Parent = null;
                if (menu != null)
                {
                    this.MenuName             = menu.MENU_NAME;
                    this.dataMapper           = mdm;
                    this.SelectedItemChanged += e;
                    this.GetChildren(menu, null, b);
                }
            }
        }