Ejemplo n.º 1
0
        public object Update(ParkingLotViewModel model)
        {
            model = _parkingLotService.Update(model);

            if (model == null)
            {
                return(new ResponseDetails(false, $"Parking lot with Id : { model.Id } not found."));
            }

            return(new ResponseDetails(true, model));
        }
        public ActionResult EditParkingLot(ParkingLotViewModel model)
        {
            ParkingLot parkingLotEntity = parkingLotService.Get(model.Id);

            parkingLotEntity.Address      = model.Address;
            parkingLotEntity.CompanyName  = model.CompanyName;
            parkingLotEntity.ZipCode      = model.ZipCode;
            parkingLotEntity.ModifiedDate = DateTime.UtcNow;
            parkingLotService.Update(parkingLotEntity);

            if (parkingLotEntity.Id > 0)
            {
                return(RedirectToAction("index"));
            }
            return(View(model));
        }