public async Task <IActionResult> Create([Bind("PrId,PrName,PrYear,PrInfo")] Performance performance) { if (ModelState.IsValid) { _context.Add(performance); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(performance)); }
public async Task <IActionResult> AddPerformance(int?id, [Bind("ThId,PrId,Info")] TheaterPerformances obj) { if (id != null) { ViewBag.Back = id; } if (ModelState.IsValid) { _context.Add(obj); await _context.SaveChangesAsync(); return(RedirectToAction("Performance", new { id = obj.ThId })); } ViewData["ThId"] = new SelectList(_context.Theaters, "ThId", "ThName", obj.ThId); ViewData["PrId"] = new SelectList(_context.Performance, "PrId", "PrName", obj.PrId); return(View(obj)); }
public async Task <IActionResult> Create([Bind("CoId,CoName")] Countries countries) { if (ModelState.IsValid) { _context.Add(countries); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(countries)); }
public async Task <IActionResult> Create([Bind("GnId,GnName")] Genres genres) { if (ModelState.IsValid) { _context.Add(genres); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(genres)); }
public async Task <IActionResult> Create([Bind("CtId,CtName,CoId")] Cities cities) { if (ModelState.IsValid) { _context.Add(cities); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["CoId"] = new SelectList(_context.Countries, "CoId", "CoName", cities.CoId); return(View(cities)); }
public async Task <IActionResult> Create([Bind("AuId,AuName,AuDateb,AuDated,AuCt,AuInfo")] Authors authors) { if (ModelState.IsValid) { _context.Add(authors); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["AuCt"] = new SelectList(_context.Cities, "CtId", "CtName", authors.AuCt); return(View(authors)); }