Exemple #1
0
        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;
            }
        }
        public bool CreatePoster(IPhoto photo, Guid?showId)
        {
            bool final    = false;
            var  posterId = Guid.NewGuid();

            var posterService = new PosterService(Ioc.GetInstance <IPosterRepository>());
            var myShowService = new MyShowService(Ioc.GetInstance <IMyShowRepository>());
            var spService     = new MyShowPosterService(Ioc.GetInstance <IMyShowPosterRepository>());

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

            var date = DateTime.UtcNow;

            Poster p = new Poster
            {
                CreatedDate = DateTime.Now,
                PhotoId     = photo.PhotoId,
                PosterId    = posterId,
                Notes       = photo.Notes,
                UserId      = photo.UserId,
                Creator     = txtCreator.Text,
                Length      = string.IsNullOrEmpty(txtLength.Text) ? 0 : double.Parse(txtLength.Text),
                Width       = string.IsNullOrEmpty(txtWidth.Text) ? 0 : double.Parse(txtWidth.Text),
                Total       = string.IsNullOrEmpty(txtTotal.Text) ? 0 : int.Parse(txtTotal.Text),
                Number      = string.IsNullOrEmpty(txtNumber.Text) ? 0 : int.Parse(txtNumber.Text),
                Technique   = txtTechnique.Text,
                Title       = txtTitle.Text,
                ShowId      = showId
            };

            var  combinedSuccess = true;
            bool success         = false;

            var photoService = new PhotoService(Ioc.GetInstance <IPhotoRepository>());

            photoService.Save(photo, out success);

            combinedSuccess = combinedSuccess && success;

            posterService.Save(p, out success);

            combinedSuccess = combinedSuccess && success;

            var myShowPoster = new MyShowPoster
            {
                CreatedDate    = date,
                UpdatedDate    = date,
                MyShowId       = myShowId,
                MyShowPosterId = Guid.NewGuid(),
                PosterId       = posterId
            };

            spService.Save(myShowPoster, out success);

            combinedSuccess = combinedSuccess && success;

            return(combinedSuccess);
        }
        public bool CreateArt(IPhoto photo, Guid?showId)
        {
            bool final = false;
            var  artId = Guid.NewGuid();

            var artService    = new ArtService(Ioc.GetInstance <IArtRepository>());
            var myShowService = new MyShowService(Ioc.GetInstance <IMyShowRepository>());
            var spService     = new MyShowArtService(Ioc.GetInstance <IMyShowArtRepository>());

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

            var date = DateTime.UtcNow;

            Art p = new Art
            {
                CreatedDate = date,
                UpdatedDate = date,
                PhotoId     = photo.PhotoId,
                ArtId       = artId,
                Notes       = photo.Notes,
                UserId      = photo.UserId,
                ShowId      = showId
            };


            var  combinedSuccess = true;
            bool success         = false;

            var photoService = new PhotoService(Ioc.GetInstance <IPhotoRepository>());

            photoService.Save(photo, out success);

            combinedSuccess = combinedSuccess && success;

            artService.Save(p, out success);

            combinedSuccess = combinedSuccess && success;

            var myShowArt = new MyShowArt
            {
                CreatedDate = date,
                UpdatedDate = date,
                MyShowId    = myShowId,
                MyShowArtId = Guid.NewGuid(),
                ArtId       = artId
            };

            spService.Save(myShowArt, out success);

            combinedSuccess = combinedSuccess && success;

            return(combinedSuccess);
        }
Exemple #4
0
        private IMyShow GetMyShow(string myShowIdStr)
        {
            ResetPanels();

            if (string.IsNullOrEmpty(hdnMyShowId.Value))
            {
                var scriptHelper3 = new ScriptHelper("ErrorAlert", "alertDiv", "There was an error saving your review.");
                Page.RegisterStartupScript(scriptHelper3.ScriptName, scriptHelper3.GetFatalScript());
                return(null);
            }

            var myShowService = new MyShowService(Ioc.GetInstance <IMyShowRepository>());

            var myShowId = new Guid(myShowIdStr);

            return(myShowService.GetMyShow(myShowId));
        }
