Beispiel #1
0
        public AddParkingResponse AddParking(AddParkingRequest addParkingRequest)
        {
            try
            {
                if (parkingRepository.CheckParkingExist(addParkingRequest))
                {
                    return(new AddParkingResponse
                    {
                        Status = Model.ResponseStatus.DuplicateObject,
                        EndUserMessage = "Duplicate Position"
                    });
                }
                else
                {
                    var parking  = Mapper.Map <Repository.ParkingPlace>(addParkingRequest);
                    var response = new Model.API.Customer.RegisterResponse();
                    parkingRepository.Add(parking);
                    parkingRepository.Save();

                    return(new AddParkingResponse
                    {
                        Status = Model.ResponseStatus.Success,
                        EndUserMessage = "Position Added Successful",
                    });
                }
            }
            catch (Exception ex)
            {
                Logger.Error(ex);
                return(new AddParkingResponse
                {
                    Status = Model.ResponseStatus.InternalError,
                    EndUserMessage = "An InternalError Happend"
                });
            }
        }