private async Task CreateTestData(Guid siteId,
                                          string locName,
                                          string locDesc,
                                          byte[] img,
                                          double latitude  = 0,
                                          double longitude = 0)
        {
            var command = BuildLocationCmd(siteId, locName, "Chanel IFC");

            var location = await _businessInformationService.ProvisionLocationAsync(command);

            await _businessInformationService.SetLocationAddress(location.SiteId, location.Id,
                                                                 locName, "",
                                                                 "Hongkong", "Hongkong", "", "China");

            await _businessInformationService.SetLocationGeolocation(location.SiteId, location.Id, latitude, longitude);

            await _businessInformationService.UpdateLocationImage(new UpdateLocationImageCommand
            {
                LocationId = location.Id,
                SiteId     = location.SiteId,
                Image      = img
            });

            await _businessInformationService.AddAdditionalLocationImage(location.SiteId, location.Id, img);
        }
예제 #2
0
        public ActionResult SetLocationAddress([FromBody] SetLocationAddressRequest request)
        {
            if (!ModelState.IsValid)
            {
                //NotifyModelStateErrors();
                return(Ok(false));
            }

            Guid   siteId         = request.SiteId;
            Guid   locationId     = request.Id;
            string streetAddress  = request.StreetAddress;
            string streetAddress2 = request.StreetAddress2;
            string city           = request.City;
            string stateProvince  = request.StateProvince;
            string postalCode     = request.PostalCode;
            string countryCode    = request.CountryCode;

            _businessInformationService.SetLocationAddress(siteId, locationId,
                                                           streetAddress, streetAddress2,
                                                           city, stateProvince, postalCode, countryCode);
            return(Ok());
        }