Ejemplo n.º 1
0
        public void SendManualEmail()
        {
            try
            {
                MailingHelper mailingHelper  = new MailingHelper(AutoFXUsers);
                string        receipientType = string.Empty;

                if (IsAllUsersChecked)
                {
                    receipientType = "All";
                }
                else if (IsActiveUsersChecked)
                {
                    receipientType = "Active";
                }
                else if (IsRevokedUsersChecked)
                {
                    receipientType = "Revoked";
                }

                if (mailingHelper.SendEmail(ManualEmailSubject, receipientType, EnteredManualEmail))
                {
                    MessageBox.Show("Manual Email Sent");
                }
                else
                {
                    MessageBox.Show("Manual Email Failed");
                }
            }
            catch (Exception exception)
            {
                Logger.Error(exception, OType.FullName, "SendManualEmail");
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="signalInfo"></param>
        private void SendSignalNotification(object signalInfo)
        {
            string signalInformation = (string)signalInfo;

            MailingHelper mailingHelper = new MailingHelper(_helper.BuildUsersList());

            mailingHelper.SendEmail(SignalParser.ParseSignal(signalInformation));
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Default Constructor
        /// </summary>
        public AutoFXToolsServerShellViewModel()
        {
            #region Command Initializations

            this.SaveTemplateChangesCommand = new SaveTemplateChangesCommand(this);
            this.SearchGoCommand            = new SearchGoCommand(this);
            this.UndoEmailTemplateCommand   = new UndoEmailTemplateCommand(this);
            this.AddNewUserCommand          = new AddNewUserCommand(this);
            this.EditUserCommand            = new EditUserCommand(this);
            this.SaveUserCommand            = new SaveUserCommand(this);
            this.SendManualEmailCommand     = new SendManualEmailCommand(this);
            this.ExportUserCommand          = new ExportUserCommand(this);
            this.RefreshCommand             = new RefreshCommand(this);
            this.SortByIDCommand            = new SortByIDCommand(this);
            this.SortByAccountIDCommand     = new SortByAccountIDCommand(this);
            this.SortByKeyStringCommand     = new SortByKeyStringCommand(this);
            this.SortByEmailCommand         = new SortByEmailCommand(this);
            this.SortByStatusCommand        = new SortByStatusCommand(this);
            this.DeleteCommand = new DeleteCommand(this);

            #endregion

            SearchHelper.ClientSubscribed   += ClientSubscribed;
            SearchHelper.ClientUnSubscribed += ClientUnSubscribed;
            ConnectedUsersCount              = 0;

            _refreshUsersTimer           = new Timer(RefreshPeriod * 1000);
            _refreshUsersTimer.Elapsed  += RefreshUsersTimerElapsed;
            _refreshUsersTimer.AutoReset = true;
            _refreshUsersTimer.Enabled   = true;

            ConnectedUsers = new ObservableCollection <User>();

            this._currentDispatcher = Dispatcher.CurrentDispatcher;

            var connectionManager = new ConnectionManager();
            _helper     = new DBHelper(connectionManager);
            AutoFXUsers = _helper.BuildUsersList();

            _mailingHelper = new MailingHelper(AutoFXUsers);

            Service = new TradeMirrorService();
            //ThreadPool.QueueUserWorkItem(InitializeService, Service);
            InitializeService(Service);

            InitializeSearchTermsCollection();
            InitializeEmailTemplateNamesCollection();
            InitializeFilteredUsersCollection();
            InitializeNotificationStatusesCollection();
            InitializeUserStatusesCollection();

            SetActiveUsersOnUI();
            SetRevokedUsersOnUI();
        }