public IssueNoticeInfo AddIssuseNotify(string xml)
        {
            IssueNoticeInfo info = XmlAnalyzer.AnalyseXmlToCommunicationObject<IssueNoticeInfo>(xml);
            try
            {
                IssueEntity issueEntity = new IssueEntity();
                issueEntity.GameName = info.GameName;
                issueEntity.IssuseNumber = info.Number;
                issueEntity.StartTime = info.StartTime;
                issueEntity.StopTime = info.StopTime;
                issueEntity.Status = (int)info.Status;
                issueEntity.BonusCode = info.BonusCode;
                issueEntity.SalesMoney = info.SalesMoney;
                issueEntity.BonusMoney = info.BonusMoney;
                issueEntity.NoticeId = info.Id;
                IssuseManager issuseManager = new IssuseManager(DbAccess);
                issuseManager.SaveIssue(issueEntity);

                if (info.Status == IssueStatus.Started)
                {
                    TicketFacade ticketFacade = new TicketFacade();
                    ticketFacade.AutoBuyChaseTicket(issueEntity.GameName, issueEntity.IssuseNumber);
                }
                //Thread thread = new Thread(AutoChaseTicket);
                //thread.Start(issueEntity);

                return info;
            }
            catch (Exception ex)
            {
                string errMsg = "添加奖期通知失败!" + xml;
                throw HandleException(LogCategory.Notice, errMsg, ex);
            }
        }
        private void AutoChaseTicket(object issueObject)
        {
            IssueEntity  issueEntity  = issueObject as IssueEntity;
            TicketFacade ticketFacade = new TicketFacade();

            ticketFacade.AutoBuyChaseTicket(issueEntity.GameName, issueEntity.IssuseNumber);
        }
        public IssueNoticeInfo AddIssuseNotify(string xml)
        {
            IssueNoticeInfo info = XmlAnalyzer.AnalyseXmlToCommunicationObject <IssueNoticeInfo>(xml);

            try
            {
                IssueEntity issueEntity = new IssueEntity();
                issueEntity.GameName     = info.GameName;
                issueEntity.IssuseNumber = info.Number;
                issueEntity.StartTime    = info.StartTime;
                issueEntity.StopTime     = info.StopTime;
                issueEntity.Status       = (int)info.Status;
                issueEntity.BonusCode    = info.BonusCode;
                issueEntity.SalesMoney   = info.SalesMoney;
                issueEntity.BonusMoney   = info.BonusMoney;
                issueEntity.NoticeId     = info.Id;
                IssuseManager issuseManager = new IssuseManager(DbAccess);
                issuseManager.SaveIssue(issueEntity);

                if (info.Status == IssueStatus.Started)
                {
                    TicketFacade ticketFacade = new TicketFacade();
                    ticketFacade.AutoBuyChaseTicket(issueEntity.GameName, issueEntity.IssuseNumber);
                }
                //Thread thread = new Thread(AutoChaseTicket);
                //thread.Start(issueEntity);

                return(info);
            }
            catch (Exception ex)
            {
                string errMsg = "添加奖期通知失败!" + xml;
                throw HandleException(LogCategory.Notice, errMsg, ex);
            }
        }
 private void AutoChaseTicket(object issueObject)
 {
     IssueEntity issueEntity = issueObject as IssueEntity;
     TicketFacade ticketFacade = new TicketFacade();
     ticketFacade.AutoBuyChaseTicket(issueEntity.GameName, issueEntity.IssuseNumber);
 }
Esempio n. 5
0
    private void DoBuy()
    {
        string issueIdString = HidIsuseID.Value;
        string isuseNumber = HidIsuseNumber.Value;
        string endTime = HidIsuseEndTime.Value;
        string playTypeString = Shove._Web.Utility.GetRequest("playType");
        string lotteryNumber = Shove._Web.Utility.FilteSqlInfusion(base.Request["tb_LotteryNumber"]);
        string sumMoneyString = Shove._Web.Utility.GetRequest("tb_hide_SumMoney");
        string sumNumberString = Shove._Web.Utility.GetRequest("tb_hide_SumNum");
        string lotteryIdString = Shove._Web.Utility.GetRequest("HidLotteryID");
        string multipleString = Shove._Web.Utility.GetRequest("tb_Multiple");
        if (multipleString == "")
        {
            multipleString = "1";
        }
        try
        {
            HPBuyRequestInfo requestInfo = new HPBuyRequestInfo();

            decimal money = decimal.Parse(sumMoneyString);
            int multiple = int.Parse(multipleString);
            int playType = int.Parse(playTypeString);

            BuyType buyType;
            List<string> anteCodes;
            // 分析选择的玩法类型和号码
            GetAnteCodes(playType, lotteryNumber, out buyType, out anteCodes);

            string result = @"投注结果\n\n";
            try
            {
                TicketFacade ticketFacade = new TicketFacade();
                HPResponseInfo info = ticketFacade.DoBuy(CurrentUser, LotteryCode, isuseNumber, buyType, anteCodes, money, multiple);
                if (info.Code == "0000")
                {
                    result += "成功 - " + info.Message;
                }
                else
                {
                    throw new Exception("失败 - " + info.Code + " - " + info.Message);
                }
            }
            catch (Exception ex)
            {
                result += "失败!";
                LogWriter.Write(LogCategory.Lottery, "投注错误", ex);
            }
            JavaScript.Alert(this.Page, result);
        }
        catch
        {
            JavaScript.Alert(this.Page, "输入有错误,请仔细检查。");
            return;
        }
    }