• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# DBContext.teaCRMDBContext类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中teaCRM.DBContext.teaCRMDBContext的典型用法代码示例。如果您正苦于以下问题:C# teaCRMDBContext类的具体用法?C# teaCRMDBContext怎么用?C# teaCRMDBContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



teaCRMDBContext类属于teaCRM.DBContext命名空间,在下文中一共展示了teaCRMDBContext类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: ExistsViewEntity

 /// <summary>
 /// 是否存在该记录
 /// </summary>
 /// <returns></returns>
 public bool ExistsViewEntity(Expression<Func<VSysDepartment , bool>> predicate)
 {
     using (teaCRMDBContext db=new teaCRMDBContext())
     {
        bool status= db.VSysDepartments.Any(predicate);
        return status;
     }
 }
开发者ID:JerryForNet,项目名称:teaCRM,代码行数:12,代码来源:VSysDepartmentDaoImpl.cs


示例2: GetList

	    /// <summary>
        /// 获取所有的数据
	    /// </summary>
	    /// <returns>返回所有数据列表</returns>
        public List<TFunTag> GetList() 
        {
          using (teaCRMDBContext db=new teaCRMDBContext())
            {
             var models= db.TFunTags.ToList();
			 return models;
            }
        }
开发者ID:JerryForNet,项目名称:teaCRM,代码行数:12,代码来源:TFunTagDaoImpl.cs


示例3: ExistsViewEntity

 /// <summary>
 /// 是否存在该记录
 /// </summary>
 /// <returns></returns>
 public bool ExistsViewEntity(Expression<Func<VCompanyUser , bool>> predicate)
 {
     using (teaCRMDBContext db=new teaCRMDBContext())
     {
        bool status= db.VCompanyUsers.Any(predicate);
        return status;
     }
 }
开发者ID:JerryForNet,项目名称:teaCRM,代码行数:12,代码来源:VCompanyUserDaoImpl.cs


示例4: GetEntity

		/// <summary>
        /// 获取指定的单个实体
        /// 如果不存在则返回null
        /// 如果存在多个则抛异常
        /// </summary>
        /// <param name="predicate">Lamda表达式</param>
        /// <returns>Entity</returns>
        public TFunTag GetEntity(Expression<Func<TFunTag, bool>> predicate) 
        {
            using (teaCRMDBContext db=new teaCRMDBContext())
            {
                var model =db.TFunTags.Where<TFunTag>(predicate).SingleOrDefault();
                return model;
		    }
        }
开发者ID:JerryForNet,项目名称:teaCRM,代码行数:15,代码来源:TFunTagDaoImpl.cs


示例5: GetViewList

	    /// <summary>
        /// 获取所有的数据
	    /// </summary>
	    /// <returns>返回所有数据列表</returns>
        public List<VMyappCompany> GetViewList() 
        {
          using (teaCRMDBContext db=new teaCRMDBContext())
            {
             var models= db.VMyappCompanies;
			  var sqlText = models.GetProperty("SqlText");
             LogHelper.Debug(sqlText.ToString());
			 return models.ToList();
            }
        }
开发者ID:JerryForNet,项目名称:teaCRM,代码行数:14,代码来源:VMyappCompanyDaoImpl.cs


示例6: GetViewEntity

 /// <summary>
 /// 获取指定的单个实体
 /// 如果不存在则返回null
 /// 如果存在多个则抛异常
 /// </summary>
 /// <param name="predicate">Lamda表达式</param>
 /// <returns>Entity</returns>
 public VMyappCompany GetViewEntity(Expression<Func<VMyappCompany, bool>> predicate)
 {
     using (teaCRMDBContext db=new teaCRMDBContext())
     {
         var model =db.VMyappCompanies.Where<VMyappCompany>(predicate);
         var sqlText = model.GetProperty("SqlText");
         LogHelper.Debug(sqlText.ToString());
         return model.SingleOrDefault();
     }
 }
开发者ID:JerryForNet,项目名称:teaCRM,代码行数:17,代码来源:VMyappCompanyDaoImpl.cs


示例7: GetCount

 /// <summary>
 /// 获取数据总数
 /// </summary>
 /// <returns>返回所有数据总数</returns>
 public int GetCount()
 {
     using (teaCRMDBContext db = new teaCRMDBContext())
     {
         var models = db.TSysPowers;
         var sqlText = models.GetProperty("SqlText");
         LogHelper.Debug(sqlText.ToString());
         return models.Count();
     }
 }
开发者ID:JerryForNet,项目名称:teaCRM,代码行数:14,代码来源:TSysPowerDaoImpl.cs


