예제 #1
0
        /// <summary>
        /// 添加分析信息
        /// </summary>
        public void AddExperterAnalyzeScheme(ExperterAnalyzeSchemeInfo experter)
        {
            using (var biz = new GameBizBusinessManagement())
            {
                biz.BeginTran();
                var man1     = new ExperterManager();
                var zhuanjia = man1.QueryExperterById(experter.UserId);
                if (zhuanjia == null)
                {
                    throw new Exception("该用户不是名家,申请名家请联系在线客服!");
                }

                var exManager   = new ExperterSchemeManager();
                var schemeCount = exManager.QueryExperterCurrentTimeScheme(experter.UserId, DateTime.Now.ToString("yyyy-MM-dd"));
                if (schemeCount <= 0)
                {
                    throw new LogicException("每天至少发布一个推荐后才可以发布分析!");
                }

                var manager = new ExperterAnalyzeSchemeeManager();
                var entity  = new ExperterAnalyzeScheme()
                {
                    Title        = experter.Title,
                    Content      = experter.Content,
                    Price        = experter.Price,
                    SellCount    = 0,
                    DealWithType = DealWithType.NoneDealWith,
                    AnalyzeId    = BusinessHelper.GetAnalysisId(),
                    UserId       = experter.UserId,
                    CreateTime   = DateTime.Now,
                    CurrentTime  = DateTime.Now.ToString("yyyy-MM-dd"),
                };
                manager.AddExperterAnalyzeScheme(entity);
                biz.CommitTran();
            }
        }
 /// <summary>
 /// 更新专家推荐分析
 /// </summary>
 public void UpdateExperterAnalyzeScheme(ExperterAnalyzeScheme entity)
 {
     this.Update <ExperterAnalyzeScheme>(entity);
 }
 /// <summary>
 /// 删除专家推荐分析
 /// </summary>
 public void DeleteExperterAnalyzeScheme(ExperterAnalyzeScheme entity)
 {
     this.Delete <ExperterAnalyzeScheme>(entity);
 }
 /// <summary>
 /// 添加专家推荐分析
 /// </summary>
 public void AddExperterAnalyzeScheme(ExperterAnalyzeScheme entity)
 {
     this.Add <ExperterAnalyzeScheme>(entity);
 }