Ejemplo n.º 1
0
        public async Task <IActionResult> Create([Bind("IdSong,SongName,Duration")] Songs songs)
        {
            if (ModelState.IsValid)
            {
                _context.Add(songs);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(songs));
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> Create([Bind("IdNomination,NominationName")] Nominations nominations)
        {
            if (ModelState.IsValid)
            {
                _context.Add(nominations);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(nominations));
        }
Ejemplo n.º 3
0
        public async Task <IActionResult> Create([Bind("IdCity,CityName,Description")] Cities cities)
        {
            if (ModelState.IsValid)
            {
                _context.Add(cities);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(cities));
        }
        public async Task <IActionResult> Create([Bind("IdParticipantType,ParticipantType")] ParticipantTypes participantTypes)
        {
            //if (!User.IsInRole("admin")) RedirectToAction("Denied", "Account");
            if (ModelState.IsValid)
            {
                _context.Add(participantTypes);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(participantTypes));
        }
Ejemplo n.º 5
0
        public async Task <IActionResult> Create([Bind("IdYearOfContest,YearOfContest,IdHostCity,Slogan,Stage")] Years years)
        {
            if (ModelState.IsValid)
            {
                _context.Add(years);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["IdHostCity"] = new SelectList(_context.Cities, "IdCity", "CityName", years.IdHostCity);
            return(View(years));
        }
        public async Task <IActionResult> Create([Bind("IdParticipant,ParticipantName,IdRepresentedCity,IdParticipantType,ParticipantDate,Biography")] Participants participants)
        {
            if (ModelState.IsValid)
            {
                _context.Add(participants);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["IdParticipantType"] = new SelectList(_context.ParticipantTypes, "IdParticipantType", "ParticipantType", participants.IdParticipantType);
            ViewData["IdRepresentedCity"] = new SelectList(_context.Cities, "IdCity", "CityName", participants.IdRepresentedCity);
            return(View(participants));
        }
        public async Task <IActionResult> Create([Bind("IdParticipation,IdYearOfContest,IdParticipant,IdSong,IdNomination,Place")] Participations participations)
        {
            if (ModelState.IsValid)
            {
                _context.Add(participations);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["IdParticipant"]   = new SelectList(_context.Participants, "IdParticipant", "ParticipantName", participations.IdParticipant);
            ViewData["IdSong"]          = new SelectList(_context.Songs, "IdSong", "SongName", participations.IdSong);
            ViewData["IdYearOfContest"] = new SelectList(_context.Years, "IdYearOfContest", "YearOfContest", participations.IdYearOfContest);
            ViewData["IdNomination"]    = new SelectList(_context.Nominations, "IdNomination", "NominationName", participations.IdNomination);
            return(View(participations));
        }