WOW !! MUCH LOVE ! SO WORLD PEACE !
Fond bitcoin pour l'amélioration du site: 1memzGeKS7CB3ECNkzSn2qHwxU6NZoJ8o
  Dogecoin (tips/pourboires): DCLoo9Dd4qECqpMLurdgGnaoqbftj16Nvp


Home | Publier un mémoire | Une page au hasard

 > 

Conception et la realisation d'une base de donnees pour la gestion des inscriptions des etudiants.cas de l'upkan


par Germain NDANGUELA
Université pédagogique de Kananga - Graduat 2021
  

précédent sommaire suivant

Bitcoin is a swarm of cyber hornets serving the goddess of wisdom, feeding on the fire of truth, exponentially growing ever smarter, faster, and stronger behind a wall of encrypted energy

III.1.2. Présentation des Modèles

1. Le Modèle Conceptuel des Données (MCD)

Après la phase d'analyse, nous pouvons commencer à représenter les informations sous forme conceptuelle dans un modèle de données. Un modèle de données est un formalisme permettant de décrire les données intervenant dans un système d'informations et les liens existant entre ces informations de façon claire, simple, complète et non ambiguë. Le Modèle Conceptuel de Données (MCD) que nous allons construire contient deux éléments principaux : les entités et les relations. 37(*)

a. Une entité (ou objet)

Est un élément du problème. La notion d'entité est réfractaire à toute définition formelle. Une entité est une chose (concrète ou abstraite) qui existe et est distinguable des autres entités. Elle est définie par un ensemble de propriétés. Chacune des propriétés est l'un des éléments qui caractérise l'entité. Il faut distinguer une entité et une occurrence d'entité (ou instance). Une entité correspond au type général d'une donnée (ex : le type "employé") alors qu'une occurrence d'une entité est un représentant particulier de cette entité (l'employé "Espoir KAYOMBO"). Une occurrence d'une entité est un élément particulier correspondant à l'entité et associé à un élément du réel.

b. Une relation

Est un lien poss0ible qui relie deux entités38(*). Elle correspond à une association perçue dans le réel entre deux entités. Par exemple, si un employé peut être affecté à un entrepôt, il y aura une relation "affectation" entre l'entité entrepôt et l'entité "employé". Cela ne signifie pas nécessairement qu'il y aura affectation pour chacun des employé, juste qu'il est possible qu'un employé soit affecté à un entrepôt. Une relation peut éventuellement être reliée à plus de deux entités et peut avoir certaines propriétés.

c. Association 

Représentation d'un lien entre plusieurs entités, lien où chaque entité liée joue un rôle déterminé. Si l'association lie deux (ou plus) entités du même type, elle est dite "cyclique" et, dans ce cas, la spécification du rôle de chaque entité est indispensable pour supprimer les ambiguïtés possibles.39(*)

d. Attribut

Est la représentation d'une propriété associée à un type d'entité ou à un type d'association, ou participant à la composition d'un autre attribut. L'ensemble des attributs d'un type d'entités (type d'associations) représente l'ensemble des associations inhérentes que l'on souhaite conserver sur les entités (associations) du type d'entités (type d'associations). Exemple : L'âge d'une personne, la puissance d'une voiture, la superficie d'une province...

e. La propriété est une donnée élémentaire et indécomposable du système d'information. Par exemple une date de début de projet, la couleur d'une voiture, une note d'étudiant.

f. L'entité est la représentation dans le système d'information d'un objet matériel ou immatériel ayant une existence propre et conforme aux choix de gestion de l'entreprise. L'entité est composée de propriétés. Par exemple une personne, une voiture, un client, un projet.

g. Occurrence d'une propriété est le nombre de valeurs distinctes prise par cette propriété.

h. Occurrence d'une relation est le nombre d'objets participant dans une relation par l'occurrence.

i. La relation traduit dans le système d'information le fait qu'il existe un lien entre différentes entités. Le nombre d'intervenants dans cette association caractérise sa dimension :

Ø Réflexive sur une même entité ;

