Exemple #1
0
 private void NavBind()
 {
     var adminEntity = GetAdminInfo();
     var bll = new NavigationService(new NavigationRepository(siteConfig.sysdatabaseprefix));
     DataTable dt = new DataTable();
     bool isAgent = false;
     if (adminEntity.AgentLevel > 0)
     {
         isAgent = true;
     }
     dt = bll.GetList(0, MXEnums.NavigationEnum.System.ToString(), isAgent, new SystemConfigRepository());
     this.rptList.DataSource = dt;
     this.rptList.DataBind();
 }
        private void get_navigation_list(HttpContext context)
        {
            var adminModel = new ManagePage().GetAdminInfo(); //获得当前登录管理员信息
            if (adminModel == null)
            {
                return;
            }
            var roleModel = new ManagerRoleService()
                .GetModel(adminModel.RoleId); //获得管理角色信息

            if (roleModel == null)
            {
                return;
            }
            DataTable dt = new NavigationService(new NavigationRepository(siteConfig.sysdatabaseprefix))
                .GetDataList(0, MXEnums.NavigationEnum.System.ToString());
            this.get_navigation_childs(context, dt, 0, "", roleModel.RoleType, roleModel.ManagerRoleValues.ToList());

        }
 private void navigation_validate(HttpContext context)
 {
     string navname = MXRequest.GetString("param");
     string old_name = MXRequest.GetString("old_name");
     if (string.IsNullOrEmpty(navname))
     {
         context.Response.Write("{ \"info\":\"该导航菜单ID不可为空!\", \"status\":\"n\" }");
         return;
     }
     if (navname.ToLower() == old_name.ToLower())
     {
         context.Response.Write("{ \"info\":\"该导航菜单ID可使用\", \"status\":\"y\" }");
         return;
     }
     //检查保留的名称开头
     if (navname.ToLower().StartsWith("channel_"))
     {
         context.Response.Write("{ \"info\":\"该导航菜单ID系统保留,请更换!\", \"status\":\"n\" }");
         return;
     }
     var bll = new NavigationService(new NavigationRepository(siteConfig.sysdatabaseprefix));
     if (bll.Exists(navname))
     {
         context.Response.Write("{ \"info\":\"该导航菜单ID已被占用,请更换!\", \"status\":\"n\" }");
         return;
     }
     context.Response.Write("{ \"info\":\"该导航菜单ID可使用\", \"status\":\"y\" }");
     return;
 }