Ejemplo n.º 1
0
        /// <summary>
        /// ساختن درخت دسترسی در فرم دسترسی
        /// </summary>
        /// <returns></returns>
        public string GenerateAccessTree()
        {
            string result = "";

            using (var context = new Hamid.HamidDbContext())
            {
                var accessList = context.Accesses.OrderBy(e => e.ParentID).ThenBy(e => e.Order).ToList();
                result = GenerateAccessTreeRecursive(accessList, 0);
            }
            return(result.ToString());
        }
Ejemplo n.º 2
0
        /// <summary>
        /// ساختن منو کنار صفحه
        /// </summary>
        /// <returns></returns>
        public string GenerateSidebarMenu()
        {
            string result = "";

            using (var context = new Hamid.HamidDbContext())
            {
                var accessList = context.Accesses.Where(e => e.IsMenu == true).OrderBy(e => e.ParentID).ThenBy(e => e.Order).ToList();
                result = GenerateSidebarMenuRecursive(accessList, 1);
            }
            return(result.ToString());
        }