private void Remove(Guid ticketStubId)
        {
            if (string.IsNullOrEmpty(ddlShows.SelectedValue))
                return;

            ResetPanels();

            Guid showId = new Guid(ddlShows.SelectedValue);

            MyShowService myShowService = new MyShowService(Ioc.GetInstance<IMyShowRepository>());
            MyShowTicketStubService myShowTicketStubService = new MyShowTicketStubService(Ioc.GetInstance<IMyShowTicketStubRepository>());

            var myShow = myShowService.GetMyShow(showId, userId);
            var myShowTicketStub = myShowTicketStubService.GetMyShowTicketStubByMyShowAndTicketStubId(myShow.MyShowId, ticketStubId);

            bool success = false;

            if (myShowTicketStub != null)
            {
                myShowTicketStubService.DeleteCommit(myShowTicketStub);
                success = true;
            }

            if (success)
            {
                phRemoveSuccess.Visible = true;
                ShowFromShow(ticketStubId);
            }
            else
                phRemoveError.Visible = true;
        }
        private void ShowFromShow(Guid? ticketStubId)
        {
            if (string.IsNullOrEmpty(ddlShows.SelectedValue))
                return;

            Guid showId = new Guid(ddlShows.SelectedValue);

            MyShowService myShowService = new MyShowService(Ioc.GetInstance<IMyShowRepository>());
            MyShowTicketStubService myShowTicketStubService = new MyShowTicketStubService(Ioc.GetInstance<IMyShowTicketStubRepository>());
            TicketStubService ticketStubService = new TicketStubService(Ioc.GetInstance<ITicketStubRepository>());

            var myShow = myShowService.GetMyShow(showId, userId);

            var myShowTicketStubs = myShowTicketStubService.GetMyShowTicketStubByMyShow(myShow.MyShowId);

            IList<ITicketStub> ticketStubs = new List<ITicketStub>();

            myShowTicketStubs.ToList().ForEach(x =>
            {
                ticketStubs.Add(ticketStubService.GetTicketStub(x.TicketStubId));
            });

            if (ticketStubId != null)
            {
                ticketStubs = ticketStubs.Where(x => x.TicketStubId != ticketStubId).ToList();
            }

            if (ticketStubs == null || ticketStubs.Count <= 0)
            {
                phNoImages.Visible = true;
            }

            rptTicketStubs.DataSource = ticketStubs;
            rptTicketStubs.DataBind();
        }
        public bool CreateTicketStubNow(IPhoto photo, Guid? showId)
        {
            bool final = false;
            var ticketStubId = Guid.NewGuid();

            using (IUnitOfWork uow = UnitOfWork.Begin())
            {
                var ticketStubService = new TicketStubService(Ioc.GetInstance<ITicketStubRepository>());
                var myShowService = new MyShowService(Ioc.GetInstance<IMyShowRepository>());
                var spService = new MyShowTicketStubService(Ioc.GetInstance<IMyShowTicketStubRepository>());

                var userId = new Guid(Membership.GetUser(User.Identity.Name).ProviderUserKey.ToString());
                //var myShowId = myShowService.GetMyShow(showId.Value, userId).MyShowId;

                TicketStub p = new TicketStub
                {
                    CreatedDate = DateTime.Now,
                    PhotoId = photo.PhotoId,
                    TicketStubId = ticketStubId,
                    Notes = photo.Notes,
                    UserId = photo.UserId,
                    ShowId = showId
                };

                bool success = false;
                ticketStubService.Save(p, out success);

                if (success)
                {
                    uow.Commit();
                }
            }

            return final;
        }