public FavoriteLiveSongList(SetSong setSong, Show show)
        {
            LiveSong = new SetSong();
            FavoriteLiveShows = new List<Show>();
            HighestRatedShows = new List<Show>();

            FavoriteLiveShows.Add(show);
            LiveSong = setSong;
        }
 public void AddFavorite(SetSong song, Show show)
 {
     LiveSong = song;
     FavoriteLiveShows.Add(show);
 }
 public void AddFavoriteSongPair(FavoriteVersion fave, SetSong setSong, Show show)
 {
     SongList.Add(new FavoriteSetSong { Favorite = fave,  LiveSong = setSong, LiveShow = show });
 }
Esempio n. 4
0
        public void btnSubmit_Click(object sender, EventArgs e)
        {
            ShowService service = new ShowService(Ioc.GetInstance<IShowRepository>());

            bool success = false;
            short? rank;
            DateTime? showDate;
            Guid? showId = null;
            Guid? tourId = null;

            if (Validated(out rank, out showDate))
            {
                //order = ddlOrder.SelectedValue != "0" ? (short?)short.Parse(ddlOrder.SelectedValue) : null;

                if (string.IsNullOrEmpty(txtGuid.Text))
                {
                    showId = Guid.NewGuid();
                }
                else
                {
                    showId = new Guid(txtGuid.Text);
                }

                Show show = new Show()
                {
                    ShowId = showId.Value,
                    //ShowName = txtShowName.Text.Trim(),
                    VenueName = txtVenueName.Text.Trim(),
                    City = txtCity.Text.Trim(),
                    State = ddlStates.SelectedValue.Trim(),
                    Country = ddlCountry.Text.Trim(),
                    //Order = order,
                    //TicketPrice = ticketPrice,
                    Notes = txtNotes.Text.Trim(),
                    ShowDate = showDate,
                    //Official = chkOfficial.Checked,
                    UserId = new Guid(Membership.GetUser(User.Identity.Name).ProviderUserKey.ToString()),
                    TourId = tourId
                };

                service.SaveCommit(show, out success);
            }

            if (success)
            {
                lnkAddSetsToShow.NavigateUrl = LinkBuilder.AddSetsToShowLink(showId.Value);
                phAddSetsToShow.Visible = true;
                phSuccess.Visible = true;
                phError.Visible = false;
            }
            else
            {
                phError.Visible = true;
                phSuccess.Visible = false;
            }
        }
        private void RemoveSet(Set set, Show show, ref SetService setService)
        {
            set.Deleted = true;
            set.DeletedDate = DateTime.Now;

            setService.Delete(set);

            short? setNumber = 1;

            var setList = show.Sets.OrderBy(x => x.SetNumber).Where(x => x.SetId != set.SetId);

            foreach (var s in setList)
            {
                s.SetNumber = setNumber;
                setNumber++;
            }
        }
        private void MoveSetUp(Set set, Show show, ref SetService setService)
        {
                if (set.SetNumber != 1)
                {
                    var setBefore = (Set)setService.GetSet(show.Sets.Where(x => x.SetNumber == set.SetNumber - 1).First().SetId);

                    set.SetNumber--;
                    setBefore.SetNumber++;
                }
        }
        private void MoveSetDown(Set set, Show show, ref SetService setService)
        {
            if (set.SetNumber != show.Sets.OrderBy(x => x.SetNumber).Last().SetNumber)
            {
                var songAfter = (Set)setService.GetSet(show.Sets.Where(x => x.SetNumber == set.SetNumber + 1).First().SetId);

                set.SetNumber++;
                songAfter.SetNumber--;
            }
        }
 public void AddFavoriteSongPair(FavoriteVersion fave, SetSong setSong, Show show)
 {
     SongList.Add(new FavoriteSetSong {
         Favorite = fave, LiveSong = setSong, LiveShow = show
     });
 }