Ø Binaire entre deux entités ;

Ø Ternaire entre trois entités ;

Ø n'aire entre n entités.

j. Les cardinalités caractérisent le lien entre une entité et une association. La cardinalité d'une association est constituée d'une borne minimale et d'une borne maximale :

Ø minimale : nombre minimum de fois qu'une occurrence d'une entité participe aux occurrences de l'association, généralement 0 ou 1 ;

Ø maximale : nombre maximum de fois qu'une occurrence d'une entité participe aux occurrences de l'association, généralement 1 ou n ;

Ø Les cardinalités maximales sont nécessaires pour la création de la base de données. Les cardinalités minimales sont nécessaires pour exprimer les contraintes d'intégrités.

k. Identifiant : Il est constitué d'un ou plusieurs propriétés de l'entité telles qu'à chaque valeur de l'identifiant corresponde une et une seule occurrence de l'entité.

Après avoir fait une analyse aussi complète que possible du problème à informatiser, la construction du MCD se fait en quatre étapes : repérage des entités, construction des entités, choix des propriétés, construction des relations et choix des cardinalités.

A retenir : La méthode générale de construction du MCD :

1. recherche des entités,

2. recherche des propriétés (dont la clé de chaque entité),

3. recherche des relations entre entités,

4. recherche des cardinalités (0:1, 1:1, 0:n ou 1:n)

ü PRESENTATION DE NOTRE MCD

a. Le modèle Conceptuel des Données Brut

· Règles de gestion :

- Un candidat doit s'inscrire dans une et une seule promotion et dans une promotion doit s'inscrire un ou plusieurs candidats ;

- Une promotion doit appartenir à un ou plusieurs département et dans un département doit appartenir une ou plusieurs promotions ;

- Une faculté doit contenir un ou plusieurs départements et un départementdoit être contenu dans une et une seule faculté.

b. Modèle Conceptuel des Données Valide

CIF

CIM

CIF

2. Modèle Logique de Données (MLD)

Une fois le MCD construit, l'étape suivante dans la conception de la base de données consiste à concevoir le modèle logique de données, ou MLD. Ce MLD montre l'organisation des données sous forme de tables et est très proche de la manière dont les données vont être effectivement organisées dans Access. L'étape de transformation du MCD en MLD est assez simple et passe par trois étapes :

1. transformation des entités en tables,

2. transformation des relations du MCD,

3. suppression des tables inutiles

Ainsi notre modèle logique de données en extension est le suivant :

3. Modèle Physique des données (MPD)

Le MPD est un modèle étroitement lié aux techniques informatiques, décrivant comment les données seront stockées dans la mémoire physique de l'ordinateur. Donc comment les données seront représentées dans le Système de Gestion de Base de données.

Les travaux à réaliser au cours de cette étape sont les suivants :

- La mise en place d'une structure de base de données pour chaque table ;

- Définition de caractéristique comme : Champs, types d'attributs ainsi que les tailles de chaque attribut.

En pratique, chaque SGBD présente plusieurs types de données. Si nous utilisons Access comme SGBD nous trouvons les types suivants : Texte, Numérique, Auto Numérique, Date/Heure, Booléen...

Il faut alors représenter les détails de chaque champ dans un tableau ci-après : Il faut alors le faire pour chaque table du MLD.

En voici notre modèle physique des données :

Nom table

Nom du champ

Type

Taille

Observation

T_CANDIDAT

Matricule_Etudiant

Texte

8

Clé primaire

Id_Promotion

Texte

8

Clé étrangère

Nom

Texte

30

 

Post_nom

Texte

30

 

Prénom

Texte

30

 

Sexe

Texte

2

 

Promotion

Texte

30

 

Vacation

Texte

30

 

T_DEPARTEMENT

Id_departement

Texte

8

Clé primaire

Id_faculté

Texte

8

Clé étrangère

Désignation

Texte

30

 

Nbre_Promotion

Numérique

25

 

T_PROMOTION

Id_promotion

Texte

8

Clé primaire

Intitulé_promotion

