private void btn_valider1_Click(object sender, EventArgs e) { double note_anglais = Convert.ToInt32(tbx_anglais.Text); double note_droit = Convert.ToInt32(tbx_droit.Text); double note_livret = Convert.ToInt32(tbx_livret.Text); double note_maths = Convert.ToInt32(tbx_maths.Text); double note_gestProjet = Convert.ToInt32(tbx_gestProj.Text); double note_bdd = Convert.ToInt32(tbx_bdd.Text); double note_comEcrite = Convert.ToInt32(tbx_comEcrite.Text); double note_contGest = Convert.ToInt32(tbx_contGest.Text); double note_mana = Convert.ToInt32(tbx_mana.Text); double note_framework = Convert.ToInt32(tbx_frwk.Text); double note_jse = Convert.ToInt32(tbx_jse.Text); double note_technoWeb = Convert.ToInt32(tbx_technoWeb.Text); double note_concepMod = Convert.ToInt32(tbx_concepMod.Text); double note_infraScript = Convert.ToInt32(tbx_infraScript.Text); double note_SystOpn = Convert.ToInt32(tbx_SystOpn.Text); double note_secu = Convert.ToInt32(tbx_secu.Text); double note_AdminRes = Convert.ToInt32(tbx_adminRes.Text); double note_SystPro = Convert.ToInt32(tbx_SystPro.Text); double reseau, dev, management; reseau = (note_AdminRes + note_infraScript + note_secu + note_SystOpn + note_SystPro) / 5; dev = (note_concepMod + (note_jse * 2) + note_technoWeb + note_framework) / 5; management = ((note_contGest * 3) + note_mana) / 4; double resultat = ((reseau * 3) + (dev * 3) + (management * 2) + note_anglais + note_bdd + note_comEcrite + (note_gestProjet * 3) + note_droit + (note_maths * 3) + (note_livret * 12)) / 30; label_moyenne.Text = Convert.ToString(resultat); annee1 annee = new annee1(resultat, note_AdminRes, note_anglais, note_bdd, note_comEcrite, note_concepMod, note_contGest, note_gestProjet, note_infraScript, note_jse, note_secu, note_SystOpn, note_SystPro, note_technoWeb, note_droit, note_framework, note_maths, note_livret, note_mana); }
// Suppresssion de l'année 2 public void DeleteAnnee1(annee1 annee1) { try { // Ouverture de la connexion SQL this.connection.Open(); // Création d'une commande SQL en fonction de l'objet connection MySqlCommand cmd = this.connection.CreateCommand(); cmd.CommandText = "DELETE from annee1 where id_bulletin1 = " + annee1.id_bulletin1 + " "; } catch (MySqlException mse) { // Gestion des erreurs : // Possibilité de créer un Logger pour les exceptions SQL reçus // Possibilité de créer une méthode avec un booléan en retour pour savoir si le eleves à été ajouté correctement. } }
public void modifyAnnee1(annee1 annee1) { try { // Ouverture de la connexion SQL this.connection.Open(); // Création d'une commande SQL en fonction de l'objet connection MySqlCommand cmd = this.connection.CreateCommand(); cmd.CommandText = "UPDATE annee1 SET id_bulletin1 = @id_bulletin1, Moyenne1 = @Moyenne1, Administration_réseau = @Administration_réseau, Anglais_technique = @Anglais_technique, Base_de_données = @Base_de_données, Communication_écrite = @Communication_écrite, Conception_et_modélisation = @Conception_et_modélisation, Controle_de_gestion = @Controle_de_gestion, Gestion_de_projet = @Gestion_de_projet, Infrastructure_et_scripting = @Infrastructure_et_scripting, JSE = @JSE, Droit_informatique = @Droit_informatique, Infrastructure_et_scripting = @Infrastructure_et_scripting, Outils_mathematiques = @Outils_mathematiques, Securite = @Securite, Systeme_open_source = @Systeme_open_source, Systeme_proprietaire = @Systeme_proprietaire, Technologie_web_dynamique = @Technologie_web_dynamique, Framework_web = @Framework_web, Livret_de_Suivi = @Livret_de_Suivi, Management = @Management) WHERE id_bulletin1 = " + annee1.id_bulletin1 + " "; // utilisation de l'objet annee1 passé en paramètre cmd.Parameters.AddWithValue("@id_bulletin1", annee1.id_bulletin1); cmd.Parameters.AddWithValue("@Moyenne1", annee1.Moyenne1); cmd.Parameters.AddWithValue("@Administration_réseau", annee1.Administration_réseau); cmd.Parameters.AddWithValue("@Anglais_technique", annee1.Anglais_technique); cmd.Parameters.AddWithValue("@Base_de_données", annee1.Base_de_données); cmd.Parameters.AddWithValue("@Communication_écrite", annee1.Communication_écrite); cmd.Parameters.AddWithValue("@Conception_et_modélisation", annee1.Conception_et_modélisation); cmd.Parameters.AddWithValue("@Controle_de_Gestion", annee1.Controle_de_gestion); cmd.Parameters.AddWithValue("@Gestion_de_projet", annee1.Gestion_de_projet); cmd.Parameters.AddWithValue("@Infrastructure_et_scripting", annee1.Infrastructure_et_scripting); cmd.Parameters.AddWithValue("@JSE", annee1.JSE); cmd.Parameters.AddWithValue("@Securite", annee1.Securite); cmd.Parameters.AddWithValue("@Systeme_open_source", annee1.Systeme_open_source); cmd.Parameters.AddWithValue("@Systeme_proprietaire", annee1.Systeme_proprietaire); cmd.Parameters.AddWithValue("@Technologie_web_dynamique", annee1.Technologie_web_dynamique); cmd.Parameters.AddWithValue("@Droit_informatique", annee1.Droit_informatique); cmd.Parameters.AddWithValue("@Framework_web", annee1.Framework_web); cmd.Parameters.AddWithValue("@Outils_mathematiques", annee1.Outils_informatique); cmd.Parameters.AddWithValue("@Livret_de_suivi", annee1.Livret_de_suivi); cmd.Parameters.AddWithValue("@Management", annee1.Management); } catch (MySqlException mse) { // Gestion des erreurs : // Possibilité de créer un Logger pour les exceptions SQL reçus // Possibilité de créer une méthode avec un booléan en retour pour savoir si le eleves à été ajouté correctement. } }