public void AddSiteActivity(SiteActivityInfo info)
 {
     if (info == null)
     {
         throw new Exception("当前广告信息无效!");
     }
     using (var manager = new SiteActivityManager())
     {
         SiteActivity entity = new SiteActivity();
         ObjectConvert.ConverInfoToEntity(info, ref entity);
         manager.AddSiteActivity(entity);
     }
 }
 public void AddBannerInfo(SiteMessageBannerInfo info)
 {
     if (info == null)
     {
         throw new Exception("当前广告信息无效!");
     }
     using (var manager = new BulletinManager())
     {
         SiteMessageBanner entity = new SiteMessageBanner();
         ObjectConvert.ConverInfoToEntity(info, ref entity);
         entity.CreateTime = DateTime.Now;
         manager.AddBannerInfo(entity);
     }
 }
 /// <summary>
 /// 修改公告
 /// </summary>
 public void UpdateBulletin(long id, BulletinInfo_Publish bulletin, string updateBy)
 {
     using (var biz = new GameBiz.Business.GameBizBusinessManagement())
     {
         biz.BeginTran();
         using (var bulletinManager = new BulletinManager())
         {
             var entity = bulletinManager.GetBulletinById(id);
             ObjectConvert.ConverInfoToEntity <BulletinInfo_Publish, Bulletin>(bulletin, ref entity);
             entity.UpdateBy = updateBy;
             bulletinManager.UpdateBulletin(entity);
         }
         biz.CommitTran();
     }
 }
        /// <summary>
        /// 发布公告
        /// </summary>
        public void PublishBulletin(BulletinInfo_Publish bulletin, string createBy)
        {
            var entity = new Bulletin();

            ObjectConvert.ConverInfoToEntity <BulletinInfo_Publish, Bulletin>(bulletin, ref entity);
            using (var biz = new GameBiz.Business.GameBizBusinessManagement())
            {
                biz.BeginTran();
                using (var bulletinManager = new BulletinManager())
                {
                    entity.CreateBy = createBy;
                    entity.UpdateBy = createBy;
                    bulletinManager.AddBulletin(entity);
                }
                biz.CommitTran();
            }
        }
Example #5
0
        public void FinanceSetting(string opeType, FinanceSettingsInfo info, string operatorId)
        {
            try
            {
                using (var manage = new UserBalanceManager())
                {
                    if (info != null)
                    {
                        FinanceSettings entity = new FinanceSettings();
                        ObjectConvert.ConverInfoToEntity(info, ref entity);
                        entity.OperatorId = operatorId;
                        entity.CreateTime = DateTime.Now;
                        switch (opeType.ToLower())
                        {
                        case "add":
                            AddFinanceSettings(entity);
                            break;

                        case "update":
                            //UpdateFinanceSettings(entity);
                            manage.UpdateFinanceSettings(entity);
                            break;

                        case "delete":
                            manage.DeleteFinanceSettings(entity.FinanceId.ToString());
                            break;
                        }
                    }
                    else
                    {
                        if (opeType.ToLower() != "delete")
                        {
                            throw new Exception("保存数据失败!");
                        }
                        else
                        {
                            throw new Exception("删除数据失败!");
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }
Example #6
0
 public void AddSendMsgHistoryRecord(SendMsgHistoryRecordInfo info)
 {
     using (var manager = new UserBalanceManager())
     {
         if (info == null)
         {
             throw new Exception("未查询到数据!");
         }
         var ListInfo = manager.GetSendMsgHistoryRecord(info.PhoneNumber, info.IP, info.MsgType);
         if (ListInfo != null && ListInfo.Count > 1)
         {
             throw new Exception("每天只能发送三次,并且手机号码必须不相同!");
         }
         SendMsgHistoryRecord entity = new SendMsgHistoryRecord();
         ObjectConvert.ConverInfoToEntity(info, ref entity);
         manager.AddSendMsgHistoryRecord(entity);
     }
 }