Exemple #1
0
        public View_AllFuels(Frame _mainFrame, GasolineService gasolineService)
        {
            _gasolineService = gasolineService;
            mainFrame        = _mainFrame;
            InitializeComponent();


            fuelTypes = _gasolineService.GetAllFuelTypes();

            for (int i = 0; i < fuelTypes.Count; i++)
            {
                Button btn = new Button()
                {
                    Name = "B" + i, Content = fuelTypes[i].FuelName
                };
                btn.Click += Btn_Click;

                AllFuels.Children.Add(btn);
            }
        }
        public View_ViewGasStation(Frame mainFrame, GasStation gasStation, GasolineService gasolineService)
        {
            _gasolineService = gasolineService;
            ge        = new GasolineEntities1();
            MainFrame = mainFrame;
            InitializeComponent();

            ge = new GasolineEntities1();
            gs = gasStation;

            station_name.Content       = gs.Name;
            station_postalcode.Content = gs.PostalCode;
            station_street.Content     = gs.Street;
            station_city.Content       = gs.City;


            fuelTypes       = _gasolineService.GetAllFuelTypes();
            gasStationFuels = ge.GasStationFuels.Where(x => x.GasStationId == gs.Id).ToList();

            UpdateFuels();
        }