Example #1
0
        public BookingUpdateResponse Update(string bookingData, ICrmService crmService)
        {
            if (string.IsNullOrWhiteSpace(bookingData))
            {
                throw new ArgumentNullException(Constants.Parameters.BookingData);
            }
            if (crmService == null)
            {
                throw new ArgumentNullException(Constants.Parameters.CrmService);
            }

            var response = crmService.ExecuteActionForBookingUpdate(bookingData);

            if (response == null)
            {
                throw new InvalidOperationException(Constants.Messages.ResponseNull);
            }
            return(new BookingUpdateResponse {
                Created = response.Created, Id = response.Id.ToString()
            });
        }