示例8: GetList

 /// <summary>
 /// 获取所有的数据
 /// </summary>
 /// <returns>返回所有数据列表</returns>
 public List<TCusLog> GetList()
 {
     using (teaCRMDBContext db = new teaCRMDBContext())
     {
         var models = db.TCusLogs;
         var sqlText = models.GetProperty("SqlText");
         LogHelper.Debug(sqlText.ToString());
         return models.ToList();
     }
 }
开发者ID:JerryForNet,项目名称:teaCRM,代码行数:14,代码来源:TCusLogDaoImpl.cs


示例9: GetViewEntity

 /// <summary>
 /// 获取指定的单个实体
 /// 如果不存在则返回null
 /// 如果存在多个则抛异常
 /// </summary>
 /// <param name="predicate">Lamda表达式</param>
 /// <returns>Entity</returns>
 public VSysDepartment GetViewEntity(Expression<Func<VSysDepartment, bool>> predicate)
 {
     using (teaCRMDBContext db=new teaCRMDBContext())
     {
         var model =db.VSysDepartments.Where<VSysDepartment>(predicate);
         var sqlText = model.GetProperty("SqlText");
         LogHelper.Debug(sqlText.ToString());
         return model.SingleOrDefault();
     }
 }
开发者ID:JerryForNet,项目名称:teaCRM,代码行数:17,代码来源:VSysDepartmentDaoImpl.cs


示例10: GetViewCount

 /// <summary>
 /// 获取数据总数
 /// </summary>
 /// <returns>返回所有数据总数</returns>
 public int GetViewCount()
 {
     using (teaCRMDBContext db = new teaCRMDBContext())
     {
         var models = db.VAppCompanies;
         var sqlText = models.GetProperty("SqlText");
         LogHelper.Debug(sqlText.ToString());
         return models.Count();
     }
 }
开发者ID:JerryForNet,项目名称:teaCRM,代码行数:14,代码来源:VAppCompanyDaoImpl.cs


示例11: InsertEntity

		  /// <summary>
        /// 添加实体
        /// </summary>
        /// <param name="entity">实体对象</param>
        public bool InsertEntity(TFunTag entity)
        {
            using (teaCRMDBContext db=new teaCRMDBContext())
            {
              int rows=  db.TFunTags.Insert(entity);
				 if (rows > 0)
                {
                    return true;
                }
                else
                {
                    return false;
                }
            }
        }
开发者ID:JerryForNet,项目名称:teaCRM,代码行数:19,代码来源:TFunTagDaoImpl.cs


示例12: ExecuteSql

 /// <summary>
 /// 执行Sql
 /// </summary>
 /// <param name="sql">Sql语句</param>
 /// <param name="namedParameters">查询字符串</param>
 /// <returns></returns>
 public bool ExecuteSql(string sql, dynamic namedParameters = null)
 {
     using (teaCRMDBContext db = new teaCRMDBContext())
      {
          var rows = db.DbHelper.ExecuteNonQuery(sql, namedParameters);
          if (rows > 0)
          {
              return true;
          }
          else
          {
              return false;
          }
      }
 }
开发者ID:JerryForNet,项目名称:teaCRM,代码行数:21,代码来源:TSysUserDaoImpl.cs


示例13: DeleteEntity

 /// <summary>
 /// 删除实体
 /// </summary>
 /// <param name="predicate">Lamda表达式</param>
 public bool DeleteEntity(Expression<Func<TSysUser , bool>> predicate)
 {
     using (teaCRMDBContext db=new teaCRMDBContext())
     {
         TSysUser  entity = db.TSysUsers.Where(predicate).First();
         int rows=db.TSysUsers.Delete(entity);
          if (rows > 0)
         {
             return true;
         }
         else
         {
             return false;
         }
     }
 }
开发者ID:JerryForNet,项目名称:teaCRM,代码行数:20,代码来源:TSysUserDaoImpl.cs


示例14: DeletesEntity

 /// <summary>
 /// 批量删除
 /// </summary>
 /// <param name="list">实体集合</param>
 public bool DeletesEntity(List<TSysUser> list)
 {
     using (teaCRMDBContext db=new teaCRMDBContext())
     {
         //var tran = db.Connection.BeginTransaction();
         try
         {
             foreach (var item in list)
             {
                 db.TSysUsers.Delete(item);
             }
             //tran.Commit();
             return true;
         }
         catch (Exception ex)
         {
             //tran.Rollback();
             return false;
             throw new Exception(ex.Message);
         }
     }
 }
开发者ID:JerryForNet,项目名称:teaCRM,代码行数:26,代码来源:TSysUserDaoImpl.cs