Texte

30

 

T_APPARTENIR

Id_promotion

Texte

8

Clé étrangère

Id_département

Texte

8

Clé étrangère

T_FACULTE

Id_faculté

Texte

8

Clé primaire

Intitulé_faculté

Texte

30

 

Nbre_département

Numérique

 
 

III.2. IMPLEMENTATION DU NOUVEAU SYSTEME

a. CHOIX DU LANGAGE DE PROGRAMMATION

Le travail est bel et bien fait avec un langage de programmation. Celui-ci est choisie en fonction de l'expérience que nous avons sur ce.

En rapport avec notre travail, nous avons opté le langage «Visual C# » ou encore C-Sharp. Ce langage nous a permis à faire toute cette application sans faire appel à d'autre. Avec Visual studio 2012, nous éditons les applications en langage de programmation Visual C#. Et voici sa représentation logique :

b. CHOIX DU SYSTEME DE GESTION DES BASES DES DONNEES

Comme toute application de gestion a besoin des données qui doivent être en permanence, afin de permettre leurs manipulation (ajout, suppression, modification et mis à jours). Par-là, il faut un logiciel qui peut permettre ce qui vient d'être dit précédemment. Ce logiciel serait alors mis dans la disposition de l'entreprise pour cette manipulation. En rapport avec ce travail, j'ai pris un SGBD le plus simple à manipuler et qui ne pas complexe à sa mise en travail, c'est le système Windows Microsoft Office Professional plus 2010 ACCES qui en a fait objet.

c. PRESENTATION DE LA BASE DES DONNEES (BDD)

Nous savons que du reste, la base des données est dite « outil des stockages » qui peut contenir plusieurs tables selon que l'entreprise en voudra le nombre. Ici, la base des données a cinq (5) tables qui permettent à l'entreprise de travailler indépendamment du ou des poste(s) entre eux.

d. Présentation des formulaires

e. PRESENTATION DES CODES SOURCES

1. AUTHENTIFICATION

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Data.OleDb;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

using System.Windows.Forms;

namespace GESTION_DES_INSCRIPTIONS

