public static Notification GigCancelled(Gig gig) { return(new Notification(NotificationType.GigCancelled, gig)); }
public static Notification GigCreated(Gig gig) { return(new Notification(gig, NotificationType.Gigcreated)); }
public static Notification GigCanceled(Gig gig) { return(new Notification(gig, NotificationType.GigCanceled)); }
public ActionResult Create(GigFormViewModel viewModel) { if (!ModelState.IsValid) { viewModel.Genres = _context.Genres.ToList(); return View("Create", viewModel); } var gig = new Gig { ArtistId = User.Identity.GetUserId(), DateTime = viewModel.GetDateTime(), GenreId = viewModel.Genre, Venue = viewModel.Venue }; _context.Gigs.Add(gig); _context.SaveChanges(); return RedirectToAction("Index", "Home"); }