Пример #1
0
 private static void UpdateService(ExpectedService service, ApiResponse response)
 {
     if (response.Payload != null)
     {
         service.Id = ((ServiceData)response.Payload).id;
     }
 }
Пример #2
0
        private static string CreateNewServiceSaveCommand(ExpectedService expectedService)
        {
            var command = new ApiServiceSaveCommand
            {
                name         = expectedService.Name,
                description  = expectedService.Description,
                repetition   = expectedService.Repetition,
                presentation = expectedService.Presentation
            };

            if (expectedService.Timing != null)
            {
                command.timing = expectedService.Timing;
            }
            if (expectedService.Pricing != null)
            {
                command.pricing = expectedService.Pricing;
            }
            if (expectedService.Booking != null)
            {
                command.booking = expectedService.Booking;
            }

            return(JsonSerialiser.Serialise(command));
        }
Пример #3
0
        public static void RegisterService(ExpectedService service, ExpectedBusiness business)
        {
            var json     = CreateNewServiceSaveCommand(service);
            var response = PostService(business, json);

            if (response.StatusCode == HttpStatusCode.OK)
            {
                UpdateService(service, response);
            }
        }
 public ApiServiceSaveCommand(ExpectedService service)
 {
     id           = service.Id;
     name         = service.Name;
     description  = service.Description;
     timing       = service.Timing;
     booking      = service.Booking;
     presentation = service.Presentation;
     repetition   = service.Repetition;
     pricing      = service.Pricing;
 }