Exemplo n.º 1
0
        private Boolean Send(string destinatiion, string message, string title, ConfigMsMFromContacto jsonConfig, out string errorMessage)
        {
            errorMessage = "Not operation contacto provaider";
            List <Tuple <String, String> > parameters = new List <Tuple <String, String> >
            {
                new Tuple <string, string>("usuario", jsonConfig.User),
                new Tuple <string, string>("clave", jsonConfig.Password),
                new Tuple <string, string>("numero", destinatiion),
                new Tuple <string, string>("mensaje", message),
                new Tuple <string, string>("nota", title)
            };

            ResponseServiceRequest rsponseService = ServiceRequestHttp.Get(jsonConfig.PthBase, jsonConfig.ResourceBase, parameters, null);

            if (rsponseService.HttpStatusCode.HasValue && rsponseService.HttpStatusCode == HttpStatusCode.OK)
            {
                errorMessage = rsponseService.StreamReaderResult;
                return(rsponseService.StreamReaderResult.Contains("DATO CARGADO EXITOSAMENTE"));
            }


            return(false);
        }
Exemplo n.º 2
0
        private async Task <Boolean> SendAsync(string destinatiion, string message, string title, ConfigMsMFromContacto jsonConfig)
        {
            List <Tuple <String, String> > parameters = new List <Tuple <String, String> >
            {
                new Tuple <string, string>("usuario", jsonConfig.User),
                new Tuple <string, string>("clave", jsonConfig.Password),
                new Tuple <string, string>("numero", destinatiion),
                new Tuple <string, string>("mensaje", message),
                new Tuple <string, string>("nota", title)
            };
            ResponseServiceRequest serviceRequest = await ServiceRequestHttp.GetAsync(jsonConfig.PthBase, jsonConfig.ResourceBase, parameters, null);

            if (serviceRequest != null && serviceRequest.HttpStatusCode.HasValue && serviceRequest.HttpStatusCode.Value == HttpStatusCode.OK)
            {
                return(true);
            }

            return(false);
        }