/// <summary> /// 修改实体 /// </summary> /// <param name="entity">实体对象</param> public bool UpadateEntity(TFunTag entity) { using (teaCRMDBContext db = new teaCRMDBContext()) { int rows = db.TFunTags.Update(entity); if (rows > 0) { return(true); } else { return(false); } } }
/// <summary> /// 添加实体 /// </summary> /// <param name="entity">实体对象</param> public bool InsertEntity(TFunTag entity) { using (UCDbContext db = new UCDbContext()) { int rows = db.TFunTags.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="TFunTag">TFunTag</param> /// <returns>添加状态</returns> public bool EditFunTag(TFunTag FunTag) { var status = false; try { status = TFunTagDao.UpdateEntity(FunTag); } catch (Exception ex) { LogHelper.Error("获取FunTag失败。", ex); status = false; } return(status); }
/// <summary> /// 删除实体 /// </summary> /// <param name="predicate">Lamda表达式</param> public bool DeleteEntity(Expression <Func <TFunTag, bool> > predicate) { using (teaCRMDBContext db = new teaCRMDBContext()) { TFunTag entity = db.TFunTags.Where(predicate).First(); int rows = db.TFunTags.Delete(entity); if (rows > 0) { return(true); } else { return(false); } } }