Exemple #1
0
        public List <string> RequestTicket_BJDCSingleScheme(GatewayTicketOrder_SingleScheme order, out List <string> realMatchIdArray)
        {
            var selectMatchIdArray = order.SelectMatchId.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries);
            var allowCodeArray     = order.AllowCodes.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries);

            //var codeText = File.ReadAllText(order.AnteCodeFullFileName, Encoding.UTF8);
            var codeText    = Encoding.UTF8.GetString(order.FileBuffer);
            var matchIdList = new List <string>();
            var codeList    = AnalyzerFactory.CheckSingleSchemeAnteCode(codeText, order.PlayType, order.ContainsMatchId, selectMatchIdArray, allowCodeArray, out matchIdList);
            var totalMoney  = codeList.Count * 2M * order.Amount;

            if (totalMoney != order.TotalMoney)
            {
                throw new ArgumentException(string.Format("订单金额不正确,应该为:{0};实际为:{1}。订单号:{2}", totalMoney, order.TotalMoney, order.OrderId));
            }
            realMatchIdArray = order.ContainsMatchId ? matchIdList : selectMatchIdArray.ToList();

            var manager = new Sports_Manager();

            if (manager.QuerySingleSchemeOrder(order.OrderId) == null)
            {
                manager.AddSingleSchemeOrder(new SingleSchemeOrder
                {
                    AllowCodes = order.AllowCodes,
                    Amount     = order.Amount,
                    FileBuffer = Encoding.UTF8.GetString(order.FileBuffer),
                    //AnteCodeFullFileName = order.AnteCodeFullFileName,
                    ContainsMatchId = order.ContainsMatchId,
                    CreateTime      = DateTime.Now,
                    GameCode        = order.GameCode,
                    GameType        = order.GameType,
                    IssuseNumber    = order.IssuseNumber,
                    IsVirtualOrder  = order.IsVirtualOrder,
                    OrderId         = order.OrderId,
                    PlayType        = order.PlayType,
                    SelectMatchId   = order.SelectMatchId,
                    TotalMoney      = order.TotalMoney,
                });
            }

            return(codeList);
        }
        public List <string> RequestTicket_CTZQSingleScheme(GatewayTicketOrder_SingleScheme order)
        {
            //var codeText = File.ReadAllText(order.AnteCodeFullFileName, Encoding.UTF8);
            var codeText           = Encoding.UTF8.GetString(order.FileBuffer);
            var allowCodeArray     = order.AllowCodes.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries);
            var ctzqMatchIdList    = new List <string>();
            var ctzqCodeList       = AnalyzerFactory.CheckCTZQSingleSchemeAnteCode(codeText, order.GameType, allowCodeArray, out ctzqMatchIdList);
            var betCount           = ctzqCodeList.Count;
            var totalMatchCount    = ctzqMatchIdList.Count;
            var selectMatchIdArray = ctzqMatchIdList.ToArray();
            var selectMatchId      = string.Join(",", selectMatchIdArray);

            var manager = new Sports_Manager();

            if (manager.QuerySingleSchemeOrder(order.OrderId) == null)
            {
                manager.AddSingleSchemeOrder(new SingleSchemeOrder
                {
                    AllowCodes = order.AllowCodes,
                    Amount     = order.Amount,
                    FileBuffer = Encoding.UTF8.GetString(order.FileBuffer),
                    //AnteCodeFullFileName = order.AnteCodeFullFileName,
                    ContainsMatchId = order.ContainsMatchId,
                    CreateTime      = DateTime.Now,
                    GameCode        = order.GameCode,
                    GameType        = order.GameType,
                    IssuseNumber    = order.IssuseNumber,
                    IsVirtualOrder  = order.IsVirtualOrder,
                    OrderId         = order.OrderId,
                    PlayType        = order.PlayType,
                    SelectMatchId   = selectMatchId,
                    TotalMoney      = order.TotalMoney,
                });
            }

            return(ctzqCodeList);
        }