/// <summary> /// 修改实体 /// </summary> /// <param name="entity">实体对象</param> public bool UpadateEntity(TCusLog entity) { using (teaCRMDBContext db = new teaCRMDBContext()) { int rows = db.TCusLogs.Update(entity); if (rows > 0) { return(true); } else { return(false); } } }
/// <summary> /// 添加实体 /// </summary> /// <param name="entity">实体对象</param> public bool InsertEntity(TCusLog entity) { using (UCDbContext db = new UCDbContext()) { int rows = db.TCusLogs.Insert(entity); if (rows > 0) { return(true); } else { return(false); } } }
/// <summary> /// 修改信息 2014-11-05 20:23:33 By 唐有炜 /// </summary> /// <param name="id">id</param> /// <param name="TCusLog">TCusLog</param> /// <returns>添加状态</returns> public bool EditCusLog(TCusLog CusLog) { var status = false; try { status = TCusLogDao.UpdateEntity(CusLog); } catch (Exception ex) { LogHelper.Error("获取CusLog失败。", ex); status = false; } return(status); }
/// <summary> /// 删除实体 /// </summary> /// <param name="predicate">Lamda表达式</param> public bool DeleteEntity(Expression <Func <TCusLog, bool> > predicate) { using (teaCRMDBContext db = new teaCRMDBContext()) { TCusLog entity = db.TCusLogs.Where(predicate).First(); int rows = db.TCusLogs.Delete(entity); if (rows > 0) { return(true); } else { return(false); } } }