Esempio n. 1
0
        public IActionResult Create()
        {
            var model = new AddMotorBikeViewModel
            {
                Makers      = _combosHelper.GetComboMakers(),
                Types       = _combosHelper.GetComboTypes(),
                Cylinder    = 125,
                FrontTire   = 17,
                HeightTireF = 100,
                HeightTireR = 100,
                RearTire    = 17,
                WidthTireF  = 100,
                WidthTireR  = 100,
                Millimeters = true
            };

            return(View(model));
        }
Esempio n. 2
0
 public AddMotorBikeViewModel ToMotorBikeViewModel(MotorBikeEntity model)
 {
     return(new AddMotorBikeViewModel
     {
         Id = model.Id,
         Name = model.Name,
         Cylinder = model.Cylinder,
         WidthTireF = model.WidthTireF,
         HeightTireF = model.HeightTireF,
         FrontTire = model.FrontTire,
         WidthTireR = model.WidthTireR,
         HeightTireR = model.HeightTireR,
         RearTire = model.RearTire,
         Millimeters = model.Millimeters,
         MakerId = model.TypeMaker.BikeMaker.Id,
         Makers = _combosHelper.GetComboMakers(),
         TypeId = model.TypeMaker.BikeType.Id,
         Types = _combosHelper.GetComboTypes(),
         TypeMaker = model.TypeMaker
     });
 }