Exemplo n.º 1
0
        public void UpdateTripsList()
        {
            TripsList.Children.Clear();

            using (TripContext db = new TripContext())
            {
                var Trips = db.Trips.OrderByDescending(t => t.Id);

                foreach (Trip t in Trips)
                {
                    tripRow tr = new tripRow(t.Id, t.FromWhere, t.Destination, t.Name, t.Date, t.State);
                    TripsList.Children.Add(tr);
                }
            }
        }
Exemplo n.º 2
0
        public void UpdateTripsList()
        {
            TripsList.Children.Clear();

            using (TripContext db = new TripContext())
            {
                var Trips = db.Trips.Where(t => t.State == "В пути").OrderByDescending(t => t.Id);

                foreach (Trip t in Trips)
                {
                    tripRow tr = new tripRow(t.Id, t.FromWhere, t.Destination, t.Name, t.Date, t.State, this);
                    tr.CompleteButtons.Visibility = Visibility.Visible;
                    tr.InfoBt.Visibility          = Visibility.Hidden;
                    TripsList.Children.Add(tr);
                }
            }
        }