Ejemplo n.º 1
0
 private void OnQuerying(CustomExpressionEventArgs e)
 {
     if (_querying != null)
     {
         _querying(this, e);
     }
 }
Ejemplo n.º 2
0
        public override IQueryable GetQueryable(IQueryable source)
        {
            CustomExpressionEventArgs e = new CustomExpressionEventArgs(source, GetValues());

            OnQuerying(e);
            return(e.Query);
        }
        protected void minLevelShowEvenValuesOnly_Querying(object sender, CustomExpressionEventArgs e)
        {
            var query = from j in e.Query.OfType<jobs>()
                        select j;

            if (Convert.ToBoolean(e.Values["applyFilter"]))
            {
                query = query.Where(x => (x.min_lvl % 2) == 0);
            }

            e.Query = query;
        }
        protected void Unnamed_Querying(object sender, CustomExpressionEventArgs e)
        {
            int number;
            Int32.TryParse(_searchText, out number);

            if (_searchText == "")
            {
                e.Query = from s in e.Query.Cast<Book>()
                          select s;
            }
            else
            {
                e.Query = from s in e.Query.Cast<Book>()
                          where (s.Autor.Contains(_searchText) || s.Titul.Contains(_searchText) || s.ID.Equals(number))
                          select s;
            }
        }
Ejemplo n.º 5
0
 protected void Custom_Querying(object sender, CustomExpressionEventArgs e)
 {
     //e.Query = e.Query.Where("it.OrderID=@0", e.Values["BTKing"]);
 }
 private void OnQuerying(CustomExpressionEventArgs e) {
     if (_querying != null) {
         _querying(this, e);
     }
 }
 public override IQueryable GetQueryable(IQueryable source) {
     CustomExpressionEventArgs e = new CustomExpressionEventArgs(source, GetValues());
     OnQuerying(e);
     return e.Query;
 }