Пример #1
0
        private void btn_StopSQLGeneration_Click(object sender, EventArgs e)
        {
            // Stop SQLGeneration for selected servers
            SqlGenWrapper.StopSqlGenerator(lv_SQL, ServerWrapper.SqlServersList);

            // Update ListView
            ServerWrapper.UpdateSqlListView(lv_SQL, lbl_SQLGenerationRunningvalue);
        }
Пример #2
0
 private void timer1_Tick(object sender, EventArgs e)
 {
     ServerWrapper.UpdateListView(lv_AgentsList, lbl_ChangeRateValue, lbl_totalAgentsRunningValue);
     ServerWrapper.UpdateExchangeListView(lv_ExchangeServers, lbl_exchangeGenerationRunningValue);
     ServerWrapper.UpdateSqlListView(lv_SQL, lbl_SQLGenerationRunningvalue);
     lbl_TotalAmountValue.Text         = lv_AgentsList.Items.Count.ToString();
     lbl_exchangeTotalAgentsValue.Text = lv_ExchangeServers.Items.Count.ToString();
     lbl_TotalSQLServersValue.Text     = lv_SQL.Items.Count.ToString();
 }
Пример #3
0
        private void btn_StartSQLGeneration_Click(object sender, EventArgs e)
        {
            var failedValidation = false;
            var textBoxValidate  = new List <TextBox> {
                tb_dbName, tb_SQLAmountRows
            };

            foreach (var textBox in textBoxValidate)
            {
                if (!string.IsNullOrWhiteSpace(textBox.Text))
                {
                    continue;
                }
                errorProvider1.SetError(textBox, "Field cannot be empty");
                failedValidation = true;
            }

            if (failedValidation)
            {
                return;
            }


            var rowsToInsert        = Convert.ToInt32(tb_SQLAmountRows.Text);
            var sqlParmsToSerialize = new SqlGeneratorParameters()
            {
                RowsToInsert = rowsToInsert, DbName = tb_dbName.Text
            };

            sqlParmsToSerialize.SerizalizeSqlParamsToFile();

            if (!SqlGenWrapper.DoNotShowSqlPrerequisites)
            {
                var prerequisitesForm = new SQLPrerequisites();
                prerequisitesForm.Show();
            }

            // Start SQL Generation for selected servers with specific parameters

            if (cb_UseCustomCredsSQL.Checked)
            {
                SqlGenWrapper.StartSqlGenerator(lv_SQL, ServerWrapper.SqlServersList, tb_dbName.Text, rowsToInsert,
                                                tb_SQLCustomUsername.Text, tb_SQLCustomPassword.Text);
            }
            else
            {
                SqlGenWrapper.StartSqlGenerator(lv_SQL, ServerWrapper.SqlServersList, tb_dbName.Text, rowsToInsert);
            }

            // Update ListView
            ServerWrapper.UpdateSqlListView(lv_SQL, lbl_SQLGenerationRunningvalue);
        }