예제 #1
0
        private void Save_Click(object sender, EventArgs e)
        {
            using (MySqlConnection mysqlCon = new MySqlConnection(Var.Sqlmy))
            {
                string combo        = comboBox1.Text;
                string selectQueray = "SELECT * FROM Mario.Machine WHERE MachineNom = '" + combo + "';";
                mysqlCon.Open();
                MySqlCommand    mySqlCmd = new MySqlCommand(selectQueray, mysqlCon);
                MySqlDataReader reader   = mySqlCmd.ExecuteReader();
                while (reader.Read())
                {
                    idnom = (int)reader["idMachine"];
                }

                mysqlCon.Close();
            }
            using (MySqlConnection mysqlCon1 = new MySqlConnection(Var.Sqlmy))
            {
                string valeur1       = valeurtxt.Text;
                string nom1          = nomtxt.Text;
                string description1  = descriptiontxt.Text;
                string statut1       = statuttxt.Text;
                string img1          = imgTxt.Text;
                string dossier1      = dossierTxt.Text;
                string id1           = idtxt.Text;
                string selectQueray1 = "INSERT INTO Mario.Equipement (idMachine, EquipementValeur, EquipementNom, EquipementDescription, EquipementStatut, photo, folder, idReAchat) VALUES ('" + idnom + "','" + valeur1 + "','" + nom1 + "','" + description1 + "','" + statut1 + "','" + img1 + "','" + dossier1 + "','" + id1 + "');";
                mysqlCon1.Open();
                MySqlCommand mySqlCmd1 = new MySqlCommand(selectQueray1, mysqlCon1);
                mySqlCmd1.ExecuteNonQuery();
                MessageBox.Show("Ajout Réussi");
                mysqlCon1.Close();
            }
            MLMachine f3 = new MLMachine(); // Instantiate a Form3 object.

            f3.Show();                      // Show Form3 and
        }
예제 #2
0
        private void button7_Click(object sender, EventArgs e)
        {
            MLMachine f3 = new MLMachine();

            f3.Show();
        }
예제 #3
0
        private void button_WOC3_Click(object sender, EventArgs e)
        {
            MLMachine f3 = new MLMachine(); // Instantiate a Form3 object.

            f3.Show();                      // Show Form3 and
        }