public async Task<IActionResult> Create([Bind("GenereID,GenreDesc")] FilmGeneres filmGeneres)
 {
     if (ModelState.IsValid)
     {
         _context.Add(filmGeneres);
         await _context.SaveChangesAsync();
         return RedirectToAction(nameof(Index));
     }
     return View(filmGeneres);
 }
Example #2
0
        public async Task <IActionResult> Create([Bind("CertificateID,FilmCertificate")] FilmCertificates filmCertificates)
        {
            if (ModelState.IsValid)
            {
                _context.Add(filmCertificates);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(filmCertificates));
        }
Example #3
0
        public async Task <IActionResult> Create([Bind("ActorID,ActorFullName,ActorNotes")] Actors actors)
        {
            if (ModelState.IsValid)
            {
                _context.Add(actors);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(actors));
        }
        public async Task <IActionResult> Create([Bind("ProducerID,ProducerName,ContactEmailAddress,WebSite")] Producers producers)
        {
            if (ModelState.IsValid)
            {
                _context.Add(producers);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(producers));
        }
Example #5
0
        public async Task <IActionResult> Create([Bind("RoleTypeID,RoleDesc")] RoleTypes roleTypes)
        {
            if (ModelState.IsValid)
            {
                _context.Add(roleTypes);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(roleTypes));
        }
Example #6
0
        public async Task <IActionResult> Create([Bind("FilmTitleID,FilmTitle,FilmStory,FilmRelaseDate,FilmDuration,FilmGenereID,FilmCertificateID,FilmAdditionalInfo")] FilmTitles filmTitles)
        {
            if (ModelState.IsValid)
            {
                _context.Add(filmTitles);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["FilmCertificateID"] = new SelectList(_context.FilmCertificates, "CertificateID", "FilmCertificate", filmTitles.FilmCertificateID);
            ViewData["FilmGenereID"]      = new SelectList(_context.FilmGeneres, "GenereID", "GenreDesc", filmTitles.FilmGenereID);
            return(View(filmTitles));
        }