码迷,mamicode.com
首页 > 其他好文 > 详细

X6 权限过滤

时间:2017-12-13 11:57:29      阅读:173      评论:0      收藏:0      [点我收藏+]

标签:==   employee   this   tree   lua   format   end   eth   method   

 ActionResultModel<List<X6_V_Personnel_BasicInfo>> model = new ActionResultModel<List<X6_V_Personnel_BasicInfo>>();
       _.apiService.DynamicApi<List<X6_V_Personnel_BasicInfo>>((db,pars)=>{
         var data = db.Queryable<X6_V_Personnel_BasicInfo>()
             .Where(_.apiService.GetFilterQueryWhere())
             .OrderBy(_.apiService.GetOrder());
                if (this.Request.HttpMethod == "POST")
                {
                    data.Where(PostMethodFilterGetTool.GetFilterQueryWhere(pars));
                }
                if (pars.ContainsKey("EmployeeStatus") && pars["EmployeeStatus"].IsValuable())
                {
                    data = data.Where(string.Format("EmployeeStatus in ({0})", pars["EmployeeStatus"]));
                }
                if (pars.ContainsKey("CompanyId") && pars["CompanyId"].IsValuable())
                {
                    //data = data.Where(string.Format(" CompanyId = ‘{0}‘", pars["CompanyId"]));
                    var CompanyId = pars["CompanyId"].TrimEnd(,);
                    data = data.Where(@"DepartmentId in (" + CompanyId + ")");
                }
           
           model.responseInfo = data.ToPageList(pars["pagenum"].TryToInt() + 1, pars["pagesize"].TryToInt());
           model.totalRows = data.Count();
       }, "FilterOrgContainCompanyReturnTreeIds");

 

X6 权限过滤

标签:==   employee   this   tree   lua   format   end   eth   method   

原文地址:http://www.cnblogs.com/tangpeng97/p/8031455.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!