Exemplo n.º 1
0
 public double GetCurrentCredit()
 {
     try
     {
         var binding = new BasicHttpBinding();
         var alma    = new AlmaSms.smsserverPortTypeClient(binding, new EndpointAddress("http://37.130.202.188/public/class/sms/webservice3/server.php?wsdl"));
         return(Convert.ToDouble(alma.GetCredit(_username, _password)));
     }
     catch (Exception ex)
     {
         LogInternalException?.Invoke("GetCurrentCredit", ex);
     }
     return(0);
 }
Exemplo n.º 2
0
 public SendReturnObject[] SendSmsList(string txt, string[] receivers)
 {
     try
     {
         LogStringValue?.Invoke("متن پیام", txt);
         var binding = new BasicHttpBinding();
         var alma    = new AlmaSms.smsserverPortTypeClient(binding, new EndpointAddress("http://37.130.202.188/public/class/sms/webservice3/server.php?wsdl"));
         var res     = alma.SendSMS(_sender, receivers, txt, "", _username, _password);
         LogStringValue?.Invoke("Result", res);
         return(new[] { new SendReturnObject(string.Empty, SentStatus.Successful, -1) });
     }
     catch (Exception ex)
     {
         LogInternalException?.Invoke("SendSms", ex);
     }
     return(new[] { new SendReturnObject(string.Empty, SentStatus.Failed, -1) });
 }