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