예제 #1
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,GameId,PersonId,PersonId1,PersonId2,PersonId3,HD1Fee,HD1TravelKost,HD1Alowens,HD1LateGameKost,HD1TotalFee,HD2Fee,HD2TravelKost,HD2Alowens,HD2LateGameKost,HD2TotalFee,LD1Fee,LD1TravelKost,LD1Alowens,LD1LateGameKost,LD1TotalFee,LD2Fee,LD2TravelKost,LD2Alowens,LD2LateGameKost,LD2TotalFee,GameTotalKost,AmountPaidHD1,AmountPaidHD2,AmountPaidLD1,AmountPaidLD2,TotalAmountPaid,TotalAmountToPay,ReceiptStatusId")] GameReceipt gameReceipt)
        {
            if (id != gameReceipt.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(gameReceipt);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!GameReceiptExists(gameReceipt.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["GameId"]          = new SelectList(_context.Game, "Id", "Id", gameReceipt.GameId);
            ViewData["PersonId"]        = new SelectList(_context.Person, "Id", "Id", gameReceipt.PersonId);
            ViewData["PersonId1"]       = new SelectList(_context.Person, "Id", "Id", gameReceipt.PersonId1);
            ViewData["PersonId2"]       = new SelectList(_context.Person, "Id", "Id", gameReceipt.PersonId2);
            ViewData["PersonId3"]       = new SelectList(_context.Person, "Id", "Id", gameReceipt.PersonId3);
            ViewData["ReceiptStatusId"] = new SelectList(_context.Set <ReceiptStatus>(), "Id", "Id", gameReceipt.ReceiptStatusId);
            return(View(gameReceipt));
        }
예제 #2
0
        public async Task <IActionResult> Edit(int id, [Bind
                                                            ("Id,GameId,PersonId,PersonId1,PersonId2,PersonId3,HD1Fee," +
                                                            "HD1TravelKost,HD1Alowens,HD1LateGameKost,HD1TotalFee,HD2Fee,HD2TravelKost,HD2Alowens,HD2LateGameKost," +
                                                            "HD2TotalFee,LD1Fee,LD1TravelKost,LD1Alowens,LD1LateGameKost,LD1TotalFee,LD2Fee,LD2TravelKost,LD2Alowens," +
                                                            "LD2LateGameKost,LD2TotalFee,GameTotalKost,ReceiptStatusId,HD1Other,HD2Other,LD1Other,LD2Other," +
                                                            "AmountPaidHD1,AmountPaidHD2,AmountPaidLD1,AmountPaidLD2,TotalAmountPaid,TotalAmountToPay")] GameReceipt gameReceipt)
        {
            if (id != gameReceipt.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    var applicationDbContext = _context.GameReceipt
                                               .Include(gr => gr.Game)
                                               .Include(gr => gr.Game.Arena)
                                               .Include(gr => gr.Game.HomeTeam)
                                               .Include(gr => gr.Game.AwayTeam)
                                               .Include(gr => gr.HD1)
                                               .Include(gr => gr.HD2)
                                               .Include(gr => gr.LD1)
                                               .Include(gr => gr.LD2)
                                               .Include(gr => gr.ReceiptStatus);
                    gameReceipt.HD1TotalFee   = gameReceipt.HD1Fee + gameReceipt.HD1TravelKost + gameReceipt.HD1Alowens + gameReceipt.HD1LateGameKost + gameReceipt.HD1Other;
                    gameReceipt.HD2TotalFee   = gameReceipt.HD2Fee + gameReceipt.HD2TravelKost + gameReceipt.HD2Alowens + gameReceipt.HD2LateGameKost + gameReceipt.HD2Other;
                    gameReceipt.LD1TotalFee   = gameReceipt.LD1Fee + gameReceipt.LD1TravelKost + gameReceipt.LD1Alowens + gameReceipt.LD1LateGameKost + gameReceipt.LD1Other;
                    gameReceipt.LD2TotalFee   = gameReceipt.LD2Fee + gameReceipt.LD2TravelKost + gameReceipt.LD2Alowens + gameReceipt.LD2LateGameKost + gameReceipt.LD2Other;
                    gameReceipt.GameTotalKost = gameReceipt.HD1TotalFee + gameReceipt.HD2TotalFee + gameReceipt.LD1TotalFee + gameReceipt.LD2TotalFee;

                    _context.Update(gameReceipt);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!GameReceiptExists(gameReceipt.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(GameReceiptCreated)));
            }

            ViewData["GameId"]          = new SelectList(_context.Game, "Id", "GameNumber", gameReceipt.GameId);
            ViewData["PersonId"]        = new SelectList(_context.Person, "Id", "FullName", gameReceipt.PersonId);
            ViewData["PersonId1"]       = new SelectList(_context.Person, "Id", "FullName", gameReceipt.PersonId1);
            ViewData["PersonId2"]       = new SelectList(_context.Person, "Id", "FullName", gameReceipt.PersonId2);
            ViewData["PersonId3"]       = new SelectList(_context.Person, "Id", "FullName", gameReceipt.PersonId3);
            ViewData["ReceiptStatusId"] = new SelectList(_context.ReceiptStatus, "Id", "ReceiptStatusName", gameReceipt.ReceiptStatusId);
            return(View(gameReceipt));
        }
예제 #3
0
        public async Task <IActionResult> Create([Bind("Id,GameId,PersonId,PersonId1,PersonId2,PersonId3,HD1Fee,HD1TravelKost,HD1Alowens,HD1LateGameKost,HD1TotalFee,HD2Fee,HD2TravelKost,HD2Alowens,HD2LateGameKost,HD2TotalFee,LD1Fee,LD1TravelKost,LD1Alowens,LD1LateGameKost,LD1TotalFee,LD2Fee,LD2TravelKost,LD2Alowens,LD2LateGameKost,LD2TotalFee,GameTotalKost,AmountPaidHD1,AmountPaidHD2,AmountPaidLD1,AmountPaidLD2,TotalAmountPaid,TotalAmountToPay,ReceiptStatusId")] GameReceipt gameReceipt)
        {
            if (ModelState.IsValid)
            {
                _context.Add(gameReceipt);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["GameId"]          = new SelectList(_context.Game, "Id", "Id", gameReceipt.GameId);
            ViewData["PersonId"]        = new SelectList(_context.Person, "Id", "Id", gameReceipt.PersonId);
            ViewData["PersonId1"]       = new SelectList(_context.Person, "Id", "Id", gameReceipt.PersonId1);
            ViewData["PersonId2"]       = new SelectList(_context.Person, "Id", "Id", gameReceipt.PersonId2);
            ViewData["PersonId3"]       = new SelectList(_context.Person, "Id", "Id", gameReceipt.PersonId3);
            ViewData["ReceiptStatusId"] = new SelectList(_context.Set <ReceiptStatus>(), "Id", "Id", gameReceipt.ReceiptStatusId);
            return(View(gameReceipt));
        }
예제 #4
0
        public IActionResult GRsHAHC(GameReceipt gameReceipt)
        {
            var applicationDbContext = _context.GameReceipt
                                       .Include(gr => gr.Game)
                                       .Include(gr => gr.Game.Arena)
                                       .Include(gr => gr.Game.HomeTeam)
                                       .Include(gr => gr.Game.AwayTeam)
                                       .Include(gr => gr.HD1)
                                       .Include(gr => gr.HD2)
                                       .Include(gr => gr.LD1)
                                       .Include(gr => gr.LD2)
                                       .Include(gr => gr.ReceiptStatus).Where(gr => gr.ReceiptStatusId == 5);

            gameReceipt.HD1TotalFee   = gameReceipt.HD1Fee + gameReceipt.HD1TravelKost + gameReceipt.HD1Alowens + gameReceipt.HD1LateGameKost + gameReceipt.HD1Other;
            gameReceipt.HD2TotalFee   = gameReceipt.HD2Fee + gameReceipt.HD2TravelKost + gameReceipt.HD2Alowens + gameReceipt.HD2LateGameKost + gameReceipt.HD2Other;
            gameReceipt.LD1TotalFee   = gameReceipt.LD1Fee + gameReceipt.LD1TravelKost + gameReceipt.LD1Alowens + gameReceipt.LD1LateGameKost + gameReceipt.LD1Other;
            gameReceipt.LD2TotalFee   = gameReceipt.LD2Fee + gameReceipt.LD2TravelKost + gameReceipt.LD2Alowens + gameReceipt.LD2LateGameKost + gameReceipt.LD2Other;
            gameReceipt.GameTotalKost = gameReceipt.HD1TotalFee + gameReceipt.HD2TotalFee + gameReceipt.LD1TotalFee + gameReceipt.LD2TotalFee;
            return(View(gameReceipt));
        }
예제 #5
0
        public async Task <IActionResult> Create([Bind
                                                      ("Id,GameId,PersonId,PersonId1,PersonId2,PersonId3,HD1Fee," +
                                                      "HD1TravelKost,HD1Alowens,HD1LateGameKost,HD1TotalFee,HD2Fee,HD2TravelKost,HD2Alowens,HD2LateGameKost," +
                                                      "HD2TotalFee,LD1Fee,LD1TravelKost,LD1Alowens,LD1LateGameKost,LD1TotalFee,LD2Fee,LD2TravelKost,LD2Alowens," +
                                                      "LD2LateGameKost,LD2TotalFee,GameTotalKost,ReceiptStatusId,HD1Other,HD2Other,LD1Other,LD2Other," +
                                                      "AmountPaidHD1,AmountPaidHD2,AmountPaidLD1,AmountPaidLD2,TotalAmountPaid,TotalAmountToPay")] GameReceipt gameReceipt)
        {
            if (ModelState.IsValid)
            {
                var applicationDbContext = _context.GameReceipt
                                           .Include(gr => gr.Game)
                                           .Include(gr => gr.Game.Arena)
                                           .Include(gr => gr.Game.HomeTeam)
                                           .Include(gr => gr.Game.AwayTeam)
                                           .Include(gr => gr.HD1)
                                           .Include(gr => gr.HD2)
                                           .Include(gr => gr.LD1)
                                           .Include(gr => gr.LD2)
                                           .Include(gr => gr.ReceiptStatus);
                gameReceipt.HD1TotalFee   = gameReceipt.HD1Fee + gameReceipt.HD1TravelKost + gameReceipt.HD1Alowens + gameReceipt.HD1LateGameKost + gameReceipt.HD1Other;
                gameReceipt.HD2TotalFee   = gameReceipt.HD2Fee + gameReceipt.HD2TravelKost + gameReceipt.HD2Alowens + gameReceipt.HD2LateGameKost + gameReceipt.HD2Other;
                gameReceipt.LD1TotalFee   = gameReceipt.LD1Fee + gameReceipt.LD1TravelKost + gameReceipt.LD1Alowens + gameReceipt.LD1LateGameKost + gameReceipt.LD1Other;
                gameReceipt.LD2TotalFee   = gameReceipt.LD2Fee + gameReceipt.LD2TravelKost + gameReceipt.LD2Alowens + gameReceipt.LD2LateGameKost + gameReceipt.LD2Other;
                gameReceipt.GameTotalKost = gameReceipt.HD1TotalFee + gameReceipt.HD2TotalFee + gameReceipt.LD1TotalFee + gameReceipt.LD2TotalFee;

                _context.Add(gameReceipt);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(GameReceiptCreated)));
            }
            //ViewData["ArenaId"] = new SelectList(_context.Arena, "Id", "ArenaName", gameReceipt.Game.ArenaId);
            ViewData["GameId"]          = new SelectList(_context.Game, "Id", "GameNumber", gameReceipt.GameId);
            ViewData["PersonId"]        = new SelectList(_context.Person, "Id", "FullName", gameReceipt.PersonId);
            ViewData["PersonId1"]       = new SelectList(_context.Person, "Id", "FullName", gameReceipt.PersonId1);
            ViewData["PersonId2"]       = new SelectList(_context.Person, "Id", "FullName", gameReceipt.PersonId2);
            ViewData["PersonId3"]       = new SelectList(_context.Person, "Id", "FullName", gameReceipt.PersonId3);
            ViewData["ReceiptStatusId"] = new SelectList(_context.ReceiptStatus, "Id", "ReceiptStatusName", gameReceipt.ReceiptStatusId);
            return(View(gameReceipt));
        }