コード例 #1
0
ファイル: Notification.cs プロジェクト: mc-carthy/dnGighub
 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
ファイル: GigsController.cs プロジェクト: rinckd/angular2
        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");
        }