示例#1
0
        /// <summary>
        /// 批量添加
        /// </summary>
        /// <param name="Model"></param>
        /// <returns></returns>
        public static bool GDAddBatch <T>(this List <T> ListModel) where T : new()
        {
            SQLiteBSHelper Bs = new SQLiteBSHelper(ConnectName);

            return(Bs.GDAddBatch(ListModel));
        }
示例#2
0
        /// <summary>
        /// 转成其他实体
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="ojbc"></param>
        /// <returns></returns>
        public static List <T> As <T>(this List <object> ojbc)
        {
            SQLiteBSHelper Bs = new SQLiteBSHelper(ConnectName);

            return(Bs.As <T>(ojbc));
        }
示例#3
0
        /// <summary>
        /// 条件
        /// </summary>
        /// <typeparam name="T">实体类</typeparam>
        /// <param name="t"></param>
        /// <param name="Exp">条件</param>
        /// <param name="Sort">排序</param>
        /// <returns></returns>
        public static GDModel.MergerModel GDCodition <T, TRuslt>(this T t, Expression <Func <T, bool> > Exp = null, Expression <Func <T, TRuslt> > OrderBy = null, SQLEnum.SortType SType = SQLEnum.SortType.Desc) where T : new()
        {
            SQLiteBSHelper Bs = new SQLiteBSHelper(ConnectName);

            return(Bs.GDCodition(t, Exp, OrderBy, SType));
        }
示例#4
0
        /// <summary>
        /// 条件
        /// </summary>
        /// <typeparam name="T">实体类</typeparam>
        /// <param name="t"></param>
        /// <param name="OperType">操作类型</param>
        /// <param name="Exp">条件</param>
        /// <param name="Sort">排序</param>
        /// <returns></returns>
        public static GDModel.MergerModel GDCodition <T>(this T t, SQLEnum.OperationType OperType, Expression <Func <T, bool> > Exp = null) where T : new()
        {
            SQLiteBSHelper Bs = new SQLiteBSHelper(ConnectName);

            return(Bs.GDCodition(t, OperType, Exp));
        }
示例#5
0
        ////////////////////////////////查询多个表Start///////////////////////////
        /// <summary>
        /// 查询多个表;
        /// </summary>
        /// <param>调用:var f= objc[0].As<!--实体-->()</param>
        /// <param name="obj"></param>
        /// <returns></returns>
        public static List <List <object> > GDMergerSearch(params object[] obj)
        {
            SQLiteBSHelper Bs = new SQLiteBSHelper(ConnectName);

            return(Bs.GDMergerSearch(obj));
        }
示例#6
0
        /// <summary>
        /// 执行多个表操作
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        public static bool GDMergerExecute(params object[] obj)
        {
            SQLiteBSHelper Bs = new SQLiteBSHelper(ConnectName);

            return(Bs.GDMergerExecute(obj));
        }
示例#7
0
        /// <summary>
        /// 分页
        /// </summary>
        /// <typeparam name="T">对象</typeparam>
        /// <typeparam name="TRuslt">对象</typeparam>
        /// <param name="Source">List</param>
        /// <param name="OrderBy">排序</param>
        /// <param name="ThisPage">当前页</param>
        /// <param name="PageSize"></param>
        /// <returns></returns>
        public static GDPaging <T> GDPaging <T, TRuslt>(this IEnumerable <T> Source, Expression <Func <T, TRuslt> > OrderBy, int ThisPage = 1, int PageSize = 10) where T : new()
        {
            SQLiteBSHelper Bs = new SQLiteBSHelper(ConnectName);

            return(Bs.GDPaging(Source, OrderBy, ThisPage, PageSize));
        }
示例#8
0
        /// <summary>
        /// 获取多条数据无排序,默认排序为主键倒序
        /// </summary>
        /// <typeparam name="T">对象</typeparam>
        /// <param name="Source">对象</param>
        /// <returns></returns>
        public static List <T> GDList <T>(this IEnumerable <T> Source) where T : new()
        {
            SQLiteBSHelper Bs = new SQLiteBSHelper(ConnectName);

            return(Bs.GDList(Source));
        }
示例#9
0
        /// <summary>
        /// 分页
        /// </summary>
        /// <typeparam name="T">对象</typeparam>
        /// <param name="Source">List</param>
        /// <returns></returns>
        public static GDPaging <T> GDPaging <T>(this IEnumerable <T> Source, int ThisPage = 1, int PageSize = 10) where T : new()
        {
            SQLiteBSHelper Bs = new SQLiteBSHelper(ConnectName);

            return(Bs.GDPaging(Source, ThisPage, PageSize));
        }
