Beispiel #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            FileConfig.CreateConnect(servername_txt.Text, username_txt.Text, password_txt.Text, database_txt.Text, 1);

            MessageBox.Show("Connect thành công", "", MessageBoxButtons.OK, MessageBoxIcon.Information);
            if (FileConfig.CheckDatabase())
            {
                MessageBox.Show("Tạo Database Thành Công!", "", MessageBoxButtons.OK, MessageBoxIcon.Information);
                Panel.Controls.Clear();
                ActiveVariablesUC avuc = new ActiveVariablesUC();
                avuc.parent = parent;
                Panel.Controls.Add(avuc);
            }
            else
            {
                MessageBox.Show("Tạo Database Thất Bại", "", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Beispiel #2
0
 private void database_save_Click(object sender, EventArgs e)
 {
     FileConfig.CreateConnect(servername_txt.Text, username_txt.Text, password_txt.Text, database_txt.Text, 0);
     if (FileConfig.testConnect())
     {
         MessageBox.Show("Connect thành công", "", MessageBoxButtons.OK, MessageBoxIcon.Information);
         if (FileConfig.CheckDatabase())
         {
             MessageBox.Show("Tạo Database Thành Công!", "", MessageBoxButtons.OK, MessageBoxIcon.Information);
             FileConfig.CreateConnect(servername_txt.Text, username_txt.Text, password_txt.Text, database_txt.Text, 1);
             parent.Close();
         }
         else
         {
             MessageBox.Show("Tạo Database Thất Bại", "", MessageBoxButtons.OK, MessageBoxIcon.Information);
             FileConfig.ReadFile();
         }
     }
     else
     {
         MessageBox.Show("Connect thất bại", "", MessageBoxButtons.OK, MessageBoxIcon.Information);
         FileConfig.ReadFile();
     }
 }