public void AddUserRecommend(UserRecommendInputDto input) { int id = this._userRecommendReposity.AddRecommend(input.MapTo <Entitys.UserRecommend>()); if (id >= 1) { Entitys.PointsLog pointLog = new Entitys.PointsLog(); pointLog.FK_ID = id.ToString(); pointLog.UserId = input.RecommenderId; pointLog.SourceType = 1; pointLog.Score = input.Score; this._pointsLogRepository.InvitAddPoints(pointLog); Entitys.UserDynamicInfo dyInfo = new Entitys.UserDynamicInfo(); dyInfo.TotalScore = input.Score; dyInfo.UserId = input.RecommenderId; this._userDynamicInfoRepository.UpdatePointsScore(dyInfo); } }
public int SignPoints(UserPointsInputDto pointDto) { Entitys.PointsLog log = new Entitys.PointsLog(); log.Score = pointDto.Score; log.UserId = pointDto.UserId; log.AddTime = DateTime.Now.ToString("yyyyMMdd"); if (this.pointsLogRepository.CreatePointsLog(log) > 0) { Entitys.UserDynamicInfo dyInfo = new Entitys.UserDynamicInfo(); dyInfo.TotalScore = pointDto.Score; dyInfo.UserId = pointDto.UserId; this.userDynamicInfoRepository.UpdatePointsScore(dyInfo); return(1); } return(0); }