예제 #1
0
    /// <summary>
    /// Event handler for page_load event
    /// </summary>
    /// <param name="sender">a sender</param>
    /// <param name="e">a e</param>
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (QueryStringVerifier.IsNumberAndIsNotNull(Request.QueryString["Id"]))
            {
                int cityId = Convert.ToInt32(Request.QueryString["Id"]);
                LoadCity(cityId);

                if (_geoCity.Count > 0)
                {
                    DisplayCity();

                    if (_geoCity[0].ImageCollection.Count > 0)
                    {
                        DisplayRelatedImages();
                    }
                    else
                    {
                        pnlImages.Visible = false;
                    }
                }
            }
            else
            {
                Response.Redirect("./Error.aspx");
            }
        }
    }
예제 #2
0
    /// <summary>
    /// Event handler for page_load event
    /// </summary>
    /// <param name="sender">a sender</param>
    /// <param name="e">a e</param>
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (QueryStringVerifier.IsNumberAndIsNotNull(Request.QueryString["Id"]))
            {
                int postId = Convert.ToInt32(Request.QueryString["Id"]);
                LoadPost(postId);

                if (_post.Count > 0)
                {
                    DisplayPost();

                    if (_post[0].ImageCollection.Count > 0)
                    {
                        // Display image area if images
                        DisplayRelatedImage();
                    }
                    else
                    {
                        // Hide image area if no images
                        pnlImages.Visible = false;
                    }

                    if (_post[0].User.PostCollection.Count > 0)
                    {
                        // Display post area if post
                        DisplayRelatedPost();
                    }
                    else
                    {
                        // Hide post area if no post
                        pnlImages.Visible = false;
                    }
                }
            }
            else
            {
                Response.Redirect("Error.aspx");
            }
        }
    }
예제 #3
0
    /// <summary>
    /// Event handler for the page load event
    /// </summary>
    /// <param name="sender">a sender</param>
    /// <param name="e">a e</param>
    protected void Page_Load(object sender, EventArgs e)
    {
        if (QueryStringVerifier.IsNumberAndIsNotNull(Request.QueryString["id"]))
        {
            // Retrieve _imageID on first page_load
            _imageID = Convert.ToInt32(Request.QueryString["id"]);

            if (!IsPostBack)
            {
                LoadImage();
                LoadReviews();

                if (_image.Count > 0)
                {
                    DisplayImage();

                    if (_collectionReview.Count > 0)
                    {
                        // Display image area if reviews
                        DisplayReviews();
                    }
                    else
                    {
                        // Hide area if no reviews
                        pnlImagesReview.Visible = false;
                    }

                    if (_image[0].Country.ImageCollection.Count > 0)
                    {
                        // Display image area if images
                        DisplayRelatedImageCountry();
                    }
                    else
                    {
                        // Hide image area if no images
                        pnlImagesCountry.Visible = false;
                    }

                    if (_image[0].Post.ImageCollection.Count > 0)
                    {
                        // Display image area if posts
                        DisplayRelatedImagePost();
                    }
                    else
                    {
                        // Hide post area if no posts
                        pnlImagesPost.Visible = false;
                    }


                    if (_image[0].City != null)
                    {
                        ucxFlickrImages.SearchFor = _image[0].CityName + " Vacation";
                    }
                    else
                    {
                        pnlFlickr.Visible = false;
                    }
                }
            }
        }
        else
        {
            Response.Redirect("./Error.aspx");
        }
    }