Exemplo n.º 1
0
 protected override void OnNavigatedTo(NavigationEventArgs e)
 {
     activeQuoteViewModel = e.Parameter as ActiveQuoteViewModel;
     vc = new VehicleController(activeQuoteViewModel.Drivers, activeQuoteViewModel.q.Id,
         activeQuoteViewModel.Drivers.First().ID);
     this.DataContext = vc.VehicleViewModel;
     vehicleViewModel = vc.VehicleViewModel;
     activeQuoteViewModel.Vehicles.Add(vehicleViewModel);
 }
Exemplo n.º 2
0
 public VehicleController(ObservableCollection<DriverViewModel> observableCollection, long quoteId, long pDriverId)
 {
     this.observableCollection = observableCollection;
     VehicleViewModel = new VehicleViewModel(observableCollection);
     VehicleViewModel.Id = Helper.Post(new Vehicle(quoteId, pDriverId)).Id;
 }
Exemplo n.º 3
0
 public VehicleController()
 {
     VehicleViewModel = new VehicleViewModel();
 }
Exemplo n.º 4
0
        public static VehicleViewModel convertVehicletoVehicleViewModel(Vehicle v)
        {
            VehicleViewModel vvm = new VehicleViewModel();
            vvm.AnnualMiles = (int)v.AnnualMiles;
            vvm.CurrentValue = v.CurrentValue;
            vvm.DaysDrivenPerWeek = v.DaysDrivenPerWeek;
            vvm.HasAntilockBrakingSystem = v.HasAntilockBrakingSystem;
            vvm.HasDaylightRunningLights = v.HasDaytimeRunningLights;
            vvm.Id = v.Id;
            vvm.Make = v.Make;
            vvm.Mileage = (int)v.Mileage;
            vvm.MilesDrivenToWork = (int)v.MilesDrivenToWork;
            vvm.CarModel = v.CarModel;
            vvm.DriverId = v.DriverId;
            vvm.ReducedUse = v.ReduceUse;
            vvm.Vin = v.Vin;
            vvm.Year = v.Year;
            vvm.HasAntiTheftSystem = v.AntiTheft;
            vvm.HasPassiveRestraints = v.PassiveRestraints;
            vvm.ParkedInSeparateGarage = v.GarageDifferent;

            return vvm ;
        }