http://www.sufeinet.com/plugin.php?id=keke_group

苏飞论坛

 找回密码
 马上注册

QQ登录

只需一步,快速开始

分布式系统框架(V2.0) 轻松承载百亿数据,千万流量!讨论专区 - 源码下载 - 官方教程

HttpHelper爬虫框架(V2.7-含.netcore) HttpHelper官方出品,爬虫框架讨论区 - 源码下载 - 在线测试和代码生成

HttpHelper爬虫类(V2.0) 开源的爬虫类,支持多种模式和属性 源码 - 代码生成器 - 讨论区 - 教程- 例子

查看: 16494|回复: 6

[更新] 新的框架使用方式一览

[复制链接]
发表于 2019-1-18 16:21:53 | 显示全部楼层 |阅读模式
[C#] 纯文本查看 复制代码
  Hr_EmployeeBLL hr_el = new Hr_EmployeeBLL();

            //------------------------------------------------------查询------------------------------------------------------------------------
            //查询所有
            List<Hr_Employee> list = hr_el.FindList();

            //根据条件查询
            list = hr_el.FindList("UserID=232");

            //根据条件查询  支持直接自己写SQl语句 
            list = hr_el.FindList("select top 5 * from Hr_Employee where UserID<>@UserID", DictBuilder.Assign("UserID", 109));

            //根据条件查询 参数必须出现在语句中
            list = hr_el.FindList("UserID=@UserID and Password=@Password", DictBuilder.Assign("UserID", 233).Assign("Password", 12345));

            //根据条件查询 自动组织参数
            list = hr_el.FindListWhere(DictBuilder.Assign("Password", "12345").IN("UserID", new int[] { 233, 1180, 326, 325 }));

            long totalcount = 0;
            //根据条件查询-分页
            list = hr_el.FindListPage(
                new OrmLitePageFactor()
                {
                    Conditions = "UserID<>@UserID",
                    OrderBy = "UserID desc",
                    PageIndex = 2,
                    PageSize = 20,
                    Params = DictBuilder.Assign("UserID", 109)
                },
                out totalcount);

            //------------------------------------------------------写入------------------------------------------------------------------------
            Hr_Employee obj = new Hr_Employee()
            {
                Birthday = string.Empty,
                BranchID = 1,
                CheckinDate = DateTime.Now,
                UserName = "sufei"
            };
            //long userid = hr_el.Insert(obj, true);
            //------------------------------------------------------修改------------------------------------------------------------------------
            int result = 0;

            obj = new Hr_Employee()
            {
                Birthday = string.Empty,
                CheckinDate = DateTime.Now,
                UserName = "sufei"
            };
             //result = hr_el.Update(obj, new string[] { "Birthday", "UserName", "CheckinDate" });

            //条件修改
            result = hr_el.Update(
               DictBuilder.Assign("UserName", "sufei"), "UserName=@UserName1",
               DictBuilder.Assign("UserName1", "sufei"));
            //------------------------------------------------------删除------------------------------------------------------------------------

            //result = hr_el.Delete("UserName=@UserName", DictBuilder.Assign("UserName", "sufei"));

            //------------------------------------------------------其他------------------------------------------------------------------------
            long countall = hr_el.Count();//总行
            long count = hr_el.Count("UserID<>@UserID", DictBuilder.Assign("UserID", 1516));//sql查询
            count = hr_el.Count("UserID<>1516");//单SQl查询



1. 开通SVIP会员,免费下载本站所有源码,不限次数据,不限时间
2. 加官方QQ群,加官方微信群获取更多资源和帮助
3. 找站长苏飞做网站、商城、CRM、小程序、App、爬虫相关、项目外包等点这里
发表于 2019-1-18 16:23:45 | 显示全部楼层
强烈支持楼主ing……
发表于 2019-1-18 17:31:31 | 显示全部楼层
感恩无私的分享与奉献
发表于 2019-2-19 10:54:27 | 显示全部楼层
真是被感动的痛哭流涕……
发表于 2019-3-18 23:16:11 | 显示全部楼层
感恩无私的分享与奉献   +1
真是被感动的痛哭流涕……  +1
发表于 2020-3-28 21:07:57 | 显示全部楼层
支持多表关联查询和视图查询?
发表于 2020-10-12 22:11:12 | 显示全部楼层
本帖最后由 1486969608 于 2020-10-12 22:17 编辑

优秀,学起来!哈哈
您需要登录后才可以回帖 登录 | 马上注册

本版积分规则

QQ|手机版|小黑屋|手机版|联系我们|关于我们|广告合作|苏飞论坛 ( 豫ICP备18043678号-2)

GMT+8, 2024-3-29 12:57

© 2014-2021

快速回复 返回顶部 返回列表