Exemplo n.º 1
0
        public JourneyDetail(Journey j, ContentPage homePage)
        {
            BindingContext     = this;
            this.j             = j;
            AddressDep         = "Adresse de départ : " + j.AdressDep;
            AddressArr         = "Adresse d'arrivée : " + j.AdresseArr;
            Km                 = "Détour toléré (km) : " + j.Km.ToString();
            Nbplaces           = "Nombre de places restantes : " + j.NbPlaces.ToString();
            VilleDep           = "Ville de départ : " + j.VilleDep;
            VilleArr           = "Ville d'arrivée : " + j.VilleArr;
            Comm               = "Commentaire : \n" + j.Comm;
            this.TimeDeparture = DateTime.ParseExact(j.Hdep, "yyyy-MM-dd HH:mm:ss", CultureInfo.InvariantCulture);
            Hdep               = "Heure de départ : " + TimeDeparture.ToString();
            this.TimeArrival   = DateTime.ParseExact(j.Harr, "yyyy-MM-dd HH:mm:ss", CultureInfo.InvariantCulture);
            Harr               = "Heure d'arrivée : " + TimeArrival.ToString();
            Numtel             = "Numéro de téléphone du conducteur " + DatabaseInteraction.getPhoneNumber(j.Eid);
            //The components are initialized here to make sure that the data are already in there attributes before the components such as the labels load.
            InitializeComponent();
            //From here we are setting a component's attribute so the component have to be initialized
            if (j.Pets)
            {
                dog.BackgroundColor = Color.Green;
            }
            if (j.Smoke)
            {
                smoke.BackgroundColor = Color.Green;
            }
            if (j.Music)
            {
                music.BackgroundColor = Color.Green;
            }
            if (j.Talk)
            {
                talk.BackgroundColor = Color.Green;
            }



            this.HomePage = homePage;
        }
        //see journey details page
        public JourneyReservation(Journey j, JourneySearchPage searchPage)
        {
            BindingContext = this;

            this.j             = j;
            AddressDep         = "Adresse de départ : " + j.AdressDep;
            AddressArr         = "Adresse d'arrivée : " + j.AdresseArr;
            Km                 = "Détour toloéré (km) : " + j.Km.ToString();
            Nbplaces           = "Nombre de places restantes : " + j.NbPlaces.ToString();
            VilleDep           = "Ville de départ : " + j.VilleDep;
            VilleArr           = "Ville d'arrivée : " + j.VilleArr;
            Comm               = "Commentaire : \n" + j.Comm;
            this.TimeDeparture = DateTime.ParseExact(j.Hdep, "yyyy-MM-dd HH:mm:ss", CultureInfo.InvariantCulture);
            Hdep               = "Heure de départ : " + TimeDeparture.ToString();
            this.TimeArrival   = DateTime.ParseExact(j.Harr, "yyyy-MM-dd HH:mm:ss", CultureInfo.InvariantCulture);
            Harr               = "Heure d'arrivée : " + TimeArrival.ToString();
            InitializeComponent();
            if (j.Pets)
            {
                dog.BackgroundColor = Color.Green;
            }
            if (j.Smoke)
            {
                smoke.BackgroundColor = Color.Green;
            }
            if (j.Music)
            {
                music.BackgroundColor = Color.Green;
            }
            if (j.Talk)
            {
                talk.BackgroundColor = Color.Green;
            }



            this.searchPage = searchPage;
        }