Ejemplo n.º 1
0
        // 列表
        // GET: /<controller>/
        public async Task <IActionResult> Index(ModuleButtonOption option)
        {
            //返回json
            if (Request.IsAjaxRequest())
            {
                var modules = await ModuleButtonApp.GetSaasModuleListAsync(option);

                return(Json(new { rows = modules }));
            }
            ViewData["ModuleId"] = option.ModuleId;
            ViewData["ParentId"] = option.ParentId;
            return(View());
        }
Ejemplo n.º 2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="option"></param>
        /// <returns></returns>
        private async Task <List <ModuleButton> > GetListAsync(ModuleButtonOption option)
        {
            var predicate = PredicateBuilder.True <ModuleButton>();

            if (option != null)
            {
                if (option.ModuleId.HasValue && option.ModuleId != 0)
                {
                    predicate = predicate.And(o => o.ModuleId == option.ModuleId.Value);
                }
                if (option.ParentId.HasValue)
                {
                    predicate = predicate.And(o => o.ParentId == option.ParentId.Value);
                }
            }
            return(await ModuleButtonRep.Find(predicate).ToListAsync());
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Saas模块按钮
 /// </summary>
 /// <param name="option"></param>
 /// <returns></returns>
 public async Task <List <ModuleButton> > GetSaasModuleListAsync(ModuleButtonOption option = null)
 {
     return(await GetListAsync(option));
 }