Esempio n. 1
0
        public async Task <IActionResult> Create([Bind("Id,CroupierId,TableId,ConfigId,Date")] Game game)
        {
            if (ModelState.IsValid)
            {
                _context.Add(game);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["ConfigId"]   = new SelectList(_context.Config, "Id", "Id", game.ConfigId);
            ViewData["CroupierId"] = new SelectList(_context.Croupiers, "Id", "Name", game.CroupierId);
            ViewData["TableId"]    = new SelectList(_context.Tables, "Id", "Id", game.TableId);
            return(View(game));
        }
Esempio n. 2
0
        public async Task <IActionResult> Create([Bind("Id,RoundTime,MinBet,Name")] Config config)
        {
            if (ModelState.IsValid)
            {
                _context.Add(config);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(config));
        }
Esempio n. 3
0
        public async Task <IActionResult> Create([Bind("Id,MaxBet,Skill,Name")] Croupiers croupiers)
        {
            if (ModelState.IsValid)
            {
                _context.Add(croupiers);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(croupiers));
        }
Esempio n. 4
0
        public async Task <IActionResult> Create([Bind("Id,Capacity,MaxBet")] Tables tables)
        {
            if (ModelState.IsValid)
            {
                _context.Add(tables);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(tables));
        }
Esempio n. 5
0
        public async Task <IActionResult> Create([Bind("Id,Login,StartCapital,Birth")] Players players)
        {
            if (ModelState.IsValid)
            {
                _context.Add(players);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(players));
        }
Esempio n. 6
0
        public async Task <IActionResult> Create([Bind("Id,PlayerId,GameId,DeltaMoney")] GameList gameList)
        {
            if (ModelState.IsValid)
            {
                _context.Add(gameList);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["GameId"]   = new SelectList(_context.Game, "Id", "Id", gameList.GameId);
            ViewData["PlayerId"] = new SelectList(_context.Players, "Id", "Login", gameList.PlayerId);
            return(View(gameList));
        }