public void SaveEntity(int keyValue, dm_readtaskEntity entity) { try { if (keyValue > 0) { entity.Modify(keyValue); BaseRepository("dm_data").Update(entity); } else { entity.Create(); BaseRepository("dm_data").Insert(entity); } UserInfo userInfo = LoginUserInfo.Get(); string cacheKey = "ReadEarn" + userInfo.companyId; redisCache.Remove(cacheKey, 7L); } catch (Exception ex) { if (ex is ExceptionEx) { throw; } throw ExceptionEx.ThrowServiceException(ex); } }
public void AddClickReadEarnTask(int id, int count, string appid) { try { dm_readtaskEntity entity = GetEntity(id); if (entity != null) { entity.peoplecount += count; } entity.Modify(id); BaseRepository("dm_data").Update(entity); string cacheKey = "ReadEarn" + appid; redisCache.Remove(cacheKey, 7L); } catch (Exception ex) { if (ex is ExceptionEx) { throw; } throw ExceptionEx.ThrowServiceException(ex); } }