Пример #1
0
        public async Task <IActionResult> Create([Bind("Book_ID,Book_Title,Author,Publisher,Date_of_publish")] Book book)
        {
            if (ModelState.IsValid)
            {
                _context.Add(book);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(book));
        }
Пример #2
0
        public async Task <IActionResult> Create([Bind("Rental_ID,Cust_ID,Book_ID,IssueDate,ReturnDate")] Rental rental)
        {
            if (ModelState.IsValid)
            {
                _context.Add(rental);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(rental));
        }
Пример #3
0
        public async Task <IActionResult> Create([Bind("Cust_ID,FName,LName,Gender,DOB")] Customer customer)
        {
            if (ModelState.IsValid)
            {
                _context.Add(customer);
                await _context.SaveChangesAsync();

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