Пример #1
0
 public ConfigurationOverviewPageViewModel(CarConfiguratorEntityContext context)
     : base(context, onlySelectedAccessories: true, onlySelectedEngineSettings: true, onlySelectedPaints: true, onlySelectedRims: true)
 {
     Configuration = new ConfigurationViewModel
     {
         Accessories    = Accessories,
         EngineSettings = EngineSettings.FirstOrDefault(),
         Paint          = Paints.FirstOrDefault(),
         Rims           = Rims.FirstOrDefault()
     };
     Configuration.InitPrice();
 }
Пример #2
0
        public OrderOverviewPageViewModel(Order model, bool orderSuccess = false)
            : base(model.Id, model.BasePrice + model.ExtrasPrice)
        {
            var carModel = model.Configuration.EngineSetting.CarModel;

            Model = $"{carModel.SeriesCategory.Name} {carModel.BodyCategory.Name} {carModel.Year}";

            BasePrice     = model.BasePrice;
            ExtrasPrice   = model.ExtrasPrice;
            Description   = model.Description;
            DateTime      = model.DateTime;
            OrderSuccess  = orderSuccess;
            Configuration = new ConfigurationViewModel(model.Configuration);
        }