Beispiel #1
0
        private void ChooseTransport_Button_Click(object sender, RoutedEventArgs e)
        {
            string idTransport = ((Button)sender).Tag.ToString();

            transportChosen = TransportDAO.GetById(idTransport);

            this.DataContext = new { type = typeChosen, transport = transportChosen };
        }
Beispiel #2
0
        private void DisplayDetail()
        {
            trip = TripDAO.GetById(idTrip);

            ImageTrip imageToShow;

            if (trip.Images.Count == 0)
            {
                imageToShow = new ImageTrip()
                {
                    NameImage = "default_no_image.gif"
                };
                index_max = 0;
            }
            else
            {
                imageToShow = trip.Images[index_showImage];
                index_max   = trip.Images.Count - 1;
            }

            totalTextBlock.Text = trip.Members.Count + " t.viên";
            totalExpense        = trip.Expenses.Sum(item => int.Parse(item.Cost));
            totalDonation       = trip.Members.Sum(item => int.Parse(item.Donation));

            CultureInfo provider = CultureInfo.InvariantCulture;

            this.DataContext = new
            {
                Trip = new
                {
                    Name             = trip.Name,
                    StartDate        = trip.StartDate,
                    EndDate          = trip.EndDate,
                    MainImage        = trip.MainImage,
                    Transport        = TransportDAO.GetById(trip.Transport),
                    Status           = trip.Status == "finish" ? "False" : "True",
                    NameButtonStatus = trip.Status == "finish" ? "Đã kết thúc" : "Kết thúc",
                    TotalDate        = "not dev"
                },
                PointLabel,
                SeriesCollection,
                ImageToShow = imageToShow,
            };

            membersListView.ItemsSource   = trip.Members;
            expensesListView.ItemsSource  = trip.Expenses;
            donationsListView.ItemsSource = trip.Members;
            placesListView.ItemsSource    = trip.Places;
        }