Exemplo n.º 1
0
        bool SendToAnelto(TESTMODE mode, string unitId)
        {
            var model = new AneltoSubscriberOverrideRequest();

            model.accounts = unitId;

            switch (mode)
            {
            case TESTMODE.ON:
                model.number = AppConfigurationHelper.AneltoTestNumber;
                break;

            case TESTMODE.OFF:
                model.number = AppConfigurationHelper.AneltoProdNumber;
                break;
            }

            try
            {
                AneltoAPI api      = new AneltoAPI();
                var       response = api.SubscriberCCOverride(model);

                return(true);
            }
            catch (Exception ex)
            {
                return(false);
            }
        }
Exemplo n.º 2
0
        bool SendToAnelto(TESTMODE mode, string unitId)
        {
            var model = new AneltoSubscriberOverrideRequest();

            model.accounts = unitId;

            switch (mode)
            {
            case TESTMODE.ON:
                model.number = AppConfigurationHelper.AneltoTestNumber;
                break;

            case TESTMODE.OFF:
                model.number = AppConfigurationHelper.AneltoProdNumber;
                break;
            }

            try
            {
                AneltoAPI api      = new AneltoAPI();
                var       response = api.SubscriberCCOverride(model);
                LogMessage(string.Format("Sent to Anelto CCOverride with response {0} for unit {1}. Data: {2}", response, unitId, model.ToJson()));

                return(true);
            }
            catch (Exception ex)
            {
                LogMessage(string.Format("Failed to send to Anelto API CCOverride for unit {0}. DATA: {1}. ERROR: {2}", unitId, model.ToJson(), ex.Message));
                return(false);
            }
        }