private static void TestBlack() { var proxy = new sms_webservice(); var retValue = proxy.is_number_in_blacklist("09121991334"); Console.WriteLine(retValue); }
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); }
private static void Credit() { var proxy = new sms_webservice(); var retValue = proxy.sms_credit("iranapplecenter", "09121116695"); Console.WriteLine(retValue); }
private static void TestRetValue() { var proxy = new sms_webservice(); var retValue = proxy.sms_deliver("133090073"); Console.WriteLine(retValue); //"5" BlackList //"0" OK! }
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 }
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); }
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); }
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); }
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)); }