{

publicpartialclassForm3 : Form

{

public Form3()

{

InitializeComponent();

}

string motdepasse;

publicvoid affichermotdepasse()

{

try

{

string germain = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\APPLICATION GERMAIN\BDDGERMAIN.accdb";

OleDbConnection connexion = newOleDbConnection(germain);

OleDbCommand cmd = newOleDbCommand();

cmd.Connection = connexion;

cmd.CommandText = ("Select Mot_de_Passe From SECURITE Where Nom_Utilisateur='" + textBox1.Text.Replace("'", "''") + "'and Type_Utilisateur='" +textBox2.Text.Replace("'", "''") + "'");

connexion.Open();

OleDbDataReader rd = cmd.ExecuteReader();

while (rd.Read())

{

motdepasse = rd[0].ToString();

}

connexion.Close();

}

catch (Exception)

{ }

}

privatevoid button1_Click(object sender, EventArgs e)

{

string germain = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\APPLICATION GERMAIN\BDDGERMAIN.accdb";

OleDbConnection connexion = newOleDbConnection(germain);

DialogResult question = MessageBox.Show("Etes vous sûre d'enregistrer l'utilisateur ou l'administrateur " + textBox1.Text + " dans votre base?", "CONFIRMATION D'AJOUT", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

if (question == DialogResult.Yes)

{

OleDbCommand commande = newOleDbCommand(" insert into SECURITE values ('" + textBox1.Text + "','" +textBox2.Text + "','" + textBox3.Text + "')", connexion);

connexion.Open();

commande.ExecuteNonQuery();

connexion.Close();

MessageBox.Show(" L'utilisateur " + textBox1.Text + " est enregistré Avec Succès", "Enregistrer", MessageBoxButtons.OK, MessageBoxIcon.Information);

textBox1.Clear();

textBox2.Clear();

textBox3.Clear();

}

}

privatevoid button2_Click(object sender, EventArgs e)

{

affichermotdepasse();

string mdp = textBox3.Text;

if (mdp == motdepasse)

{

Form4 fr = newForm4(); fr.Show(); this.Hide();

}

else

{

MessageBox.Show("Les données sont érronnées, Svp révérifiez la cohérence des données");

textBox3.Text = "";

textBox3.Focus();

}

}

privatevoid button3_Click(object sender, EventArgs e)

{

DialogResult rep = MessageBox.Show("Voulez-vous vraiment sortir de cette application?", "Quitter", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

if (rep == DialogResult.Yes)

Application.Exit();

}

privatevoid checkBox1_CheckedChanged(object sender, EventArgs e)

{

if (checkBox1.Checked == false)

textBox3.UseSystemPasswordChar = true;

else

textBox3.UseSystemPasswordChar = false;

}

}

}

2. Ajout, suppression, modification et recherche

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Data.OleDb;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

using System.Windows.Forms;

namespace GESTION_DES_INSCRIPTIONS

{

publicpartialclassForm4 : Form

{

public Form4()

{

InitializeComponent();

}

privatevoid Form4_Load(object sender, EventArgs e)

{

// TODO: cette ligne de code charge les données dans la table 'bDDGERMAINDataSet3.FACULTE'. Vous pouvez la déplacer ou la supprimer selon vos besoins.

this.fACULTETableAdapter.Fill(this.bDDGERMAINDataSet3.FACULTE);

// TODO: cette ligne de code charge les données dans la table 'bDDGERMAINDataSet2.PROMOTION'. Vous pouvez la déplacer ou la supprimer selon vos besoins.

this.pROMOTIONTableAdapter.Fill(this.bDDGERMAINDataSet2.PROMOTION);

// TODO: cette ligne de code charge les données dans la table 'bDDGERMAINDataSet1.DEPARTEMENT'. Vous pouvez la déplacer ou la supprimer selon vos besoins.

this.dEPARTEMENTTableAdapter.Fill(this.bDDGERMAINDataSet1.DEPARTEMENT);

// TODO: cette ligne de code charge les données dans la table 'bDDGERMAINDataSet.CANDIDAT'. Vous pouvez la déplacer ou la supprimer selon vos besoins.

this.cANDIDATTableAdapter.Fill(this.bDDGERMAINDataSet.CANDIDAT);

}

privatevoid button1_Click(object sender, EventArgs e)

{

try

{

string germain = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\APPLICATION GERMAIN\BDDGERMAIN.accdb";

OleDbConnection con = newOleDbConnection(germain);

OleDbCommand cmd = newOleDbCommand("insert into CANDIDAT values('" + textBox1.Text + "','" + textBox2.Text + "','" + textBox3.Text + "','" + textBox4.Text + "','" + textBox5.Text + "','" + comboBox1.Text + "','" + textBox6.Text + "','" + textBox7.Text + "')", con);

con.Open();

OleDbDataReader dr = cmd.ExecuteReader();

con.Close();

this.cANDIDATTableAdapter.Fill(this.bDDGERMAINDataSet.CANDIDAT);

MessageBox.Show("Enregisrement du candidat " + textBox3.Text + " a reussi avec succès!!!", "Gestion des inscriptions");

textBox1.Clear();

textBox2.Clear();

textBox3.Clear();

textBox4.Clear();

textBox5.Clear();

textBox6.Clear();

textBox7.Clear();

textBox1.Focus();

}

catch (Exception)

{

MessageBox.Show("L'enregistrement est biaisé", " Erreur", MessageBoxButtons.OK, MessageBoxIcon.Error);

}

}

privatevoid button2_Click(object sender, EventArgs e)

{

try

{

string germain = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\APPLICATION GERMAIN\BDDGERMAIN.accdb";

OleDbConnection con = newOleDbConnection(germain);

OleDbCommand cmd = newOleDbCommand("delete from CANDIDAT WHERE MATRICULE_ETUDIANT='" + textBox1.Text + "'", con);

con.Open();

OleDbDataReader dr = cmd.ExecuteReader();

con.Close();

this.cANDIDATTableAdapter.Fill(this.bDDGERMAINDataSet.CANDIDAT);

MessageBox.Show("la supresssion du candidat " + textBox1.Text + " est faite avec succès!!!", "Gestion des inscriptions");

textBox1.Clear();

textBox2.Clear();

textBox3.Clear();

textBox4.Clear();

textBox5.Clear();

textBox6.Clear();

textBox7.Clear();

textBox1.Focus();

}

catch (Exception)

{

MessageBox.Show("La suppression dans la base de bonnées a échoué", " Erreur", MessageBoxButtons.OK, MessageBoxIcon.Error);

}

}

privatevoid button3_Click(object sender, EventArgs e)

{

try

{

string germain = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\APPLICATION GERMAIN\BDDGERMAIN.accdb";

OleDbConnection con = newOleDbConnection(germain);

OleDbCommand commande = newOleDbCommand("update CANDIDAT set MATRICULE_ETUDIANT='" + textBox1.Text + "',ID_PROMOTION='" + textBox2.Text + "',NOM='" + textBox3.Text + "' ,POST_NOM='" + textBox4.Text + "',PRENOM='" + textBox5.Text + "',SEXE='" + comboBox1.Text + "',PROMOTION='" + textBox6.Text + "',VACATION='" + textBox7.Text + "' where MATRICULE_ETUDIANT='" + textBox1.Text + "'", con);

con.Open();

commande.ExecuteNonQuery();

con.Close();

this.cANDIDATTableAdapter.Fill(this.bDDGERMAINDataSet.CANDIDAT);

MessageBox.Show("la modification des informations du candidat " + textBox1.Text + " a reussi!!!", "Gestion des inscriptions");

}

catch (Exception)

{

MessageBox.Show("La modification dans la base de bonnées a échoué", " Erreur", MessageBoxButtons.OK, MessageBoxIcon.Error);

}

}

privatevoid button4_Click(object sender, EventArgs e)

{

try

{

string germain = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\APPLICATION GERMAIN\BDDGERMAIN.accdb";

OleDbConnection con = newOleDbConnection(germain);

OleDbCommand cmd = newOleDbCommand();

cmd.Connection = con;

OleDbDataReader rech;

cmd.CommandText = " select * from CANDIDAT Where MATRICULE_ETUDIANT ='" + textBox1.Text + "'";

con.Open();

rech = cmd.ExecuteReader();

if (rech.Read())

{

textBox1.Text = rech[0].ToString();

textBox2.Text = rech[1].ToString();

textBox3.Text = rech[2].ToString();

textBox4.Text = rech[3].ToString();

textBox5.Text = rech[4].ToString();

comboBox1.Text = rech[5].ToString();

textBox6.Text = rech[6].ToString();

textBox7.Text = rech[7].ToString();

}

con.Close();

this.cANDIDATTableAdapter.Fill(this.bDDGERMAINDataSet.CANDIDAT);

}

catch

{

MessageBox.Show("L'erreur de la recherche");

textBox1.Clear();

textBox2.Clear();

textBox3.Clear();

textBox4.Clear();

textBox5.Clear();

textBox6.Clear();

textBox7.Clear();

textBox1.Focus();

}

}

privatevoid button8_Click(object sender, EventArgs e)

{

try

{

string germain = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\APPLICATION GERMAIN\BDDGERMAIN.accdb";

OleDbConnection con = newOleDbConnection(germain);

OleDbCommand cmd = newOleDbCommand("insert into DEPARTEMENT values('" + textBox8.Text + "','" + textBox9.Text + "','" + textBox10.Text + "','" + textBox11.Text + "')", con);

con.Open();

OleDbDataReader dr = cmd.ExecuteReader();

con.Close();

this.dEPARTEMENTTableAdapter.Fill(this.bDDGERMAINDataSet1.DEPARTEMENT);

MessageBox.Show("Enregisrement du département " + textBox10.Text + " a reussi avec succès!!!", "Gestion des inscriptions");

textBox8.Clear();

textBox9.Clear();

textBox10.Clear();

textBox11.Clear();

textBox8.Focus();

}

catch (Exception)

{

MessageBox.Show("L'enregistrement est biaisé", " Erreur", MessageBoxButtons.OK, MessageBoxIcon.Error);

}

}

privatevoid button7_Click(object sender, EventArgs e)

{

try

{

string germain = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\APPLICATION GERMAIN\BDDGERMAIN.accdb";

OleDbConnection con = newOleDbConnection(germain);

OleDbCommand cmd = newOleDbCommand("delete from DEPARTEMENT WHERE ID_DEPARTEMENT='" + textBox8.Text + "'", con);

con.Open();

OleDbDataReader dr = cmd.ExecuteReader();

con.Close();

this.dEPARTEMENTTableAdapter.Fill(this.bDDGERMAINDataSet1.DEPARTEMENT);

MessageBox.Show("la supresssion du département " + textBox10.Text + " est faite avec succès!!!", "Gestion des inscriptions");

textBox8.Clear();

textBox9.Clear();

textBox10.Clear();

textBox11.Clear();

textBox8.Focus();

}

catch (Exception)

{

MessageBox.Show("La suppression dans la base de bonnées a échoué", " Erreur", MessageBoxButtons.OK, MessageBoxIcon.Error);

}

}

privatevoid button6_Click(object sender, EventArgs e)

{

try

{

string germain = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\APPLICATION GERMAIN\BDDGERMAIN.accdb";

OleDbConnection con = newOleDbConnection(germain);

OleDbCommand commande = newOleDbCommand("update DEPARTEMENT set ID_DEPARTEMENT='" + textBox8.Text + "',ID_FACULTE='" + textBox9.Text + "',DESIGNATION='" + textBox10.Text + "' ,NBRE_PROMOTION='" + textBox11.Text + "' where ID_DEPARTEMENT='" + textBox8.Text + "'", con);

con.Open();

commande.ExecuteNonQuery();

con.Close();

this.dEPARTEMENTTableAdapter.Fill(this.bDDGERMAINDataSet1.DEPARTEMENT);

MessageBox.Show("la modification des informations du candidat " + textBox1.Text + " a reussi!!!", "Gestion des inscriptions");

}

catch (Exception)

{

MessageBox.Show("La modification dans la base de bonnées a échoué", " Erreur", MessageBoxButtons.OK, MessageBoxIcon.Error);

}

}

privatevoid button5_Click(object sender, EventArgs e)

{

try

{

string germain = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\APPLICATION GERMAIN\BDDGERMAIN.accdb";

OleDbConnection con = newOleDbConnection(germain);

OleDbCommand cmd = newOleDbCommand();

cmd.Connection = con;

OleDbDataReader rech;

cmd.CommandText = " select * from DEPARTEMENT Where ID_DEPARTEMENT ='" + textBox8.Text + "'";

con.Open();

rech = cmd.ExecuteReader();

if (rech.Read())

{

textBox8.Text = rech[0].ToString();

textBox9.Text = rech[1].ToString();

textBox10.Text = rech[2].ToString();

textBox11.Text = rech[3].ToString();

}

con.Close();

this.dEPARTEMENTTableAdapter.Fill(this.bDDGERMAINDataSet1.DEPARTEMENT);

}

catch

{

MessageBox.Show("L'erreur de la recherche");

textBox8.Clear();

textBox9.Clear();

textBox10.Clear();

textBox11.Clear();

}

}

privatevoid button12_Click(object sender, EventArgs e)

{

try

{

string germain = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\APPLICATION GERMAIN\BDDGERMAIN.accdb";

OleDbConnection con = newOleDbConnection(germain);

OleDbCommand cmd = newOleDbCommand("insert into PROMOTION values('" + textBox12.Text + "','" + textBox13.Text + "')", con);

con.Open();

OleDbDataReader dr = cmd.ExecuteReader();

con.Close();

this.pROMOTIONTableAdapter.Fill(this.bDDGERMAINDataSet2.PROMOTION);

MessageBox.Show("Enregisrement de la promotion " + textBox13.Text + " a reussi avec succès!!!", "Gestion des inscriptions");

textBox12.Clear();

textBox13.Clear();

textBox12.Focus();

}

catch (Exception)

{

MessageBox.Show("L'enregistrement est biaisé", " Erreur", MessageBoxButtons.OK, MessageBoxIcon.Error);

}

}

privatevoid button11_Click(object sender, EventArgs e)

{

try

{

string germain = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\APPLICATION GERMAIN\BDDGERMAIN.accdb";

OleDbConnection con = newOleDbConnection(germain);

OleDbCommand cmd = newOleDbCommand("delete from PROMOTION WHERE ID_PROMOTION='" + textBox12.Text + "'", con);

con.Open();

OleDbDataReader dr = cmd.ExecuteReader();

con.Close();

this.pROMOTIONTableAdapter.Fill(this.bDDGERMAINDataSet2.PROMOTION);

MessageBox.Show("la supresssion de la promotion " + textBox13.Text + " est faite avec succès!!!", "Gestion des inscriptions");

textBox12.Clear();

textBox13.Clear();

textBox12.Focus();

}

catch (Exception)

{

MessageBox.Show("La suppression dans la base de bonnées a échoué", " Erreur", MessageBoxButtons.OK, MessageBoxIcon.Error);

}

}

privatevoid button10_Click(object sender, EventArgs e)

{

try

{

string germain = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\APPLICATION GERMAIN\BDDGERMAIN.accdb";

OleDbConnection con = newOleDbConnection(germain);

OleDbCommand commande = newOleDbCommand("update PROMOTION set ID_PROMOTION='" + textBox12.Text + "',INTITULE_PROMOTION='" + textBox13.Text + "'where ID_PROMOTION='" + textBox12.Text + "'", con);

con.Open();

commande.ExecuteNonQuery();

con.Close();

this.pROMOTIONTableAdapter.Fill(this.bDDGERMAINDataSet2.PROMOTION);

MessageBox.Show("la modification des informations de la promotion " + textBox13.Text + " a reussi!!!", "Gestion des inscriptions");

}

catch (Exception)

{

MessageBox.Show("La modification dans la base de bonnées a échoué", " Erreur", MessageBoxButtons.OK, MessageBoxIcon.Error);

}

}

privatevoid button9_Click(object sender, EventArgs e)

{

try

{

string germain = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\APPLICATION GERMAIN\BDDGERMAIN.accdb";

OleDbConnection con = newOleDbConnection(germain);

OleDbCommand cmd = newOleDbCommand();

cmd.Connection = con;

OleDbDataReader rech;

cmd.CommandText = " select * from PROMOTION Where ID_PROMOTION ='" + textBox12.Text + "'";

con.Open();

rech = cmd.ExecuteReader();

if (rech.Read())

{

textBox12.Text = rech[0].ToString();

textBox13.Text = rech[1].ToString();

}

con.Close();

this.pROMOTIONTableAdapter.Fill(this.bDDGERMAINDataSet2.PROMOTION);

}

catch

{

MessageBox.Show("L'erreur de la recherche");

textBox12.Clear();

textBox13.Clear();

textBox13.Focus();

}

}

privatevoid button13_Click(object sender, EventArgs e)

{

try

{

string germain = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\APPLICATION GERMAIN\BDDGERMAIN.accdb";

OleDbConnection con = newOleDbConnection(germain);

OleDbCommand cmd = newOleDbCommand();

cmd.Connection = con;

OleDbDataReader rech;

cmd.CommandText = " select * from FACULTE Where ID_FACULTE ='" + textBox14.Text + "'";

con.Open();

rech = cmd.ExecuteReader();

if (rech.Read())

{

textBox14.Text = rech[0].ToString();

textBox15.Text = rech[1].ToString();

textBox16.Text = rech[2].ToString();

}

con.Close();

this.fACULTETableAdapter.Fill(this.bDDGERMAINDataSet3.FACULTE);

}

catch

{

MessageBox.Show("L'erreur de la recherche");

textBox14.Clear();

textBox15.Clear();

textBox16.Clear();

textBox14.Focus();

}

}

privatevoid button14_Click(object sender, EventArgs e)

{

try

{

string germain = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\APPLICATION GERMAIN\BDDGERMAIN.accdb";

OleDbConnection con = newOleDbConnection(germain);

OleDbCommand commande = newOleDbCommand("update FACULTE set ID_FACULTE='" + textBox14.Text + "',INTITULE_FACULTE='" + textBox15.Text + "',NBRE_DEPARTEMENT='" + textBox16.Text + "'where ID_FACULTE='" + textBox14.Text + "'", con);

con.Open();

commande.ExecuteNonQuery();

con.Close();

this.fACULTETableAdapter.Fill(this.bDDGERMAINDataSet3.FACULTE);

MessageBox.Show("la modification des informations de la faculté" + textBox15.Text + " a reussi!!!", "Gestion des inscriptions");

}

catch (Exception)

{

MessageBox.Show("La modification dans la base de bonnées a échoué", " Erreur", MessageBoxButtons.OK, MessageBoxIcon.Error);

}

}

privatevoid button15_Click(object sender, EventArgs e)

{

try

{

string germain = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\APPLICATION GERMAIN\BDDGERMAIN.accdb";

OleDbConnection con = newOleDbConnection(germain);

OleDbCommand cmd = newOleDbCommand("delete from FACULTE WHERE ID_FACULTE='" + textBox14.Text + "'", con);

con.Open();

OleDbDataReader dr = cmd.ExecuteReader();

con.Close();

this.fACULTETableAdapter.Fill(this.bDDGERMAINDataSet3.FACULTE);

MessageBox.Show("la supresssion de la faculté " + textBox15.Text + " est faite avec succès!!!", "Gestion des inscriptions");

textBox14.Clear();

textBox15.Clear();

textBox16.Clear();

textBox14.Focus();

}

catch (Exception)

{

MessageBox.Show("La suppression dans la base de bonnées a échoué", " Erreur", MessageBoxButtons.OK, MessageBoxIcon.Error);

}

}

privatevoid button16_Click(object sender, EventArgs e)

{

try

{

string germain = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\APPLICATION GERMAIN\BDDGERMAIN.accdb";

OleDbConnection con = newOleDbConnection(germain);

OleDbCommand cmd = newOleDbCommand("insert into FACULTE values('" + textBox14.Text + "','" + textBox15.Text + "','" + textBox16.Text + "')", con);

con.Open();

OleDbDataReader dr = cmd.ExecuteReader();

con.Close();

this.fACULTETableAdapter.Fill(this.bDDGERMAINDataSet3.FACULTE);

MessageBox.Show("Enregisrement de la faculté " + textBox13.Text + " a reussi avec succès!!!", "Gestion des inscriptions");

textBox14.Clear();

textBox15.Clear();

textBox16.Clear();

textBox14.Focus();

}

catch (Exception)

{

MessageBox.Show("L'enregistrement est biaisé", " Erreur", MessageBoxButtons.OK, MessageBoxIcon.Error);

}

}

privatevoid label18_Click(object sender, EventArgs e)

{

DialogResult rep = MessageBox.Show("Voulez-vous vraiment sortir de cette application?", "Quitter", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

if (rep == DialogResult.Yes)

Application.Exit();

}

}

}

* 37 ETSHIKO F., Note de cours de méthode d'analyse informatique, UPKAN, 2020-2021, Inédit,

* 38 ETSHIKO F., Note de cours de méthode d'analyse informatique, UPKAN, 2020-2021, Inédit,

* 39Idem

précédent sommaire suivant






Bitcoin is a swarm of cyber hornets serving the goddess of wisdom, feeding on the fire of truth, exponentially growing ever smarter, faster, and stronger behind a wall of encrypted energy








"Un démenti, si pauvre qu'il soit, rassure les sots et déroute les incrédules"   Talleyrand