예제 #1
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (txtserveur.Text.Equals("") || txtdatabase.Text.Equals("") || txtusername.Text.Equals("") || txtpassword.Text.Equals(""))
            {
                MessageBox.Show("Veuillez completer le(s) champs", "Création de fichier config", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            else
            {
                try
                {
                    Connexions.TestFile();
                    con.Database = txtdatabase.Text;
                    con.Serveur  = txtserveur.Text;
                    con.User     = txtusername.Text;
                    con.Password = txtpassword.Text;
                    if (ClsConfiguration.CreationDeFichierConf(con, connexionType) == true)
                    {
                        MessageBox.Show("Configuration reçu!", "Création de fichier config", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        initialiser();
                        ImplementeConnexion.Instance.Initialise();
                    }
                    else
                    {
                        MessageBox.Show("Configuration echouée!", "Création de fichier config", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }
        }
예제 #2
0
 private void btnSave_Click(object sender, EventArgs e)
 {
     if (reponse.Text.Equals("configuration"))
     {
         if (Connexions.TestFile() == true)
         {
             FrmConfiguration ser = new FrmConfiguration();
             ser.choix.Text = "1";
             this.Close();
             ser.ShowDialog();
         }
         else
         {
             FrmConfiguration ser = new FrmConfiguration();
             ser.choix.Text = "2";
             ser.ShowDialog();
         }
     }
     else
     {
         MessageBox.Show("Veuillez entrée le mot de passe de configuration ! ", "Message d'erreur", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
예제 #3
0
        private void FrmConfiguration_Load(object sender, EventArgs e)
        {
            ok.Visible          = false;
            pictureBox7.Visible = false;
            fx.Picture_Rond(profil);
            txtserveur.Items.Add(".");
            txtserveur.Items.Add("localhost");
            txtserveur.Items.Add(@".\SQLEXPRESS");
            txtserveur.Items.Add(string.Format(@"{0}", Environment.MachineName) + "" + "\\SA");
            txtserveur.Items.Add(string.Format(@"{0}", Environment.MachineName));

            if (Connexions.TestFile() == true)
            {
                ImplementeConnexion.Instance.Initialise();
                ClsFonctions.Instance.ProprieteDatagrid(Table);
                DataGrid();
                if (choix.Text.Equals("1"))
                {
                    Agent.Visible  = false;
                    panel1.Visible = false;
                    label9.Visible = false;
                }
                else if (choix.Text.Equals("2"))

                {
                    pro.ChargerCombo("Liste_Agent", Agent, "Noms");
                    Agent.Visible  = true;
                    panel1.Visible = true;
                    label9.Visible = true;
                }
            }
            else
            {
                MessageBox.Show("Désolé les fichier de la connexion est introuvable ! , ", "Loading datas", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }