Esempio n. 1
0
        protected override void Send(string reference, string action, IDictionary <string, string> data)
        {
            if (FailToSend)
            {
                var d = new ProcessedData
                {
                    Reference = reference,
                    Action    = action,
                    Data      = JsonConvert.SerializeObject(data)
                };
                _dataRepository.AddData(d);
                _dataRepository.Save();
                throw new SendErrorException();
            }



            //Dev-code
            switch (action)
            {
            case "BookingCompleted":
                SentToApisci["BookingComplete"] += 1;
                break;

            case "OutboundSegmentBooked":
                SentToApisci["OutboundSegmentBooked"] += 1;
                break;

            case "InboundSegmentBooked":
                SentToApisci["InboundSegmentBooked"] += 1;
                break;

            case "BookingModified":
                SentToApisci["BookingModified"] += 1;
                break;

            case "OutboundSegmentModified":
                SentToApisci["OutboundSegmentModified"] += 1;
                break;

            case "InboundSegmentModified":
                SentToApisci["InboundSegmentModified"] += 1;
                break;

            case "BookingCanceled":
                SentToApisci["BookingCanceled"] += 1;
                break;

            default:
                SentToApisci["ActionUnknown"] += 1;
                break;
            }
        }
Esempio n. 2
0
 public void AddProcessedData(ProcessedData data)
 {
     _dataRepository.AddData(data);
 }