Пример #1
0
        /// <summary>
        /// 参数集查询转实体集
        /// </summary>
        public static List <T> Parms2TList(List <string> _IPrams, string _IKey = "Code")
        {
            List <T>         reVal = new List <T>();
            IGenericData <T> IGD   = DataSuperManage <T> .GenericData();

            reVal = GenericService <T> .DataTable2List(IGD.Parms2TList(_IPrams, _IKey));

            return(reVal);
        }
Пример #2
0
        /// <summary>
        /// 参数集查询转实体集
        /// </summary>
        public static List <T> Parms2TList(string _IParms, string _IKey = "Code")
        {
            List <T>         reVal = new List <T>();
            IGenericData <T> IGD   = DataSuperManage <T> .GenericData();

            reVal = GenericService <T> .DataTable2List(IGD.Parms2TList(_IParms.SplitString(",").ToList(), _IKey));

            return(reVal);
        }
Пример #3
0
        /// <summary>
        /// 实体更新
        /// </summary>
        public static bool Update(T _IT, string _UpdateColumn = "*", string _IWhere = "")
        {
            bool             reVal = false;
            IGenericData <T> IGD   = DataSuperManage <T> .GenericData();

            List <T> _DT = new List <T>();

            _DT.Add(_IT);
            reVal = IGD.Update(GenericService <T> .List2DataTable(_DT));
            return(reVal);
        }
Пример #4
0
        /// <summary>
        /// 实体新增
        /// </summary>
        public static bool Insert(T _IT, string _INoRepeatColumn = "")
        {
            bool             reVal = false;
            IGenericData <T> IGD   = DataSuperManage <T> .GenericData();

            List <T> _DT = new List <T>();

            _DT.Add(_IT);
            reVal = IGD.Insert(GenericService <T> .List2DataTable(_DT), "", "", _INoRepeatColumn);
            return(reVal);
        }
Пример #5
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);
        }
Пример #6
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);
        }