Ejemplo n.º 1
0
 public static Notification GigCancelled(Gig gig)
 {
     return(new Notification(NotificationType.GigCancelled, gig));
 }
Ejemplo n.º 2
0
 public static Notification GigCreated(Gig gig)
 {
     return(new Notification(gig, NotificationType.Gigcreated));
 }
Ejemplo n.º 3
0
 public static Notification GigCanceled(Gig gig)
 {
     return(new Notification(gig, NotificationType.GigCanceled));
 }
Ejemplo n.º 4
0
        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");
        }