/// <summary>
        /// GetListAndFileds
        /// </summary>
        /// <param name="Top">条数</param>
        /// <param name="func">Lambda形式条件和参数</param>
        /// <param name="funcFields">Lambda形式返回字段</param>
        /// <returns></returns>
        public static System.Data.DataSet GetListAndFileds(int Top, System.Linq.Expressions.Expression <Func <T, bool> > func, System.Linq.Expressions.Expression <Func <T, bool> > funcFields)
        {
            SQLAndParameter _SP       = LambdaToSQL.GetWhere <T>(func).CheckSQLSort(SQLSort.SQLWhere);
            SQLAndParameter _SPFields = LambdaToSQL.GetWhere <T>(funcFields).CheckSQLSort(SQLSort.SQLFields);

            return(Orm.EntityCore <T> .GetListAndFileds(Top, _SP.SQL, _SP.Parameter.Re_SqlParameter(), _SPFields.SQL));
        }
Exemplo n.º 2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="_pageindex">当前页数, 1为第一页</param>
        /// <param name="func">Lambda形式条件和参数</param>
        public Pager(int _pageindex, System.Linq.Expressions.Expression <Func <table, bool> > func)
        {
            this._pageindex = _pageindex;
            SQLAndParameter _SP = LambdaToSQL.GetWhere <table>(func).CheckSQLSort(SQLSort.SQLWhere);

            this._sqlwhere = _SP.SQL;
            this._sqlparms = _SP.Parameter.Re_SqlParameter();
        }
        /// <summary>
        /// GetModelList
        /// </summary>
        /// <param name="Top">条数</param>
        /// <param name="func">Lambda形式条件和参数</param>
        /// <param name="funcOrder">Lambda形式排序</param>
        /// <returns></returns>
        public static List2 <T> GetModelList(int Top, System.Linq.Expressions.Expression <Func <T, bool> > func, System.Linq.Expressions.Expression <Func <T, bool> > funcOrder)
        {
            SQLAndParameter _SP      = LambdaToSQL.GetWhere <T>(func).CheckSQLSort(SQLSort.SQLWhere);
            SQLAndParameter _SPOrder = LambdaToSQL.GetWhere <T>(funcOrder).CheckSQLSort(SQLSort.SQLOrder);

            _SP.Parameter.CanShu.AddAsNvarchar(_SPOrder.Parameter.Re_SqlParameter());
            return(Orm.EntityCore <T> .GetModelList(Top, _SP.SQL, _SP.Parameter.Re_SqlParameter(), _SPOrder.SQL));
        }
Exemplo n.º 4
0
 /// <summary>
 ///  条件查询
 /// </summary>
 /// <returns></returns>
 public T GM <T>(System.Linq.Expressions.Expression <Func <T, bool> > func, ref T m) where T : EntityBase <T>, new()
 {
     if (m == null || DealMvc.WebCache.WebCache.IsUseWebCache)
     {
         SQLAndParameter _SP = LambdaToSQL.GetWhere <T>(func).CheckSQLSort(SQLSort.SQLWhere);
         m = Orm.EntityCore <T> .GetModel(_SP.SQL, _SP.Parameter.Re_SqlParameter(), false);
     }
     return(m);
 }
Exemplo n.º 5
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="_pageindex">当前页数, 1为第一页</param>
        /// <param name="func">Lambda形式条件和参数</param>
        /// <param name="_pagesize">每页记录数</param>
        ///<param name="funcOrder">Lambda形式排序</param>
        ///<param name="funcFields">Lambda形式字段</param>
        public Pager(int _pageindex, System.Linq.Expressions.Expression <Func <table, bool> > func, int _pagesize, System.Linq.Expressions.Expression <Func <table, bool> > funcOrder, System.Linq.Expressions.Expression <Func <table, bool> > funcFields)
        {
            this._pageindex = _pageindex;
            SQLAndParameter _SP       = LambdaToSQL.GetWhere <table>(func).CheckSQLSort(SQLSort.SQLWhere);
            SQLAndParameter _SPOrder  = LambdaToSQL.GetWhere <table>(funcOrder).CheckSQLSort(SQLSort.SQLOrder);
            SQLAndParameter _SPFields = LambdaToSQL.GetWhere <table>(funcFields).CheckSQLSort(SQLSort.SQLFields);

            this._sqlwhere    = _SP.SQL;
            this._sqlparms    = _SP.Parameter.Re_SqlParameter();
            this._pagesize    = _pagesize;
            this._orderstring = _SPOrder.SQL;
            this._columns     = _SPFields.SQL;
        }
        /// <summary>
        /// GetModelList
        /// </summary>
        /// <param name="func">Lambda形式条件和参数</param>
        /// <returns></returns>
        public static List2 <T> GetModelList(System.Linq.Expressions.Expression <Func <T, bool> > func)
        {
            SQLAndParameter _SP = LambdaToSQL.GetWhere <T>(func).CheckSQLSort(SQLSort.SQLWhere);

            return(Orm.EntityCore <T> .GetModelList(_SP.SQL, _SP.Parameter.Re_SqlParameter()));
        }
        /// <summary>
        /// DeleteWhere
        /// </summary>
        /// <param name="func">Lambda形式条件和参数</param>
        /// <param name="_SqlTranExtensions">事务对象</param>
        public static void DeleteWhere(System.Linq.Expressions.Expression <Func <T, bool> > func, DealMvc.SqlTranEx.SqlTranExtensions _SqlTranExtensions)
        {
            SQLAndParameter _SP = LambdaToSQL.GetWhere <T>(func).CheckSQLSort(SQLSort.SQLWhere);

            Orm.EntityCore <T> .DeleteWhere(_SP.SQL, _SP.Parameter.Re_SqlParameter(), _SqlTranExtensions);
        }