Exemple #5
0
        public void btnAddMyShow_Click(object sender, EventArgs e)
        {
            MyShowService myShowService = new MyShowService(Ioc.GetInstance <IMyShowRepository>());

            Guid userId = new Guid(Membership.GetUser(User.Identity.Name).ProviderUserKey.ToString());
            var  showId = new Guid(Request.QueryString["showId"]);

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

            if (myShow != null)
            {
                phMyShow.Visible       = true;
                phMyShowRating.Visible = true;
                phNotMyShow.Visible    = false;
                return;
            }

            ShowId = showId;

            var myShowId = Guid.NewGuid();

            MyShow newMyShow = new MyShow
            {
                CreatedDate = DateTime.Now,
                MyShowId    = myShowId,
                ShowId      = showId,
                UserId      = userId
            };

            bool success = false;

            myShowService.SaveCommit(newMyShow, out success);

            if (success)
            {
                phMyShow.Visible       = true;
                phMyShowRating.Visible = true;
                phNotMyShow.Visible    = false;
                hdnMyShowId.Value      = myShowId.ToString();
            }
            else
            {
                phNotMyShowFailure.Visible = true;
            }
        }
Exemple #6
0
        //private void ResetPanels()
        //{
        //    phError.Visible = false;
        //    phSuccess.Visible = false;
        //    phAlreadyAdded.Visible = false;
        //}

        public void rptShows_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            //ResetPanels();

            if (e.CommandName.ToLower() == "add")
            {
                var showService = new ShowService(Ioc.GetInstance <IShowRepository>());

                Guid userId = new Guid(Membership.GetUser(User.Identity.Name).ProviderUserKey.ToString());
                var  showId = new Guid(e.CommandArgument.ToString());

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

                if (myShow != null)
                {
                    //phAlreadyAdded.Visible = true;
                    return;
                }

                MyShow newMyShow = new MyShow
                {
                    CreatedDate = DateTime.Now,
                    MyShowId    = Guid.NewGuid(),
                    ShowId      = showId,
                    UserId      = userId
                };

                bool success = false;

                myShowService.SaveCommit(newMyShow, out success);

                if (hdnBindFrom.Value == "phishnet")
                {
                    BindFromPhishNet();
                }
                else
                {
                    BindFromYear(show.ShowDate.Value.Year);
                }
            }
        }
        private void Bind()
        {
            if (string.IsNullOrEmpty(Request.QueryString["myShowId"]))
            {
                Response.Redirect(new LinkBuilder().DashboardLink());
            }

            var myShowId = new Guid(Request.QueryString["myShowId"]);

            var myShowService = new MyShowService(Ioc.GetInstance <IMyShowRepository>());

            var myShow = myShowService.GetMyShow(myShowId);

            if (myShow != null)
            {
                SetPageTitle("Review of " + ((MyShow)myShow).Show.GetShowName());

                lblReview.Text = myShow.Notes;
            }
        }
Exemple #8
0
        private void DeleteShow(Guid showId)
        {
            var userId = new Guid(Membership.GetUser(User.Identity.Name).ProviderUserKey.ToString());

            var myShowService = new MyShowService(Ioc.GetInstance <IMyShowRepository>());

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

            myShowService.DeleteCommit(myShow);

            var showService = new ShowService(Ioc.GetInstance <IShowRepository>());

            var show = showService.GetShow(showId);

            if (show != null)
            {
                var shows = myShowService.GetShowsFromMyShowsForUser(userId);
                rptShows.DataSource = shows;
                rptShows.DataBind();
            }
        }
