Пример #1
0
        private void button2_Click(object sender, EventArgs e)
        {
            GenerateUploadRecord gur = new GenerateUploadRecord();

            gur.ShowDialog();
            if (gur.NumberOfRecords != 0 && !String.IsNullOrEmpty(gur.ServerName))
            {
                textBox1.AppendText(gur.NumberOfRecords + " records are being generated and uploaded to " + gur.ServerName + ".");
                textBox1.AppendText(Environment.NewLine);
                ClusterInfo cluster;
                if (gur.ServerName.CompareTo("Server1") == 0)
                {
                    cluster = Clusters[0];
                }
                else if (gur.ServerName.CompareTo("Server2") == 0)
                {
                    cluster = Clusters[1];
                }
                else
                {
                    cluster = Clusters[2];
                }
                AutoRecordGeneration gen = new AutoRecordGeneration();
                progressBar.Value   = 0;
                progressBar.Maximum = gur.NumberOfRecords;
                progressBar.Step    = 1;
                progressBar.Visible = true;
                gen.GenerateRecords(cluster, gur.NumberOfRecords, progressBar);
                textBox1.AppendText("Task is completed.");
                textBox1.AppendText(Environment.NewLine);
            }
        }
Пример #2
0
        private void button3_Click(object sender, EventArgs e)
        {
            GenerateUploadRecord gur = new GenerateUploadRecord();

            gur.ShowDialog();
            if (gur.NumberOfRecords != 0 && !String.IsNullOrEmpty(gur.ServerName))
            {
                ClusterInfo cluster;
                if (gur.ServerName.CompareTo("Server1") == 0)
                {
                    cluster = Clusters[0];
                }
                else if (gur.ServerName.CompareTo("Server2") == 0)
                {
                    cluster = Clusters[1];
                }
                else
                {
                    cluster = Clusters[2];
                }

                textBox1.AppendText("First " + gur.NumberOfRecords + " records are being modified!");
                textBox1.AppendText(Environment.NewLine);

                AutoRecordGeneration gen = new AutoRecordGeneration();
                progressBar.Value   = 0;
                progressBar.Maximum = gur.NumberOfRecords;
                progressBar.Step    = 1;
                progressBar.Visible = true;
                bool result = gen.ModifyRecord(cluster, gur.NumberOfRecords, progressBar);

                if (result)
                {
                    textBox1.AppendText("First " + gur.NumberOfRecords + " records have been modified successfully!");
                    textBox1.AppendText(Environment.NewLine);
                }
                else
                {
                    textBox1.AppendText("Modification failed!");
                    textBox1.AppendText(Environment.NewLine);
                }
            }
        }