Example #1
0
        private ActionResult DealBettHigh(NameValueCollection parmas)
        {
            lock (lkbthigh)
            {
                int    typeid = int.Parse(parmas["bttypeid"]);
                int    money  = int.Parse(parmas["money"]);
                string valres = Lottery.ValidateBetMoney(parmas["expect"], typeid, money, parmas["room"]);
                if (!valres.Contains("验证通过"))
                {
                    return(APIResult("error", valres));
                }

                MD_Bett bet = new MD_Bett
                {
                    Account    = parmas["account"],
                    Room       = parmas["room"],
                    Vip        = parmas["vip"],
                    Lotterynum = parmas["expect"],
                    Money      = int.Parse(parmas["money"]),
                    Bttypeid   = int.Parse(parmas["bttypeid"])
                };

                bool betres = Lottery.AddBett(bet);
                if (betres)
                {
                    return(APIResult("success", "投注成功"));
                }
                else
                {
                    return(APIResult("error", "投注失败"));
                }
            }
        }
Example #2
0
        private ActionResult DealBettLow(NameValueCollection parmas)
        {
            MD_Bett bet = new MD_Bett
            {
                Account = WorkContext.Uid.ToString(),
                Lotterynum = parmas["expect"],
                Money = int.Parse(parmas["money"]),
                Bttype = int.Parse(parmas["btroom"])==0?"冠亚"+parmas["bttype"]:parmas["bttype"],
                Lotteryid = int.Parse(parmas["lotterytype"]),
                Roomid = int.Parse(parmas["btroom"])
            };

            bool betres = Lottery.AddBett(bet);
            if (betres)
                return APIResult("success", "投注成功");
            else
                return APIResult("error", "投注失败");
        }