Exemple #9
0
        public void lnkAddMyShow_Click(object sender, EventArgs e)
        {
            var showService   = new ShowService(Ioc.GetInstance <IShowRepository>());
            var myShowService = new MyShowService(Ioc.GetInstance <IMyShowRepository>());

            Guid userId = new Guid(Membership.GetUser(User.Identity.Name).ProviderUserKey.ToString());
            var  showId = new Guid(hdnShowId.Value);

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

            if (myShow != null)
            {
                //phAlreadyAdded.Visible = true;
                return;
            }

            var newMyShow = new MyShow
            {
                CreatedDate = DateTime.Now,
                MyShowId    = Guid.NewGuid(),
                ShowId      = showId,
                UserId      = userId
            };

            bool success = false;

            myShowService.SaveCommit(newMyShow, out success);

            if (success)
            {
                BindWithShowId(showId);
            }
            else
            {
                var scriptHelper = new ScriptHelper("ErrorAlert", "alertDiv", "There was a problem adding this show. If this happens again, then please contact the administrator.");
                Page.RegisterStartupScript(scriptHelper.ScriptName, scriptHelper.GetFatalScript());
            }
        }
Exemple #10
0
        public void btnSubmitShowNotes_Click(object sender, EventArgs e)
        {
            ResetPanels();

            if (string.IsNullOrEmpty(hdnMyShowId.Value))
            {
                var scriptHelper3 = new ScriptHelper("ErrorAlert", "alertDiv", "There was an error saving your review.");
                Page.RegisterStartupScript(scriptHelper3.ScriptName, scriptHelper3.GetFatalScript());
                return;
            }

            var myShowService = new MyShowService(Ioc.GetInstance <IMyShowRepository>());

            var myShowId = new Guid(hdnMyShowId.Value);

            var myShow = myShowService.GetMyShow(myShowId);

            using (IUnitOfWork uow = UnitOfWork.Begin())
            {
                if (txtFree.Text.Length > 3000)
                {
                    var scriptHelper2 = new ScriptHelper("ErrorAlert", "alertDiv", "Your review was too long. Please keep it under 3000 characters.");
                    Page.RegisterStartupScript(scriptHelper2.ScriptName, scriptHelper2.GetFatalScript());
                    return;
                }

                myShow.Notes            = txtFree.Text;
                myShow.NotesUpdatedDate = DateTime.Now;

                uow.Commit();

                var scriptHelper = new ScriptHelper("SuccessAlert", "alertDiv", "Congratulations you have successfully saved a review for this show.");
                Page.RegisterStartupScript(scriptHelper.ScriptName, scriptHelper.GetSuccessScript());
            }

            ShowId = new Guid(hdnShowId.Value);
        }
Exemple #11
0
        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();
        }
