本文整理匯總了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;
}
}
示例2: GetList
/// <summary>
/// 獲取所有的數據
/// </summary>
/// <returns>返回所有數據列表</returns>
public List<TFunTag> GetList()
{
using (teaCRMDBContext db=new teaCRMDBContext())
{
var models= db.TFunTags.ToList();
return models;
}
}
示例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;
}
}
示例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;
}
}
示例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();
}
}
示例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();
}
}
示例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();
}
}
示例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();
}
}
示例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();
}
}
示例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();
}
}
示例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;
}
}
}
示例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;
}
}
}
示例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;
}
}
}
示例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);
}
}
}
示例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();
}
}