示例#10
0
        /// <summary>
        /// 分页
        /// </summary>
        /// <typeparam name="T">对象</typeparam>
        /// <param name="Source">List</param>
        /// <param name="Exp">查询条件</param>
        /// <returns></returns>
        public static GDPaging <T> GDPaging <T>(this T Source, Expression <Func <T, bool> > Exp, int ThisPage = 1, int PageSize = 10) where T : new()
        {
            SQLiteBSHelper Bs = new SQLiteBSHelper(ConnectName);

            return(Bs.GDPaging(Source, Exp, ThisPage, PageSize));
        }
示例#11
0
        /// <summary>
        /// 获取多条数据排序
        /// </summary>
        /// <typeparam name="T">对象</typeparam>
        /// <typeparam name="TRuslt">对象</typeparam>
        /// <param name="Source">List</param>
        /// <param name="Exp">查询条件</param>
        /// <param name="OrderBy">排序</param>
        /// <param name="SType">排序类型</param>
        /// <returns></returns>
        public static List <T> GDList <T, TRuslt>(this T Source, Expression <Func <T, bool> > Exp, Expression <Func <T, TRuslt> > OrderBy, SQLEnum.SortType SType) where T : new()
        {
            SQLiteBSHelper Bs = new SQLiteBSHelper(ConnectName);

            return(Bs.GDList(Source, Exp, OrderBy, SType));
        }
示例#12
0
        /// <summary>
        /// 获取多条数据排序,默认排序为倒序
        /// </summary>
        /// <typeparam name="T">对象</typeparam>
        /// <typeparam name="TRuslt">对象</typeparam>
        /// <param name="Source">List</param>
        /// <param name="OrderBy">排序字段</param>
        /// <returns></returns>
        public static List <T> GDList <T, TRuslt>(this IEnumerable <T> Source, Expression <Func <T, TRuslt> > OrderBy) where T : new()
        {
            SQLiteBSHelper Bs = new SQLiteBSHelper(ConnectName);

            return(Bs.GDList(Source, OrderBy));
        }
示例#13
0
        /// <summary>
        /// 获取多条数据无排序,默认排序为主键倒序
        /// </summary>
        /// <typeparam name="T">对象</typeparam>
        /// <param name="Source">对象</param>
        /// <returns></returns>
        public static List <T> GDList <T>(this T Source, Expression <Func <T, bool> > Exp) where T : new()
        {
            SQLiteBSHelper Bs = new SQLiteBSHelper(ConnectName);

            return(Bs.GDList(Source, Exp));
        }
示例#14
0
        /// <summary>
        /// 删除操作
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="Model"></param>
        /// <param name="Exp"></param>
        /// <returns></returns>
        public static bool GDelete <T>(this T Model, Expression <Func <T, bool> > Exp = null) where T : new()
        {
            SQLiteBSHelper Bs = new SQLiteBSHelper(ConnectName);

            return(Bs.GDelete(Model, Exp));
        }
示例#15
0
        /// <summary>
        /// 分页
        /// </summary>
        /// <typeparam name="T">对象</typeparam>
        /// <typeparam name="TRuslt">对象</typeparam>
        /// <param name="Source">List</param>
        /// <param name="Exp">查询条件</param>
        /// <param name="OrderBy">排序字段</param>
        /// <param name="SType">排序类型</param>
        /// <param name="ThisPage"></param>
        /// <param name="PageSize"></param>
        /// <returns></returns>
        public static GDPaging <T> GDPaging <T, TRuslt>(this T Source, Expression <Func <T, bool> > Exp, Expression <Func <T, TRuslt> > OrderBy, SQLEnum.SortType SType, int ThisPage = 1, int PageSize = 10) where T : new()
        {
            SQLiteBSHelper Bs = new SQLiteBSHelper(ConnectName);

            return(Bs.GDPaging(Source, Exp, OrderBy, SType, ThisPage, PageSize));
        }
示例#16
0
        /// <summary>
        /// 根据Key删除
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="Model"></param>
        /// <returns></returns>
        public static bool GDeleteByKey <T>(this T Model) where T : new()
        {
            SQLiteBSHelper Bs = new SQLiteBSHelper(ConnectName);

            return(Bs.GDeleteByKey(Model));
        }
示例#17
0
        public static int GDAddGetId <T>(this T Model) where T : new()
        {
            SQLiteBSHelper Bs = new SQLiteBSHelper(ConnectName);

            return(Bs.GDAddGetId(Model));
        }