Esempio n. 1
0
        protected virtual bool ValidateSmsRequest(SmsRequest smsRequest, out string validationMessage)
        {
            validationMessage = string.Empty;

            if (smsRequest == null)
            {
                validationMessage = string.Format("Sms Request Boş Olamaz | Provider Name {0} \n", ProviderName);
                return false;
            }
            if (string.IsNullOrWhiteSpace(smsRequest.Content))
            {
                validationMessage = string.Format("Content Boş Olamaz | Provider Name : {0} ", ProviderName);
                return false;
            }
            if (string.IsNullOrWhiteSpace(smsRequest.Number))
            {

                validationMessage = string.Format("Number Boş Olamaz | Provider Name : {0} ", ProviderName);
                return false;
            }
            if (smsRequest.Content.Length < 3)
            {
                validationMessage = string.Format("Content 3 karakterden az olamaz | Provider Name : {0} ", ProviderName);
                return false;
            }
            if (smsRequest.Content.Length > 160)
            {

                validationMessage = string.Format("Content 160 karakterden fazla olamaz | Provider Name : {0} ", ProviderName);
                return false;
            }
            if (!Regex.IsMatch(smsRequest.Number, "905[0-9][1-9]{7}"))
            {
                validationMessage = string.Format("Telefon numarası geçerli değil..! | Provider Name : {0} ", ProviderName);
                return false;
            }

            return true;
        }
Esempio n. 2
0
 protected abstract SmsResponse SendSms(SmsRequest smsRequest);