public override void OnClick() { if (base.isAvailable && base.isClickacble) { bonus = BonusData.bonusTypes[0] as Bonus; bonusM.AddBonus(0); } base.OnClick(); }
public BonusNoticeInfo AddBonusNotify(string xml) { BonusNoticeInfo info = XmlAnalyzer.AnalyseXmlToCommunicationObject <BonusNoticeInfo>(xml); try { BonusEntity bonusEntity = new BonusEntity(); bonusEntity.GameName = info._Body._BonusInfo._Issue.GameName; bonusEntity.IssuseNumber = info._Body._BonusInfo._Issue.Number; bonusEntity.BonusNumber = info._Body._BonusInfo.BonusNumber; bonusEntity.TotalItems = info._Body._BonusInfo.TotalItems; bonusEntity.TotalMoney = info._Body._BonusInfo.TotalMoney; bonusEntity.NoticeId = info.Id; bonusEntity.IsDistributed = false; using (ILHDBTran tran = BeginTran()) { BonusManager bonusManager = new BonusManager(tran); bonusManager.AddBonus(bonusEntity); List <BonusDetailEntity> bonusDetailList = new List <BonusDetailEntity>(); foreach (BonusMappingInfo.BonusItem bonusItem in info._Body._BonusInfo._BonusItemList) { BonusDetailEntity detail = new BonusDetailEntity(); detail.TicketId = bonusItem.TicketId; detail.BonusLevel = bonusItem.BonusLevel; detail.PlayType = (int)bonusItem.PlayType; detail.Money = bonusItem.Money; detail.IsBombBonus = bonusItem.IsBombBonus; detail.Size = bonusItem.Size; detail.GameName = bonusEntity.GameName; detail.IssuseNumber = bonusEntity.IssuseNumber; bonusManager.AddBonusDetail(detail); } tran.Commit(); } return(info); } catch (Exception ex) { string errMsg = "添加返奖通知失败!" + xml; throw HandleException(LogCategory.Notice, errMsg, ex); } }