/// <summary> /// 添加名家 /// </summary> public void AddExperter(ExperterInfo experter) { using (var biz = new GameBizBusinessManagement()) { biz.BeginTran(); var manager = new ExperterManager(); var useerManager = new UserBalanceManager(); var userEntity = useerManager.QueryUserRegister(experter.UserId); if (userEntity == null) { throw new LogicException(string.Format("用户Id:{0}没有找到该用户", experter.UserId)); } var entityUser = manager.QueryExperterById(experter.UserId); if (entityUser != null) { throw new LogicException(string.Format("该用户:{0}已经是名家", experter.UserId)); } var entity = new Experter() { UserId = experter.UserId, ExperterHeadImage = experter.ExperterHeadImage, AdeptGameCode = "JCZQ", ExperterSummary = experter.ExperterSummary, RecentlyOrderCount = 0, IsEnable = true, ExperterType = experter.ExperterType, CreateTime = DateTime.Now, WeekShooting = 0M, MonthRate = 0M, TotalRate = 0M, WeekRate = 0M, DealWithType = DealWithType.HasDealWith, DisposeOpinion = "", MonthShooting = 0M, TotalShooting = 0M, }; manager.AddExperter(entity); biz.CommitTran(); } }
/// <summary> /// 更新专家信息 /// </summary> public void UpdateExperter(Experter entity) { this.Update <Experter>(entity); }
/// <summary> /// 删除专家 /// </summary> public void DeleteExperter(Experter entity) { this.Delete <Experter>(entity); }
/// <summary> /// 添加专家 /// </summary> public void AddExperter(Experter entity) { this.Add <Experter>(entity); }