private void cboQueryDef_SelectedIndexChanged(object sender, EventArgs e) { ExQueryComboItem curQryComboItem = (ExQueryComboItem)cboQueryDef.SelectedItem; m_CurExQuery = curQryComboItem.ExQuery; m_GridCtxMenuBuilder = new GridContextMenuBuilder(m_CurExQuery.ContextMenuDef); btnReset.PerformClick(); }
/// <summary> /// 可扩展的分页查询功能,pageSize不宜过大,如果pageSize大于1000,使用:BigPageList /// </summary> /// <param name="baseQuery">基础查询对象委托</param> /// <param name="exQuery">额外查询条件委托</param> /// <param name="pageIndex">查询页码</param> /// <param name="pageSize">每页显示数据量</param> /// <param name="eqArgs">查询参数,不为null时会作为查询参数</param> /// <param name="neqArgs">不等查询参数,不为null时会作为不等查询参数</param> /// <returns></returns> public MyPagedList <TEntity> PageList(BaseQuery baseQuery, ExQuery exQuery, int pageIndex = 1, int pageSize = 20, TParams eqArgs = null, TParams neqArgs = null) { if (pageIndex <= 0) { pageIndex = 1; } if (pageSize > 100) { pageSize = 100; } else if (pageSize <= 0) { pageSize = 20; } using (BaseDbContext dbContext = CreateDbContext()) { IQueryable <TEntity> query = Query(baseQuery(dbContext), eqArgs, neqArgs); query = exQuery(query); return(query.ToMyPagedList(pageIndex, pageSize)); } }
public ExQueryComboItem(ExQuery exQuery) { m_ExQuery = exQuery; }