Beispiel #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        // Set page title
        Page.Title = "Give to a project";

        // Set top level navigation
        Master.TopLevelNavigation = Utilities.TopLevelNavigation.Give;

        if (String.IsNullOrEmpty((string)Page.RouteData.Values["ID"]))
        {
            // Don't load project specific content
            fullProjectInformation.Visible = false;

            // Get projects and bind to repeater
            var projects = BusinessLogic.Project.GetAllProjects();

            projectRepeater.ItemDataBound += projectRepeater_ItemDataBound;
            projectRepeater.DataSource     = projects;
            projectRepeater.DataBind();
        }
        else
        {
            // Add donate to side nav
            string onclickJS = "ScrollTo('scrollToAnchor', 'payPalContainer'); return false;";
            Master.AddSideNavItem(new BusinessLogic.SideNavigationItem("navDonateNow", "#", "Donate to project", "", false, true, onclickJS));

            // Set autoplay
            ucprojectImages.Autoplay = true;

            // Get project
            var project = BusinessLogic.Project.FindProject(Page.RouteData.Values["ID"].ToString());
            this.selectedProject = project;

            // Get images for TN3
            List <BusinessLogic.TN3Image> tn3Images = new List <BusinessLogic.TN3Image>();
            var relatedMedia = project.RelatedMedias.Where(x => x.MediaType.Type == "TN3Image");
            foreach (BusinessLogic.RelatedMedia rm in relatedMedia)
            {
                tn3Images.Add(new BusinessLogic.TN3Image(rm.TitleOrName, rm.DescriptionOrAltText, rm.URL, rm.DescriptionOrAltText));
            }

            ucprojectImages.TN3Images = tn3Images;

            // Remove welcoming paragraph
            projectListContainer.Visible = false;


            ucPayPal.DataBind();
        }
    }