Beispiel #1
0
 public AnalyticStatisticsItemViewModel(AnalyticStatisticsItem model)
 {
     if (model == null)
     {
         throw new ArgumentNullException("model");
     }
     this.model = model;
     familyType =
         new EngineFamilyTypeViewModel(model.TargetEngineFamilyType);
     engineType =
         new EngineTypeViewModel(model.TargetEngineType);
     itemType = new AnalyticStatisticsItemTypeViewModel(model.Type);
     foreach (AnalyticStatisticsValue val in model.Values)
     {
         if (values.Any(v => v.Vin == val.SourceVin))
         {
             values.First(v => v.Vin == val.SourceVin).
             AddId(val.SourcePsaParametersSetId);
         }
         else
         {
             values.Add(new AnalyticStatisticsSourceVinViewModel(
                            val.SourceVin, val.SourcePsaParametersSetId));
         }
     }
 }
 private void EngineModelSelectionChanged(
     object sender, SelectionChangedEventArgs e)
 {
     if (e.AddedItems.Count == 0)
     {
         return;
     }
     selectedEngine = e.AddedItems[0] as EngineTypeViewModel;
     YieldCriteriaHasChanged();
 }
 private void EngineFamilyTypeSelectionChanged(
     object sender, SelectionChangedEventArgs e)
 {
     engines.Clear();
     selectedEngine = null;
     if (e.AddedItems[0] is ViewModelStubAny)
     {
         selectedFamilyType = null;
         YieldCriteriaHasChanged();
         return;
     }
     engines.Add(new ViewModelStubAny());
     selectedFamilyType = e.AddedItems[0] as EngineFamilyTypeViewModel;
     foreach (EngineType engineType in EngineToFamilyMapping.
              GetFamilyMembers(selectedFamilyType.Model))
     {
         engines.Add(new EngineTypeViewModel(engineType));
     }
     YieldCriteriaHasChanged();
 }
Beispiel #4
0
 public PartialViewResult EngineType(EngineTypeViewModel model)
 {
     //Update logic
     return(PartialView("EngineType", model));
 }