예제 #1
0
        public async Task <IActionResult> Create([Bind("Id,MovieName,MovieDescription,GenreID")] MovieModel movieModel)
        {
            if (ModelState.IsValid)
            {
                _context.Add(movieModel);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(movieModel));
        }
예제 #2
0
        public async Task <IActionResult> Create([Bind("Id,RentalID,MovieID,CustomerID,RentalDate,DueDate,ReturnDate")] RentalRecordModel rentalRecordModel)
        {
            if (ModelState.IsValid)
            {
                _context.Add(rentalRecordModel);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(rentalRecordModel));
        }
예제 #3
0
        public async Task <IActionResult> Create([Bind("Id,CustomerName,CustomerPhone")] CustomerModel customerModel)
        {
            if (ModelState.IsValid)
            {
                _context.Add(customerModel);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(customerModel));
        }