Beispiel #1
0
        public void BrickUserData()
        {
            var u = new H5GameRepository().Usercount(User.Identity.GetUserId()).Where(x => x.gameModel == 4).FirstOrDefault();


            new H5GameRepository().DaycountRemove(u);
            H5Bets h5b  = new H5Bets();
            var    game = new H5GameRepository().H5GetAll(4).Where(x => x.gameStatus == 1).FirstOrDefault();

            h5b.gameBets = new GameBets
            {
                userId     = User.Identity.GetUserId(),
                GameSn     = game.id,
                unitSn     = 1,
                money      = 200,
                Odds       = 0,
                valid      = 1,
                gameModel  = game.gameModel,
                createDate = DateTime.Now,
                modiDate   = DateTime.Now
            };
            new H5GameRepository().GameBets(h5b);
            AssetsRecord assr = new AssetsRecord
            {
                UserId = h5b.gameBets.userId,
                unitSn = 1,
                gameSn = h5b.gameBets.GameSn,
                assets = -200,
                type   = -1,
            };

            new AssetsRepository().Addh5gameByAssets(assr);
        }
Beispiel #2
0
        public JsonResult SlottoUserData(float money, int id, int win)
        {
            SlotVewModel slotvm = new SlotVewModel();
            var          u      = new H5GameRepository().Usercount(User.Identity.GetUserId()).Where(x => x.gameModel == 5).FirstOrDefault();

            H5Bets h5b  = new H5Bets();
            var    game = new H5GameRepository().H5GetAll(5).Where(x => x.gameStatus == 1).FirstOrDefault();

            h5b.gameBets = new GameBets
            {
                userId     = User.Identity.GetUserId(),
                GameSn     = game.id,
                unitSn     = 1,
                money      = money,
                Odds       = 0,
                valid      = 1,
                gameModel  = game.gameModel,
                createDate = DateTime.Now,
                modiDate   = DateTime.Now
            };

            new H5GameRepository().GameBets(h5b);
            AssetsRecord assr = new AssetsRecord
            {
                UserId = h5b.gameBets.userId,
                unitSn = 1,
                gameSn = h5b.gameBets.GameSn,
                assets = -(money - win),
                type   = -1,
            };

            if ((money - win) != 0)
            {
                new AssetsRepository().Addh5gameByAssets(assr);
            }


            slotvm.slotm = new H5GameRepository().GetSlotCash(id);

            slotvm.slotm.slot_cash += (money - win);

            slotvm.slotm.baseCash = (slotvm.slotm.slot_cash >= 11000) ? slotvm.slotm.slot_cash : 11000;

            var slom = new cfgSlotCash
            {
                id        = id,
                slot_cash = slotvm.slotm.slot_cash,
                baseCash  = slotvm.slotm.baseCash
            };

            new H5GameRepository().SlotCashCreate(slom);



            return(Json(slotvm, JsonRequestBehavior.AllowGet));
        }
Beispiel #3
0
 //一般下注
 public void GameBets(H5Bets instance)
 {
     if (instance == null)
     {
         throw new ArgumentNullException("instance");
     }
     else
     {
         Db.GameBets.Add(instance.gameBets);
         this.SaveChanges();
     }
 }
        public int AKBets(float money, int Number)
        {
            H5Bets h5b  = new H5Bets();
            var    game = new H5GameRepository().H5GetAll(1).Where(x => x.gameStatus == 1).FirstOrDefault();

            h5b.gameBets = new GameBets {
                userId     = User.Identity.GetUserId(),
                GameSn     = game.id,
                unitSn     = 1,
                money      = money,
                Odds       = 12,
                valid      = 1,
                gameModel  = game.gameModel,
                createDate = DateTime.Now,
                modiDate   = DateTime.Now
            };
            h5b.playnumber = new PlayerNumber {
                Number = Number
            };
            new H5GameRepository().AkBets(h5b);
            int b = 1;
            List <AssetsViewModel> avList = new List <AssetsViewModel>();

            avList = new AssetsRepository().getAssetsListByUserID(User.Identity.GetUserId());

            //玩家扣錢記錄
            if (avList.Where(x => x.unitSn == 1).FirstOrDefault().Asset >= money)
            {
                AssetsRecord assr = new AssetsRecord
                {
                    UserId     = h5b.gameBets.userId,
                    unitSn     = 1,
                    gameSn     = h5b.gameBets.GameSn,
                    assets     = -(double)money,
                    type       = -15,
                    h5forValue = game.gameModel
                };

                new AssetsRepository().Addh5gameByAssets(assr);
            }
            else
            {
                b = 0;
            }


            return(b);
            //return Json(akm, JsonRequestBehavior.AllowGet);
        }
Beispiel #5
0
 //A-K下注
 public void AkBets(H5Bets instance)
 {
     if (instance == null)
     {
         throw new ArgumentNullException("instance");
     }
     else
     {
         Db.GameBets.Add(instance.gameBets);
         this.SaveChanges();
         instance.playnumber.BetId = instance.gameBets.id;
         Db.PlayerNumber.Add(instance.playnumber);
         this.SaveChanges();
     }
 }