Beispiel #1
0
        public async Task <IActionResult> Create()
        {
            var towns = await this.townsService.GetAllAsync <TownsServiceDropDownModel>();

            var viewModel = new ParkingInputModel()
            {
                Towns = towns.Select(t => t.To <TownsDropDownViewModel>()).ToList(),
            };

            return(this.View(viewModel));
        }
Beispiel #2
0
        public async Task <IActionResult> Create(ParkingInputModel parkingInputModel)
        {
            if (!this.ModelState.IsValid)
            {
                return(this.View(parkingInputModel));
            }

            var parkingServiceModel = parkingInputModel.To <ParkingServiceInputModel>();

            await this.parkingsService.CreateAsync(parkingServiceModel);

            return(this.Redirect("/Administration/Parkings/All"));
        }
        public void AddInputDetails(string PlatNumber, bool IsEntrance, string TimeStamp, string AgentMACID)
        {
            var value = new ParkingInputModel {
                SessionId          = 143,
                PlatNumberImageUrl = "/poll/data/date0/img2.png",
                IsEntrance         = IsEntrance,
                PlatNumber         = PlatNumber,
                TimeStamp          = TimeStamp,
                AgentMACID         = AgentMACID
            };

            _inputdata.Add(value);
        }