Exemplo n.º 1
0
        private void loadRepeater()
        {
            Attraction actt = new Attraction();

            acttList = actt.ListAttractionAll();

            RepeaterAttraction.DataSource = acttList;
            RepeaterAttraction.DataBind();
        }
Exemplo n.º 2
0
        private void loadRepeater(string type, string interest)
        {
            Attraction actt = new Attraction();

            if (interest == "Popular")
            {
                if (type == "All")
                {
                    acttList = actt.ListAttractionAll();
                }
                else
                {
                    acttList = actt.ListAttraction(type);
                }
            }
            else if (interest == "Personalised")
            {
                if (type == "All")
                {
                    Interest i       = new Interest();
                    string   userInt = null;
                    try
                    {
                        userInt = i.checkInterests(int.Parse(Session["tourist_id"].ToString())).InterestName;
                    }
                    catch
                    {
                    }
                    if (userInt == null)
                    {
                        acttList = actt.ListAttractionAll();
                    }
                    else
                    {
                        acttList = actt.ListAttractionAll_Personal(userInt);
                    }
                }
                else
                {
                    Interest i       = new Interest();
                    string   userInt = null;
                    try
                    {
                        userInt = i.checkInterests(int.Parse(Session["tourist_id"].ToString())).InterestName;
                    }
                    catch
                    {
                    }
                    if (userInt == null)
                    {
                        acttList = actt.ListAttraction(type);
                    }
                    else
                    {
                        acttList = actt.ListAttraction_Personal(type, userInt);
                    }
                }
            }

            RepeaterAttraction.DataSource = acttList;
            RepeaterAttraction.DataBind();
        }