Example #1
0
 public void Visit(ShowCreate node)
 {
     if (node.CreateType == CreateType.Table)
     {
         TableMetaRead(node.Id);
     }
 }
        public ActionResult CreateShowFromVenueIndex(int id)
        {
            var service = NewVenueService();
            var venue   = service.GetVenueByID(id);

            ViewBag.VenueName = venue.VenueName;
            var showCreate = new ShowCreate
            {
                VenueID = id
            };

            return(View(showCreate));
        }
Example #3
0
        public IHttpActionResult Post(ShowCreate show)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            ShowService showService = CreateShowService();

            if (!showService.CreateShow(show))
            {
                return(InternalServerError());
            }
            return(Ok());
        }
Example #4
0
        public ActionResult Create(ShowCreate model)
        {
            if (!ModelState.IsValid)
            {
                return(View(model));
            }

            var userId  = Guid.Parse(User.Identity.GetUserId());
            var service = new ShowService(userId);

            service.CreateShow(model);

            return(RedirectToAction("Index"));
        }
Example #5
0
        public bool CreateShow(ShowCreate model)
        {
            var entity = new Show()
            {
                ShowName   = model.ShowName,
                VenueID    = model.VenueID,
                DateOfShow = model.DateOfShow
            };

            using (var ctx = new ApplicationDbContext())
            {
                ctx.Shows.Add(entity);
                return(ctx.SaveChanges() == 1);
            }
        }
Example #6
0
        public ActionResult Create(ShowCreate model)
        {
            if (!ModelState.IsValid)
            {
                return(View(model));
            }
            var service = CreateShowService();

            if (service.CreateShow(model))
            {
                TempData["SaveResult"] = "Your show was created";
                return(RedirectToAction("Index"));
            }
            ;
            ModelState.AddModelError("", "Show could not be created");
            return(View(model));
        }
Example #7
0
        public bool CreateShow(ShowCreate model)
        {
            Show show = new Show
            {
                Name      = model.Name,
                TargetAge = model.TargetAge,
                Capacity  = model.Capacity,
                RunTime   = model.RunTime,
                AreaId    = model.AreaId,
            };

            using (var ctx = new ApplicationDbContext())
            {
                ctx.Shows.Add(show);
                return(ctx.SaveChanges() == 1);
            }
        }
Example #8
0
        public ActionResult Create(ShowCreate model)
        {
            if (!ModelState.IsValid)
            {
                ModelState.AddModelError("", "Could not add show, please make sure all fields are filled");
                return(View(model));
            }

            ShowService service = new ShowService();

            if (service.CreateShow(model))
            {
                return(RedirectToAction("AllShows"));
            }

            return(View(model));
        }
Example #9
0
        public bool CreateShow(ShowCreate model)
        {
            var entity =
                new Show()
            {
                OwnerId     = _userId,
                Title       = model.Title,
                Description = model.Description,
                Actors      = model.Actors
            };

            using (var ctx = new ApplicationDbContext())
            {
                ctx.Shows.Add(entity);
                return(ctx.SaveChanges() == 1);
            }
        }
        public bool CreateShow(ShowCreate model)
        {
            var entity =
                new Show()
            {
                AuthorId       = _userId,
                Title          = model.Title,
                Description    = model.Description,
                MaturityRating = model.MaturityRating,
                SeasonCount    = model.SeasonCount
            };

            using (var ctx = new ApplicationDbContext())
            {
                ctx.Shows.Add(entity);
                return(ctx.SaveChanges() == 1);
            }
        }
Example #11
0
        public bool CreateShow(ShowCreate model)
        {
            var entity =
                new Show()
            {
                UserId   = _userId,
                BandName = model.Band,
                Venue    = model.Venue,
                Location = model.Location,
                Date     = model.Date,
                SetList  = model.SetList
            };

            using (var ctx = new ApplicationDbContext())
            {
                ctx.Shows.Add(entity);
                return(ctx.SaveChanges() == 1);
            }
        }
Example #12
0
        public bool CreateShow(ShowCreate model)
        {
            Show newShow = new Show()
            {
                Title             = model.Title,
                Description       = model.Description,
                PosterUrl         = model.PosterUrl,
                PremierDate       = model.PremierDate,
                Genre             = model.Genre,
                Franchise         = model.Franchise,
                AnticipationValue = model.AnticipationValue
            };

            using (var ctx = new ApplicationDbContext())
            {
                ctx.Shows.Add(newShow);
                return(ctx.SaveChanges() == 1);
            }
        }
Example #13
0
        public bool CreateShow(ShowCreate model)
        {
            var newShow =
                new Show()
            {
                Title       = model.Title,
                Description = model.Description,
                ReleaseDate = model.ReleaseDate,
                CreaterID   = _userId,
                Season      = model.Season,
                Episode     = model.Episode
            };

            using (var context = new ApplicationDbContext())
            {
                context.Shows.Add(newShow);
                return(context.SaveChanges() == 1);
            }
        }
Example #14
0
        public bool CreateShow(ShowCreate model)
        {
            var entity =
                new Show()
            {
                OwnerId      = _userId,
                ShowName     = model.ShowName,
                DirectorName = model.DirectorName,
                Duration     = model.Duration,
                GenreOfShow  = model.GenreOfShow,
                DateRelease  = model.DateRelease,
                CreatedUtc   = DateTimeOffset.Now
            };

            using (var ctx = new ApplicationDbContext())
            {
                ctx.Shows.Add(entity);
                return(ctx.SaveChanges() == 1);
            }
        }
        public bool CreateShow(ShowCreate model)
        {
            var entity =
                new Show()
            {
                OwnerId     = _userId,
                ArtistId    = model.ArtistId,
                Title       = model.Title,
                CityOfVenue = model.CityOfVenue,
                Date        = model.Date,
                Cost        = model.Cost,
                Sales       = model.Sales
            };

            using (var ctx = new ApplicationDbContext())
            {
                ctx.Shows.Add(entity);
                return(ctx.SaveChanges() == 1);
            }
        }
        public ActionResult Create(ShowCreate model)
        {
            if (!ModelState.IsValid)
            {
                return(View(model));
            }

            var service = CreateShowService();

            if (service.CreateShow(model))
            {
                TempData["SaveResult"] = "Show was added.";
                return(RedirectToAction("Index"));
            }
            ;
            ModelState.AddModelError("", "Show could not be added.");
            ViewBag.ArtistId = new SelectList(service.Artists(), "ArtistId", "ArtistName", model.ArtistId);

            return(View(model));
        }
        public bool CreateShow(ShowCreate model)
        {
            var entity =
                new Show()
            {
                OwnerID       = _userID,
                Title         = model.Title,
                MainCast      = model.MainCast,
                Description   = model.Description,
                YearReleased  = model.YearReleased,
                YearStarted   = model.YearStarted,
                YearFinished  = model.YearFinished,
                IsRecommended = model.IsRecommended,
                CreatedUtc    = DateTimeOffset.Now
            };

            using (var ctx = new ApplicationDbContext())
            {
                ctx.Shows.Add(entity);
                return(ctx.SaveChanges() == 1);
            }
        }
Example #18
0
 public virtual void Visit(ShowCreate node)
 {
     VisitInternal(node.Id);
 }