Ejemplo n.º 1
0
        public List <SysRole> GetList(string keyword = "")
        {
            var expression = ExtLinq.True <SysRole>();

            if (!string.IsNullOrEmpty(keyword))
            {
                expression = expression.And(t => t.FullName.Contains(keyword));
                expression = expression.Or(t => t.EnCode.Contains(keyword));
            }
            expression = expression.And(t => t.Category == 2);
            return(_Respository.Get(expression).OrderBy(t => t.SortCode).ToList());
        }
Ejemplo n.º 2
0
        public List <SysRole> GetList(string keyword = "", bool isDuty = false)
        {
            var expression = base.GetFilterEnabled();

            if (!string.IsNullOrEmpty(keyword))
            {
                expression = expression.And(t => t.FullName.Contains(keyword));
                expression = expression.Or(t => t.EnCode.Contains(keyword));
            }
            if (isDuty)
            {
                expression = expression.Or(t => t.Category == 2);
            }
            return(_Respository.Get(expression).OrderBy(t => t.SortCode).ToList());
        }