Exemplo n.º 1
0
    protected void Button2_Click(object sender, EventArgs e)
    {
        SightSeeingSearchCondition SearchCondition = new SightSeeingSearchCondition();

        SearchCondition.Adults = 1;
        SearchCondition.CategoryCode = "";

        List<int> ages = new List<int>();
        ages.Add(2);
        ages.Add(3);
        SearchCondition.ChildrenAges = ages.ToArray();

        SearchCondition.DestinationCode = "LON";
        SearchCondition.DestinationType = "city";
        SearchCondition.TourDate = DateTime.Now.AddMonths(1);
        List<string> TypeCodes = new List<string>();
        TypeCodes.Add("AR");
        TypeCodes.Add("CR");

        SearchCondition.TypeCodes = TypeCodes.ToArray();

        SightSeeingProductSearcher Searcher = new SightSeeingProductSearcher();
        IList<SightSeeingProduct> Products = Searcher.Search(SearchCondition);

        if (Products != null)
        {

        }
    }
Exemplo n.º 2
0
    public SightSeeingMaterial SearchInsurance(Terms.Sales.Business.SightSeeingSearchCondition sightSeeingSearchCondition)
    {
        TERMS.Common.Search.SightSeeingSearchCondition searchCondition = new TERMS.Common.Search.SightSeeingSearchCondition();

        searchCondition.Adults = sightSeeingSearchCondition.Adults;

        searchCondition.ChildrenAges = sightSeeingSearchCondition.ChildrenAges.ToArray();

        searchCondition.DestinationCode = sightSeeingSearchCondition.City;
        searchCondition.DestinationType = sightSeeingSearchCondition.SearchType;
        searchCondition.TourDate = sightSeeingSearchCondition.ServiceDate;

        searchCondition.TypeCodes = sightSeeingSearchCondition.Types.ToArray();

        SightSeeingProductSearcher searcher = new SightSeeingProductSearcher();

        IList<SightSeeingProduct> Products = searcher.Search(searchCondition);

        if (Products != null)
        {
            return ((TERMS.Business.Centers.ProductCenter.Components.SightSeeingMaterial)((TERMS.Core.Product.ComponentGroup)Products[0].Items[0]).Items[0]);
        }
        else
        {
            return null;
        }
    }
Exemplo n.º 3
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        SightSeeingSearchCondition SearchCondition = new SightSeeingSearchCondition();

        SearchCondition.Adults = Convert.ToInt32(dllAdults.SelectedValue);
        SearchCondition.CategoryCode = dllSightSeeisngCategorys.SelectedValue;

        int iChildren = Convert.ToInt32(dllChildren.SelectedValue);

        List<int> ages = new List<int>();

        for (int i = 0; i < iChildren; i++)
        {
            ages.Add(2);
        }
        SearchCondition.ChildrenAges = ages.ToArray();

        if (dllCity.SelectedValue == "YXU")
        {
            SearchCondition.DestinationCode = "LON";
        }
        else
        {
            SearchCondition.DestinationCode = dllCity.SelectedValue;
        }
        SearchCondition.DestinationType = "city";
        SearchCondition.TourDate = Convert.ToDateTime(TermsCalendar1.CDate);
        List<string> TypeCodes = new List<string>();

        for (int i = 0; i < chSightSeeingType.Items.Count; i++)
        {
            if (chSightSeeingType.Items[i].Selected)
            {
                TypeCodes.Add(chSightSeeingType.Items[i].Value);
            }
        }

        SearchCondition.TypeCodes = TypeCodes.ToArray();

        SearchCondition.Currency = "USD";
        SearchCondition.Country = dllCountry.SelectedValue;

        SightSeeingProductSearcher Searcher = new SightSeeingProductSearcher();
        IList<SightSeeingProduct> Products = Searcher.Search(SearchCondition);

        if (Products != null && Products.Count > 0 && ((TERMS.Core.Product.ComponentGroup)Products[0]).Items.Count > 0)
        {
            List<Terms.Contract.Business_0407.GTASightSeeingMaterial> SightSeeingMaterials = new List<Terms.Contract.Business_0407.GTASightSeeingMaterial>();

            List<Terms.Contract.Business_0407.GTA.SightSeeing> lists = new List<Terms.Contract.Business_0407.GTA.SightSeeing>();

            for (int i = 0; i < ((TERMS.Core.Product.ComponentGroup)Products[0]).Items.Count; i++)
            {
                SightSeeingMaterials.Add(((Terms.Contract.Business_0407.GTASightSeeingMaterial)((TERMS.Core.Product.ComponentGroup)((TERMS.Core.Product.ComponentGroup)Products[0]).Items[i]).Items[0]));

                lists.Add(SightSeeingMaterials[i].SightSeeing);
            }

            if (lists.Count > 0)
            {
                dlSightSeeings.Visible = true;
                BindSightSeeing(lists);
            }
            else
            {
                dlSightSeeings.Visible = false;
            }
        }
        else
        {
            dlSightSeeings.Visible = false;
        }
    }