示例15: GetViewList

 /// <summary>
 /// 获取所有的数据
 /// </summary>
 /// <returns>返回所有数据列表</returns>
 public List<VSysDepartment> GetViewList()
 {
     using (teaCRMDBContext db=new teaCRMDBContext())
     {
      var models= db.VSysDepartments;
       var sqlText = models.GetProperty("SqlText");
      LogHelper.Debug(sqlText.ToString());
      return models.ToList();
     }
 }
开发者ID:JerryForNet,项目名称:teaCRM,代码行数:14,代码来源:VSysDepartmentDaoImpl.cs


示例16: UpadateEntity

 /// <summary>
 /// 修改实体
 /// </summary>
 /// <param name="entity">实体对象</param>
 public bool UpadateEntity(TSysUser entity)
 {
     using (teaCRMDBContext db=new teaCRMDBContext())
     {
        int rows= db.TSysUsers.Update(entity);
        if (rows > 0)
         {
             return true;
         }
         else
         {
             return false;
         }
     }
 }
开发者ID:JerryForNet,项目名称:teaCRM,代码行数:19,代码来源:TSysUserDaoImpl.cs


示例17: GetListByPage

 //查询分页
 public IPagination<TSysUser> GetListByPage(int pageIndex, int pageSize, out int rowCount,
     IDictionary<string, teaCRM.Entity.teaCRMEnums.OrderEmum> orders,
     Expression<Func<TSysUser, bool>> predicate)
 {
     using (teaCRMDBContext db = new teaCRMDBContext())
     {
         var roles = db.TSysUsers.Where(predicate);
         rowCount = roles.Count();
         var prevCount = (pageIndex - 1)*pageSize;
         var models = roles
             .Skip(prevCount)
             .Take(pageSize);
         foreach (var order in orders)
         {
             models = models.OrderBy(String.Format("{0} {1}", order.Key, order.Value));
         }
         var sqlText = models.GetProperty("SqlText");
         LogHelper.Debug("ELINQ Paging:<br/>" + sqlText.ToString());
         return models.ToPagination(pageSize, pageSize, rowCount);
     }
 }
开发者ID:JerryForNet,项目名称:teaCRM,代码行数:22,代码来源:TSysUserDaoImpl.cs


示例18: GetListBySql

 //以下是原生Sql方法==============================================================
 //===========================================================================
 /// <summary>
 /// 用SQL语句查询
 /// </summary>
 /// <param name="sql">sql语句</param>
 /// <param name="namedParameters">sql参数</param>
 /// <returns>集合</returns>
 public IEnumerable<TSysUser> GetListBySql(string sql, dynamic namedParameters)
 {
     using (teaCRMDBContext db=new teaCRMDBContext())
     {
        return db.DbHelper.ExecuteDataTable(sql,namedParameters).ToList<TSysUser>();
     }
 }
开发者ID:JerryForNet,项目名称:teaCRM,代码行数:15,代码来源:TSysUserDaoImpl.cs


示例19: GetEntity

 /// <summary>
 /// 获取指定的单个实体
 /// 如果不存在则返回null
 /// 如果存在多个则抛异常
 /// </summary>
 /// <param name="predicate">Lamda表达式</param>
 /// <returns>Entity</returns>
 public TSysUser GetEntity(Expression<Func<TSysUser, bool>> predicate)
 {
     using (teaCRMDBContext db=new teaCRMDBContext())
     {
         var model =db.TSysUsers.Where<TSysUser>(predicate);
         var sqlText = model.GetProperty("SqlText");
         LogHelper.Debug(sqlText.ToString());
         return model.SingleOrDefault();
     }
 }
开发者ID:JerryForNet,项目名称:teaCRM,代码行数:17,代码来源:TSysUserDaoImpl.cs


示例20: GetFields

 /// <summary>
 /// 根据条件查询某些字段(LINQ 动态查询)
 /// </summary>
 /// <param name="selector">要查询的字段(格式:new(ID,Name))</param>
 /// <param name="predicate">筛选条件(id=0)</param>
 /// <returns></returns>
 public IQueryable<Object> GetFields(string selector, string predicate)
 {
     using (teaCRMDBContext db=new teaCRMDBContext())
     {
         var model = db.TSysUsers.Where(predicate).Select(selector);
         var sqlText = model.GetProperty("SqlText");
         LogHelper.Debug(sqlText.ToString());
         return (IQueryable<object>) model;
     }
 }
开发者ID:JerryForNet,项目名称:teaCRM,代码行数:16,代码来源:TSysUserDaoImpl.cs



注:本文中的teaCRM.DBContext.teaCRMDBContext类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# tinyAsn1.PEREffectiveConstraint类代码示例发布时间:2022-05-26
下一篇:
C# lang.TclObject类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap