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)); }
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); }
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); }