예제 #1
0
        private static void TestBlack()
        {
            var proxy    = new sms_webservice();
            var retValue = proxy.is_number_in_blacklist("09121991334");

            Console.WriteLine(retValue);
        }
예제 #2
0
        private static void TestSendFlash()
        {
            var proxy    = new sms_webservice();
            var retValue = proxy.send_sms("iranapplecenter", "09121116695", "10002130663210", "09122800039", "با تشکر از خرید شما", "True", null, 0, null);

            Console.WriteLine(retValue);
        }
예제 #3
0
        private static void Credit()
        {
            var proxy    = new sms_webservice();
            var retValue = proxy.sms_credit("iranapplecenter", "09121116695");

            Console.WriteLine(retValue);
        }
예제 #4
0
        private static void TestRetValue()
        {
            var proxy    = new sms_webservice();
            var retValue = proxy.sms_deliver("133090073");

            Console.WriteLine(retValue);
            //"5" BlackList
            //"0" OK!
        }
예제 #5
0
        private static void TestSend()
        {
            var proxy    = new sms_webservice();
            var retValue = proxy.send_sms("iranapplecenter", "09121116695", "10002130663210", "09122800039", "با تشکر از خرید شما", null, null, 0, null);

            //"error [ wrong username OR password ] [ error_login_not_like_password ]"
            Console.WriteLine(retValue);
            //133090072
            //133090073
        }
예제 #6
0
 public double GetCurrentCredit()
 {
     try
     {
         using (var proxy = new sms_webservice())
         {
             return(proxy.sms_credit(_username, _password));
         }
     }
     catch (Exception ex)
     {
         LogInternalException?.Invoke("GetCurrentCredit", ex);
     }
     return(0);
 }
예제 #7
0
 public bool IsNumberBlackList(string number)
 {
     try
     {
         LogStringValue?.Invoke("شماره جهت بررسی وضعیت لیست سیاه", number);
         using (var proxy = new sms_webservice())
         {
             return(proxy.is_number_in_blacklist(number) == 1);
         }
     }
     catch (Exception ex)
     {
         LogInternalException?.Invoke("IsNumberBlackList", ex);
     }
     return(false);
 }
예제 #8
0
        public RetrievalStatus GetRetrievalStatus(string id)
        {
            try
            {
                LogStringValue?.Invoke("شناسه جهت پیگیری وضعیت ارسال", id);

                using (var proxy = new sms_webservice())
                {
                    return(HandleRetrievalStatusMessage(proxy.sms_deliver(id)));
                }
            }
            catch (Exception ex)
            {
                LogInternalException?.Invoke("GetRetrievalStatus", ex);
            }
            return(RetrievalStatus.Unknown);
        }
예제 #9
0
 public SendReturnObject SendFlashSms(string txt, string receiver)
 {
     try
     {
         LogStringValue?.Invoke("متن پیام", txt);
         LogStringValue?.Invoke("گیرنده", receiver);
         using (var proxy = new sms_webservice())
         {
             var retObject = proxy.send_sms(_username, _password, _sender, receiver, txt, "True", null, 0, null);
             var status    = HandleSendErrorMessage(retObject);
             int id        = 0;
             if (status == SentStatus.Successful)
             {
                 id = Convert.ToInt32(status);
             }
             return(new SendReturnObject(retObject, status, id));
         }
     }
     catch (Exception ex)
     {
         LogInternalException?.Invoke("SendSms", ex);
     }
     return(new SendReturnObject(string.Empty, SentStatus.Failed, -1));
 }