示例#1
0
 public ControllerBase(IChromiumSettings chromiumSettings, ISmsServices smsServices = null)
 {
     _chromiumSettings = chromiumSettings;
     _smsServices      = smsServices;
     AppPath           = _chromiumSettings.GetPath();
     ConnectionString  = Path.Combine(AppPath, ConfigurationManager.AppSettings["DbPath"]);
 }
示例#2
0
        public SmsServiceControl(ISmsServices smsServices)
        {
            InitializeComponent();
            _smsServices = smsServices;

            cmbCountry.DataSource    = CountryItem.GetCountryItems();
            cmbCountry.DisplayMember = "Text";
            cmbCountry.SelectedIndex = 0;

            var smsServiceItems = SmsServiceItem.GetSmsServiceItems();

            cmbSmsService.DataSource    = smsServiceItems;
            cmbSmsService.DisplayMember = "Text";
            cmbSmsService.SelectedIndex = 0;

            _requestsBindingSource.DataSource = _phoneNumberRequestItems;
            dgvRequests.DataSource            = _requestsBindingSource;

            btnExecute.Click += BtnExecute_Click;
            btnSave.Click    += BtnSave_Click;

            _bw.WorkerSupportsCancellation = false;
            _bw.WorkerReportsProgress      = true;
            _bw.DoWork          += bw_DoWork;
            _bw.ProgressChanged += bw_ProgressChanged;
            _bw.RunWorkerAsync();
        }
示例#3
0
 public HomeController(ILogger <HomeController> logger, IEmailServices emailServices, IMessengerServices messengerServices, ISchoolServices schoolServices, ISmsServices smsServices)
 {
     _logger           = logger;
     _emailService     = emailServices;
     _messengerService = messengerServices;
     _schoolService    = schoolServices;
     _smsService       = smsServices;
 }
 public SmsScheduledTaskHandler(IOrchardServices orchardServices, ISmsServices smsServices,
                                ISmsCommunicationService smsCommunicationService)
 {
     _orchardServices         = orchardServices;
     _smsServices             = smsServices;
     _smsCommunicationService = smsCommunicationService;
     Logger = NullLogger.Instance;
 }
 public UserProfileController(IUserProfileServices userProfileServices,
                              ISmsServices smsServices,
                              IAuthenticationService <int> authService,
                              ILogger <IUserProfileServices> logger) : base(logger)
 {
     _userProfileServices = userProfileServices;
     _authService         = authService;
     _smsServices         = smsServices;
 }
示例#6
0
        public RegBotControl(ISmsServices smsServices, IOneProxyControl oneProxyControl, IBrowserProfileService browserProfileService)
        {
            InitializeComponent();

            _smsServices           = smsServices;
            _oneProxyControl       = oneProxyControl;
            _browserProfileService = browserProfileService;
            GetRandomAccountData(CountryCode.RU);

            cmbCountry.DataSource    = CountryItem.GetCountryItems();
            cmbCountry.DisplayMember = "Text";
            cmbCountry.SelectedIndex = 0;

            connectionString = Path.Combine(Application.StartupPath, ConfigurationManager.AppSettings["DbPath"]);

            Load           += Form1_Load;
            tabPage2.Enter += TabPage2_Enter;

            btnMailRuEmail.Click += BtnMailRuEmail_Click;
            btnMailRuPhone.Click += BtnMailRuPhone_Click;
            btnYandexEmail.Click += BtnYandexEmail_Click;
            btnYandexPhone.Click += BtnYandexPhone_Click;
            btnGmail.Click       += BtnGmail_Click;
            btnFacebook.Click    += BtnFacebook_Click;
            btnVk.Click          += BtnVk_Click;
            btnOk.Click          += BtnOk_Click;
            btnInstagram.Click   += BtnInstagram_Click;
            btnTwitter.Click     += BtnTwitter_Click;
            btnGenerateEn.Click  += BtnGenerateEn_Click;
            btnGenerateRu.Click  += BtnGenerateRu_Click;

            dgvItems.FilterStringChanged += DgvItems_FilterStringChanged;
            dgvItems.SortStringChanged   += DgvItems_SortStringChanged;
            dgvItems.UserDeletingRow     += DgvItems_UserDeletingRow;

            var control = (Control)_oneProxyControl;

            control.Dock = DockStyle.Fill;
            pnlOneProxy.Controls.Clear();
            pnlOneProxy.Controls.Add(control);
        }
