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