Exemple #12
0
        private void Bind()
        {
            Guid    showId;
            IMyShow myShow;
            var     userId = new Guid(Membership.GetUser(User.Identity.Name).ProviderUserKey.ToString());

            if (string.IsNullOrEmpty(Request.QueryString["showId"]))
            {
                Response.Redirect(LinkBuilder.DashboardLink());
            }

            showId          = new Guid(Request.QueryString["showId"]);
            ShowId          = showId;
            hdnShowId.Value = showId.ToString();
            var myShowService = new MyShowService(Ioc.GetInstance <IMyShowRepository>());

            if (!string.IsNullOrEmpty(Request.QueryString["myShowId"]))
            {
                var myShowId = new Guid(Request.QueryString["myShowId"]);
                myShow = myShowService.GetMyShow(myShowId);
            }
            else
            {
                myShow = myShowService.GetMyShow(showId, userId);
            }

            if (myShow != null)
            {
                hdnMyShowId.Value = myShow.MyShowId.ToString();

                ajaxShowRating.CurrentRating     = myShow.Rating == null ? 0 : int.Parse(myShow.Rating.Value.ToString());
                ajaxBustoutRating.CurrentRating  = myShow.BustoutRating == null ? 0 : int.Parse(myShow.BustoutRating.Value.ToString());
                ajaxEnergyRating.CurrentRating   = myShow.EnergyRating == null ? 0 : int.Parse(myShow.EnergyRating.Value.ToString());
                ajaxFlowRating.CurrentRating     = myShow.FlowRating == null ? 0 : int.Parse(myShow.FlowRating.Value.ToString());
                ajaxSegueRating.CurrentRating    = myShow.SegueRating == null ? 0 : int.Parse(myShow.SegueRating.Value.ToString());
                ajaxType1JamRating.CurrentRating = myShow.Type1JamRating == null ? 0 : int.Parse(myShow.Type1JamRating.Value.ToString());
                ajaxType2JamRating.CurrentRating = myShow.Type2JamRating == null ? 0 : int.Parse(myShow.Type2JamRating.Value.ToString());

                txtFree.Text           = myShow.Notes;
                phMyShow.Visible       = true;
                phMyShowRating.Visible = true;
                phNotMyShow.Visible    = false;
            }

            //var setSongService = new SetSongService(Ioc.GetInstance<ISetSongRepository>());
            var setService = new SetService(Ioc.GetInstance <ISetRepository>());
            //var analysisService = new AnalysisService(Ioc.GetInstance<IAnalysisRepository>());
            var showService = new ShowService(Ioc.GetInstance <IShowRepository>());

            var show = showService.GetShow(showId);

            SetPageTitle("Analyze " + show.GetShowName());

            lblShow.Text = show.GetShowName();
            //var sets = setService.GetSetsForShow(showId).ToList();  //sets NEEDS to be a list here! DO NOT CHANGE DAN!

            //var ss = (from set in sets
            //          from song in setSongService.GetSetSongsBySet(set.SetId).OrderBy(z => z.Order.Value).DefaultIfEmpty()
            //          from analysis in analysisService.GetAnalysisBySetSongAndUser(song.SetSongId, userId).DefaultIfEmpty()
            //          select new { Set = set, Song = song, Analysis = analysis }).ToList();

            //rptSongs.DataSource = ss;
            //rptSongs.DataBind();
        }
        public override void ProcessRequest(HttpContextBase context)
        {
            //System.Threading.Thread.Sleep(4000);
            HttpRequestBase  request   = context.Request;
            var              showIdStr = request.QueryString["s"];
            var              userIdStr = request.QueryString["u"];
            HttpResponseBase response  = context.Response;

            var final = string.Empty;

            if (EmptyNullUndefined(showIdStr) || EmptyNullUndefined(userIdStr))
            {
                final = GetNoImagesFound();

                response.ContentType     = "application/json";
                response.ContentEncoding = Encoding.UTF8;
                response.Write(final);
                response.End();
            }

            var showId = new Guid(showIdStr);
            var userId = new Guid(userIdStr);

            MyShowService    myShowService    = new MyShowService(Ioc.GetInstance <IMyShowRepository>());
            MyShowArtService myShowArtService = new MyShowArtService(Ioc.GetInstance <IMyShowArtRepository>());
            ArtService       artService       = new ArtService(Ioc.GetInstance <IArtRepository>());

            var myShow = myShowService.GetMyShow(showId, userId);
            IList <KeyValuePair <Art, IMyShowArt> > art = new List <KeyValuePair <Art, IMyShowArt> >();

            if (myShow != null)
            {
                var myShowArts = myShowArtService.GetMyShowArtByMyShow(myShow.MyShowId);

                myShowArts.ToList().ForEach(x =>
                {
                    art.Add(new KeyValuePair <Art, IMyShowArt>((Art)artService.GetArt(x.ArtId), x));
                });
            }

            if (art == null || art.Count <= 0)
            {
                final = GetNoImagesFound();
            }

            //If there are images and no errors so far then process
            if (string.IsNullOrEmpty(final))
            {
                var json = new ImageJSONifier("records");

                foreach (var a in art)
                {
                    if (a.Key == null || a.Key.Photo == null)
                    {
                        continue;
                    }

                    json.Add(new ImageItem
                    {
                        Image       = "/images/Shows/" + a.Key.Photo.FileName,
                        Description = a.Key.Notes,
                        Title       = a.Key.Photo.NickName,
                        Link        = string.Format("DeletePicture.aspx?picid={0}&showId={1}", a.Value.MyShowArtId.ToString(), showId.ToString())
                    });
                }

                final = json.GetFinalizedJSON();
            }

            response.ContentType     = "application/json";
            response.ContentEncoding = Encoding.UTF8;
            response.Write(final);
        }