當前位置: 首頁>>代碼示例>>C#>>正文


C# DBContext.teaCRMDBContext類代碼示例

本文整理匯總了C#中teaCRM.DBContext.teaCRMDBContext的典型用法代碼示例。如果您正苦於以下問題:C# teaCRMDBContext類的具體用法?C# teaCRMDBContext怎麽用?C# teaCRMDBContext使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


teaCRMDBContext類屬於teaCRM.DBContext命名空間,在下文中一共展示了teaCRMDBContext類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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


注:本文中的teaCRM.DBContext.teaCRMDBContext類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。