Esempio n. 1
0
    /// <summary>
    /// Event handler for Page_Load event
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void Page_Load(object sender, EventArgs e)
    {
        DisplayForm();
        pnlImage.Visible = false;
        pnlPost.Visible  = false;
        lbImages.Text    = "";
        lbPosts.Text     = "";


        if (!IsPostBack)
        {
            loadCityLists();
            loadCountryList();

            if (QueryStringVerifier.IsValidISOAndIsNotNull(Request.QueryString["Cont"]))
            {
                _TICollection.FetchForContinent(Request.QueryString["Cont"], radImageAscend.Checked);
                gvImage.DataSource = _TICollection;
                gvImage.DataBind();
                pnlImage.Visible = true;
            }
            else if (QueryStringVerifier.IsNotNull(Request.QueryString["search"]))
            {
                txtSearch.Text = Request.QueryString["search"];
                FetchSearchResults();
            }
        }
        else if (txtSearch.Text != "" || ((radCity.Checked || radCountry.Checked) && radByImage.Checked))
        {
            FetchSearchResults();
        }
    }
Esempio n. 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.IsValidISOAndIsNotNull(Request.QueryString["Id"]))
            {
                string iso = Request.QueryString["Id"];
                LoadCountry(iso);

                if (_geoCountry.Count > 0)
                {
                    DisplayCountry();

                    if (_geoCountry[0].ImageCollection.Count > 0)
                    {
                        // Display images area if images
                        DisplayRelatedImage();
                    }
                    else
                    {
                        // Hide images area if no images
                        pnlImages.Visible = false;
                    }
                }
            }
            else
            {
                Response.Redirect("Error.aspx");
            }
        }
    }
Esempio n. 3
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");
            }
        }
    }
Esempio n. 4
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");
            }
        }
    }
Esempio n. 5
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)
    {
        string queryString = Request.QueryString["type"];

        if (!IsPostBack)
        {
            if (QueryStringVerifier.IsNotNull(queryString))
            {
                if (queryString == "images")
                {
                    rbNormal.Checked          = true;
                    pnlBrowseCriteria.Visible = true;
                    _collectionImages         = new TravelImageCollection();
                    _collectionImages.FetchAllSorted(true);
                    gvImage.DataSource = _collectionImages;
                    gvImage.DataBind();
                }
                else if (queryString == "posts")
                {
                    _collectionPosts = new TravelPostCollection();
                    _collectionPosts.FetchAllSorted(true);
                    ucTravelPostGrid.CollectionPost = _collectionPosts;
                }
                else
                {
                    if (queryString == "users")
                    {
                        _collectionUsers = new TravelUserCollection();
                        _collectionUsers.FetchAllSorted(true);
                        ucTravelUserGrid.CollectionUser = _collectionUsers;
                    }
                }
                lbHeading.Text = queryString.Substring(0, 1).ToUpper() + queryString.Substring(1);
            }
        }
    }
Esempio n. 6
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");
        }
    }