Esempio n. 1
0
        /// <summary>
        /// 普通查询
        /// </summary>
        public static List <T> Select(int _IPageIndex = 0, int _IPageSize = 100000)
        {
            List <T>         reVal = new List <T>();
            IGenericData <T> IGD   = DataSuperManage <T> .GenericData();

            QueryInfo _QI = new QueryInfo()
            {
                TableName = typeof(T).Name,
                PageIndex = _IPageIndex,
                PageSize  = _IPageSize
            };

            reVal = GenericService <T> .DataTable2List(IGD.Select(_QI));

            return(reVal);
        }
Esempio n. 2
0
        /// <summary>
        /// 通过ID查询
        /// </summary>
        public static T IDSelect(dynamic _ID)
        {
            T reVal = default(T);
            IGenericData <T> IGD = DataSuperManage <T> .GenericData();

            QueryInfo _QUI = new QueryInfo()
            {
                TableName = typeof(T).Name,
                Filter    = "ID='" + _ID + "'",
            };
            List <T> _DT = GenericService <T> .DataTable2List(IGD.Select(_QUI));

            if (_DT.Count > 0)
            {
                reVal = _DT[0];
            }
            return(reVal);
        }