public ActionResult AddUpdateLocation(AddLocationRequest addLocationRequest)
        {
            string actionBy = User.Identity.Name;

            _mainResponse = _yearlyMaintenanceService.AddUpdateLocation(addLocationRequest, actionBy);
            _jsonString   = Mapper.Convert <BaseResponse>(_mainResponse);
            return(new OkObjectResult(_jsonString));
        }
        public override Task <AddLocationResponse> AddLocation(AddLocationRequest request, ServerCallContext context)
        {
            logger.LogInformation($"{request.Name} {request.Latitude} {request.Longitude} {request.Speed}");

            var response = new AddLocationResponse {
                IsConfirmed = true
            };

            return(Task.FromResult(response));
        }
Beispiel #3
0
        public AddLocationResponse AddLocation(AddLocationRequest request)
        {
            Location location = new Location();

            LocationAssembler assembler = new LocationAssembler();

            assembler.UpdateLocation(request.LocationDetail, location, PersistenceContext);

            PersistenceContext.Lock(location, DirtyState.New);

            // ensure the new location is assigned an OID before using it in the return value
            PersistenceContext.SynchState();

            return(new AddLocationResponse(assembler.CreateLocationSummary(location)));
        }
        public void AddLocation(AddLocationRequest request, Account account)
        {
            var customer = _customerManager.Get(request.CustomerIdentityTag);

            if (customer is null)
            {
                throw new AppException("customer not found");
            }

            _locationManager.Save(new CustomerLocation
            {
                Customer  = customer,
                Latitude  = request.Latitude,
                Longitude = request.Longitude
            });
        }
        public IActionResult AddLocation(AddLocationRequest request)
        {
            _locationService.AddLocation(request, Account);

            return(Created());
        }