示例#7
0
 public CheckMAMController(ISmsServices smsServices)
 {
     _smsServices = smsServices;
 }
 public SmsGatewayPartDriver(ISmsServices smsServices, IOrchardServices orchardServices)
 {
     _smsServices     = smsServices;
     _orchardServices = orchardServices;
 }
 public LoanEffetivatedEventSendSms(ISmsServices smsServices)
 {
     _smsServices = smsServices;
 }
示例#10
0
 public BudgeteerController(IRepositoryWrapper repo, ISmsServices smsServices, IGoogleCalendarServices googleCalendarServices)
 {
     _repo                  = repo;
     _smsService            = smsServices;
     _googleCalendarService = googleCalendarServices;
 }
示例#11
0
 public EmailController(IChromiumSettings chromiumSettings, ISmsServices smsServices) : base(chromiumSettings, smsServices)
 {
 }
示例#12
0
 public SmsSettingsPartDriver(ISmsServices smsServices)
 {
     _smsServices = smsServices;
 }
示例#13
0
 public SmsCommunicationImportFeature(ISmsServices smsServices)
 {
     _smsServices = smsServices;
 }
示例#14
0
        public SmsGatewayPartHandler(IRepository <SmsGatewayPartRecord> repository, INotifier notifier, IOrchardServices orchardServices, ISmsServices smsServices,
                                     ISmsCommunicationService smsCommunicationService, IScheduledTaskManager taskManager)
        {
            _orchardServices         = orchardServices;
            _smsServices             = smsServices;
            _smsCommunicationService = smsCommunicationService;
            _notifier    = notifier;
            _taskManager = taskManager;
            T            = NullLocalizer.Instance;
            Filters.Add(StorageFilter.For(repository));

            OnUpdated <SmsGatewayPart>((context, part) => {
                if (_orchardServices.WorkContext.HttpContext.Request.Form["submit.Test"] == "submit.SmsTest")
                {
                    if (part.SendToTestNumber && part.ContentItem.ContentType == "CommunicationAdvertising")
                    {
                        if (!string.IsNullOrEmpty(part.PrefixForTest) && !string.IsNullOrEmpty(part.NumberForTest))
                        {
                            string linktosend = "";
                            ICommunicationService _communicationService;

                            bool tryed = _orchardServices.WorkContext.TryResolve <ICommunicationService>(out _communicationService);
                            if (tryed)
                            {
                                if (_communicationService.CampaignLinkExist(part))
                                {
                                    linktosend = _communicationService.GetCampaignLink("Sms", part);
                                }
                            }
                            string messageToSms = part.Message + " " + linktosend;

                            // Id deve essere univoco - Utilizzo part.Id per il Publish e lo modifico per SendToTestNumber
                            string IdSendToTest = "OrchardTest_" + part.Id.ToString() + "_" + DateTime.Now.ToString("yyyyMMddHHmmss");

                            //_smsServices.SendSms(
                            //    part.NumberForTest.Split(';').Select(x => new SmsHQL { SmsPrefix = "", SmsNumber = x, Id = 0, Title = "Test" }).ToArray(),
                            //    messageToSms, part.Alias, IdSendToTest, part.HaveAlias);

                            // Destinatario
                            string numberTestSms = part.PrefixForTest.Trim() + part.NumberForTest.Trim();

                            Hashtable hs = new Hashtable();
                            hs.Add("SmsContactNumber", numberTestSms);

                            List <Hashtable> listaDestinatari = new List <Hashtable>();
                            listaDestinatari.Add(hs);

                            // Invio SMS a NumberForTest
                            var smsOutcome = _smsServices.SendSms(listaDestinatari.ToArray(), messageToSms, part.Alias, IdSendToTest, part.HaveAlias);
                            if (smsOutcome.ToUpper() == "TRUE")
                            {
                                _notifier.Information(T("SMS sent successfully to test phone number."));
                            }
                            else
                            {
                                _notifier.Error(T("Send SMS to test phone number failed."));
                                Logger.Error("Error sending SMS to test phone number. SendSMS return value: " + smsOutcome);
                            }
                        }
                    }
                }
            });

            OnPublished <SmsGatewayPart>((context, part) => {
                if (part.SendOnNextPublish && !part.SmsMessageSent)
                {
                    ContentItem ci = _orchardServices.ContentManager.Get(part.ContentItem.Id);
                    _taskManager.CreateTask("Laser.Orchard.SmsGateway.Task", DateTime.UtcNow.AddMinutes(1), ci);
                }
            });
        }
示例#15
0
 public SmsDeliveryReportController(ISmsServices smsServices, IRepository <SmsGatewayPartRecord> smsGatewayRepository)
 {
     _smsServices          = smsServices;
     _smsGatewayRepository = smsGatewayRepository;
 }