예제 #1
0
        public JsonResult GetListIContact()
        {
            IContactRequest request = (IContactRequest)Session["IContactRequest"];

            IContactService <ICampaign, IContactGetListsResponse> IContactProvider = new IContactService <ICampaign, IContactGetListsResponse>();
            IResponse response            = IContactProvider.GetLists(request);
            IContactGetListsResponse data = (IContactGetListsResponse)response;
            SelectList lista = new SelectList(data.lists, "listId", "name");

            return(Json(lista));
        }
예제 #2
0
        public IResponse GetLists(IContactRequest requestFrm)
        {
            config.mailingProvider = requestFrm;
            IResponse response = new IContactGetListsResponse();

            try
            {
                HttpWebRequest request = GetRequest(Common.Utils.IContactRequest.GetLists, config, requestFrm);
                response = GetResponse(request);
            }
            catch (Exception e)
            {
                var messageException = telemetria.MakeMessageException(e, System.Reflection.MethodBase.GetCurrentMethod().Name);
                telemetria.Critical(messageException);
            }
            return(response);
        }
예제 #3
0
        public IValidateProvider ValidateApiToken(IContactRequest requestFrm)
        {
            IValidateProvider validateProvider = new ValidateProvider(EnumMailProviders.IContact);

            bool resultado = false;

            try
            {
                config.mailingProvider = requestFrm;
                IResponse      response = new IContactGetListsResponse();
                HttpWebRequest request  = GetRequest(KindAds.Common.Utils.IContactRequest.GetLists, config, requestFrm);
                response  = GetResponse(request);
                resultado = response.StatusCode == 0 ? true : false;
                validateProvider.Validate(response.StatusCode == 0 ? true : false, response.StatusCode);
            }
            catch (Exception e)
            {
                var messageException = telemetria.MakeMessageException(e, System.Reflection.MethodBase.GetCurrentMethod().Name);
                telemetria.Critical(messageException);
            }

            return(validateProvider);
        }