Esempio n. 1
0
        public AvailabilityViewModel PrepareModifyModel(int vehicleId, bool isEditMode = false)
        {
            var model = new AvailabilityViewModel
            {
                DateFrom = DateTime.Now,
                DateTo   = DateTime.Now.AddDays(1)
            };

            model.VehicleId = vehicleId;
            var locations = _locationBusiness.GetAll();

            model.Locations  = Mapper.Map <List <LocationModel>, List <LocationViewModel> >(locations);
            model.IsEditMode = isEditMode;

            return(model);
        }
        // GET: AdminPanel/City
        public ActionResult Index()
        {
            var dbModel = _locationBusiness.GetAll();
            var model   = Mapper.Map <List <LocationModel>, List <LocationViewModel> >(dbModel);

            return(View(model));
        }