예제 #1
0
        /// <summary>
        /// 获取数据
        /// </summary>
        /// <param name="paramObj">条件模型</param>
        /// <param name="orderStr">排序字符串</param>
        /// <returns></returns>
        public static List <T> GetList(T paramObj = null)
        {
            // 如果有参数
            if (paramObj != null)
            {
                var sqlStr = SqlFactory.GetSqlStr <T>(SqlType.GetList);
                return(ExecuteDataTable <T>(Conn, sqlStr, paramObj));
            }

            var sqlAllStr = SqlFactory.GetSqlStr <T>(SqlType.GetAllList);

            return(ExecuteDataTable <T>(Conn, sqlAllStr));
        }
예제 #2
0
        /// <summary>
        /// 删除数据
        /// </summary>
        /// <param name="paramObj">参数</param>
        /// <returns>受影响的函数</returns>
        public static Int32 Delete(T paramObj)
        {
            var sqlStr = SqlFactory.GetSqlStr <T>(SqlType.Delete);

            return(ExecuteNonQuery(Conn, sqlStr, paramObj));
        }
예제 #3
0
        /// <summary>
        /// 获得自定义筛选的数据量(只支持字符串与数字筛选)
        /// </summary>
        /// <param name="paramObj">参数</param>
        /// <param name="isLike">是否使用like查询</param>
        /// <param name="filterStr">自定义筛选字段</param>
        /// <returns>受影响的函数</returns>
        public static Int32 GetDefinedCount(T paramObj, Boolean isLike = false, String filterStr = "")
        {
            var sqlStr = SqlFactory.GetDefinedSqlStr(SqlType.GetDefinedCount, paramObj, -1, -1, isLike, filterStr);

            return(Convert.ToInt32(ExecuteScalar(Conn, sqlStr)));
        }
예제 #4
0
        /// <summary>
        /// 获取自定义筛选的数据(只支持字符串与数字筛选)
        /// </summary>
        /// <param name="paramObj">条件</param>
        /// <param name="pageNo">页码</param>
        /// <param name="pageSize">页大小</param>
        /// <param name="isLike">是否使用like查询</param>
        /// <param name="filterStr">自定义筛选字段</param>
        /// <param name="orderStr">排序字符串</param>
        /// <returns></returns>
        public static List <T> GetDefinedList(T paramObj, Int32 pageNo = -1, Int32 pageSize = -1, Boolean isLike = false, String filterStr = "", String orderStr = "")
        {
            var sqlStr = SqlFactory.GetDefinedSqlStr(SqlType.GeDefinedList, paramObj, pageNo, pageSize, isLike, filterStr, orderStr);

            return(ExecuteDataTable <T>(Conn, sqlStr));
        }