Пример #1
0
        public bool CauseValidation()
        {
            configManager.ClearMessageList();
            label_Wait.Visible = true;
            bool result = false;
            PMADatabaseController dbController = new PMADatabaseController();

            if (textBox_Database.Text != string.Empty && !dbController.CreateDBConnection(textBox_Database.Text, textBox_DBUser.Text, textBox_DBPassword.Text))
            {
                configManager.Message.Add(dbController.Message);
                result = false;
            }
            else
            {
                result = true;
            }
            label_Wait.Visible = false;
            return(result);
        }
Пример #2
0
        //-------------------------------------------------------------------------------------------------
        /// <summary>
        /// Runs the task.
        /// </summary>
        public void RunTask()
        {
            configManager.Logger.Debug(EnumMethod.START);
            configManager.ClearMessageList();
            postAlert = false;
            if (configManager.SystemAnalyzerInfo.SetDiscWatch)
            {
                RunDiscWatch();
            }
            if (configManager.SystemAnalyzerInfo.SetSessionStateSizeAlerts)
            {
                RunDBSizeWatch("ASPState", configManager.SystemAnalyzerInfo.SessionStateSizeAlertLevel);
            }

            if (configManager.SystemAnalyzerInfo.SetTempDBSizeAlerts)
            {
                RunDBSizeWatch("tempdb", configManager.SystemAnalyzerInfo.TempDBSizeAlertLevel);
            }

            if (configManager.SystemAnalyzerInfo.SetPhysicalMemWatch)
            {
                RunPhysicalMemoryWatch();
            }
            if (configManager.SystemAnalyzerInfo.SetServiceWatcher)
            {
                RunServiceWatcher();
            }

            if (postAlert)
            {
                if (configManager.SystemAnalyzerInfo.SetSendMail)
                {
                    SendMail();
                }
                if (configManager.SystemAnalyzerInfo.SetPostFTP)
                {
                    PostFTPMessage();
                }
            }
            configManager.Logger.Debug(EnumMethod.END);
        }
Пример #3
0
        //--------------------------------------------------------------------------------------------------------------
        /// <summary>
        /// Causes the validation.
        /// </summary>
        /// <returns></returns>
        public bool CauseValidation()
        {
            configManager.ClearMessageList();
            bool isValidEmail = true;

            string[] emails = null;

            if (richTextBox_EmailsAlerts.Text != string.Empty)
            {
                emails = richTextBox_EmailsAlerts.Text.Split(';');
                foreach (string email in emails)
                {
                    if (!Regex.IsMatch(email, REGX_VERIFY_EMAIL))
                    {
                        isValidEmail = false;
                        configManager.Message.Add("Invalid Email : " + email);
                    }
                }
            }
            if (richTextBox_EmailsPMAReport.Text != string.Empty)
            {
                emails = richTextBox_EmailsPMAReport.Text.Split(';');
                foreach (string email in emails)
                {
                    if (!Regex.IsMatch(email, REGX_VERIFY_EMAIL))
                    {
                        isValidEmail = false;
                        configManager.Message.Add("Invalid Email : " + email);
                    }
                }
            }
            if (richTextBox_ActionServices.Text != string.Empty)
            {
                emails = richTextBox_ActionServices.Text.Split(';');
                foreach (string email in emails)
                {
                    if (!Regex.IsMatch(email, REGX_VERIFY_EMAIL))
                    {
                        isValidEmail = false;
                        configManager.Message.Add("Invalid Email : " + email);
                    }
                }
            }
            if (richTextBox_sqlSubscibtion.Text != string.Empty)
            {
                emails = richTextBox_sqlSubscibtion.Text.Split(';');
                foreach (string email in emails)
                {
                    if (!Regex.IsMatch(email, REGX_VERIFY_EMAIL))
                    {
                        isValidEmail = false;
                        configManager.Message.Add("Invalid Email : " + email);
                    }
                }
            }

            if (isValidEmail)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }