Ejemplo n.º 1
0
 public SelectTrip()
 {
     InitializeComponent();
     _trips      = new ObservableCollection <Trip>();
     DataContext = this;
     _customer   = new DLCustomer();
 }
Ejemplo n.º 2
0
        private void OccupiedPlaces()
        {
            DLCustomer    dLCustomer = new DLCustomer();
            List <int>    places     = dLCustomer.GetOccupiedPlaces(CurrentTrip.Id);
            List <string> places_s   = new List <string>();

            foreach (var pl in places)
            {
                string temp = pl.ToString();
                places_s.Add(temp);
            }
            foreach (var chbx in busCanvas.Children)
            {
                if (chbx is CheckBox)
                {
                    CheckBox checkBox = chbx as CheckBox;
                    foreach (var plc in places_s)
                    {
                        if (checkBox.Name == "place" + plc)
                        {
                            checkBox.IsEnabled = false;
                        }
                    }
                }
            }
        }
Ejemplo n.º 3
0
        public OrderWindow(Trip trip, List <int> places)
        {
            Trip   = trip;
            Places = places;

            City    = Trip.Direction.City;
            Dep     = Trip.Departure.ToString();
            NPlaces = places.Count.ToString();
            Price   = Trip.Direction.Price * Int32.Parse(NPlaces);

            DataContext = this;

            _dlCustomer = new DLCustomer();

            InitializeComponent();
        }
Ejemplo n.º 4
0
        private void replaceRadiobuttonOnForm()
        {
            DLCustomer       dlc       = new DLCustomer();
            List <Direction> direction = dlc.GetDirections();

            foreach (var rb in mainCanvas.Children)
            {
                if (rb is RadioButton)
                {
                    RadioButton rdbt = rb as RadioButton;
                    foreach (Direction drct in direction)
                    {
                        if (rdbt.Name == drct.City)
                        {
                            Thickness thickness = rdbt.Margin;
                            thickness.Left = dlc.ToCoordinates(drct.Coordinates)[0];
                            thickness.Top  = dlc.ToCoordinates(drct.Coordinates)[1];
                            rdbt.Margin    = thickness;
                            rdbt.IsEnabled = drct.IsActive;
                        }
                    }
                }
            }
        }