IV.3 IMPLEMENTATION
IV.3.1 INTERFACE
Formulaire du démarrage de
l'application

Fig. IV.8. Formulaire d'accueil
Formulaire d'identification
Ce formulaire nous permet de s'y identifiée et
accéder dans notre logiciel

Fig. IV.9 formulaire
d'authentification.
60
|
MISE EN PLACE D'UN SYSTEME DECISIONNEL BASE SUR LE DATA MART ET
L'ARBRE DE DECISION POUR LE RECRUTEMENT DU PERSONNEL A LA DGR KOC
|
Voici le code source pour ce formulaire
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace Application_huguette
{
public partial class Authentification : Form {
public Authentification() {
InitializeComponent();
}
private void Authentification_Load(object sender, EventArgs e)
{
// TODO : cette ligne de code charge les données dans
la table 'hugaplayDataSet3.UTILISATEUR'. Vous pouvez la déplacer ou la
supprimer selon vos besoins.
this.uTILISATEURTableAdapter1.Fill(this.hugaplayDataSet3.UTILISATEUR);
}
private void button1_Click(object sender, EventArgs e)
{
Form form = null;
Form Form1 = new Principal();
form = Form1;
form.Show();
this.Hide();
}
private void button3_Click(object sender, EventArgs e)
{
Application.Exit();
}
private void button2_Click(object sender, EventArgs e)
Mémoire MANKAMBA YANKUMBA Jean Luc UKA 2015 - 2016
61
MISE EN PLACE D'UN SYSTEME DECISIONNEL BASE SUR LE DATA MART ET
L'ARBRE DE DECISION POUR LE RECRUTEMENT DU PERSONNEL A LA DGR KOC
{
comboBox1.Text = ""; textBox1 .Text = ""; comboBox1.Focus();
}
private void groupBox1_Enter(object sender, EventArgs e) {
}
}
}
Mémoire MANKAMBA YANKUMBA Jean Luc UKA 2015 - 2016
Formulaire principal permettent de choisir
l'opération à effectuer

Fig. IV.10 formulaire principal
62
|
MISE EN PLACE D'UN SYSTEME DECISIONNEL BASE SUR LE DATA MART ET
L'ARBRE DE DECISION POUR LE RECRUTEMENT DU PERSONNEL A LA DGR KOC
|
Voici le code source pour ce formulaire
namespace Application_huguette
{
public partial class Principal : Form
{
public Principal()
{
InitializeComponent();
}
private void créationDoffreToolStripMenuItem_Click(object
sender, EventArgs
e)
{
Form form = null;
Form Form1 = new Gestion_application ();
form = Form1;
form.Show();
this.Hide();
}
private void
créationDunServiceToolStripMenuItem_Click(object sender,
EventArgs e)
{
Form form = null;
Form Form1 = new Gestion_application();
form = Form1;
form.Show();
this.Hide();
}
private void postulationToolStripMenuItem_Click(object sender,
EventArgs e)
{
Form form = null;
Form Form1 = new POSTULATION ();
form = Form1;
form.Show();
this.Hide();
}
private void lISTEDOFFRESToolStripMenuItem_Click(object
sender,
EventArgs e)
{
Form form = null;
Mémoire MANKAMBA YANKUMBA Jean Luc UKA 2015 - 2016
63
|
MISE EN PLACE D'UN SYSTEME DECISIONNEL BASE SUR LE DATA MART ET
L'ARBRE DE DECISION POUR LE RECRUTEMENT DU PERSONNEL A LA DGR KOC
|
Form Form1 = new LISTE_OFFRES ();
form = Form1;
form.Show();
this.Hide();
}
private void fERMERToolStripMenuItem_Click(object sender,
EventArgs e) {
Application.Exit();
}
}
}
Formulaire d'enregistrement du candidat et information
sur l'offre
Ce formulaire nous permet d'enregistrer le candidat postulant et
de voir aussi les informations concernant l'offre.

Fig. IV.11 formulaire de saisie.
Mémoire MANKAMBA YANKUMBA Jean Luc UKA 2015 - 2016
64
|
MISE EN PLACE D'UN SYSTEME DECISIONNEL BASE SUR LE DATA MART ET
L'ARBRE DE DECISION POUR LE RECRUTEMENT DU PERSONNEL A LA DGR KOC
|
Voici le code source pour ce formulaire et connexion
directe à la base de données :
namespace Application_huguette
{
public partial class Gestion_application : Form
{
public Gestion_application()
{
InitializeComponent();
}
Service ser = new Service();
Offre of = new Offre();
Critere cr = new Critere();
string chaine = null;
SqlConnection connex = null ;
SqlCommand requete = null;
public void connexion()
{
try
{
Chaine="Data Source=HUGUETTE-PC;Initial
Catalog=hugaplay;Integrated
Security=True";
connex = new SqlConnection(chaine);
requete = new SqlCommand();
requete.Connection = connex;
}
catch (Exception)
{
MessageBox.Show("Echec de connexion à la base de
données!");
}
}
public void initialiser()
{
txt_codeservice.Text = "";
txt_nomservice.Text = "";
txt_codeservice.Focus();
}
public void initialiser2() {
txt_numoffre.Text = ""; txt_intitule.Text = "";
txt_lieuaffectation.Text = "";
txt_nomserv.Text = "";
Mémoire MANKAMBA YANKUMBA Jean Luc UKA 2015 - 2016
65
|
MISE EN PLACE D'UN SYSTEME DECISIONNEL BASE SUR LE DATA MART ET
L'ARBRE DE DECISION POUR LE RECRUTEMENT DU PERSONNEL A LA DGR KOC
|
cmb_codeservice.Text = ""; txt_numoffre.Focus();
}
private void groupBox3_Enter(object sender, EventArgs e) {
}
private void groupBox4_Enter(object sender, EventArgs e) {
}
private void button8_Click(object sender, EventArgs e) {
listBox1.Items.Add(txt_critere.Text);
cr.Numerocritere = maxcritere.ToString();
cr.Nomcritere = txt_critere.Text;
cr.Numoffre = txt_numoffre.Text;
connexion();
requete.CommandText = "insert into CRITERES values('" +
cr.Numerocritere
+ "', '" + cr.Nomcritere + "', '" + cr.Numoffre + "') ";
connex.Open();
requete.ExecuteNonQuery();
connex.Close();
MessageBox.Show("Enregistrement effectué avec
succès!");
maxcritere += 1;
}
private void button7_Click(object sender, EventArgs e) {
initialiser();
}
private void button6_Click(object sender, EventArgs e) {
initialiser();
}
private void button1_Click(object sender, EventArgs e)
{
ser.Codeservice = txt_codeservice.Text; ser.Nomservice =
txt_nomservice.Text;
Mémoire MANKAMBA YANKUMBA Jean Luc UKA 2015 - 2016
66
|
MISE EN PLACE D'UN SYSTEME DECISIONNEL BASE SUR LE DATA MART ET
L'ARBRE DE DECISION POUR LE RECRUTEMENT DU PERSONNEL A LA DGR KOC
|
"',
connexion();
requete.CommandText = "insert into SERVICE values('" +
ser.Codeservice +
'" + ser.Nomservice + "') ";
connex.Open();
requete.ExecuteNonQuery();
connex.Close();
MessageBox.Show("Enregistrement effectué avec
succès!");
initialiser();
}
private void button4_Click(object sender, EventArgs e) {
DialogResult res = MessageBox.Show("Vous supprimerez toutes
les informations concernant ce service dans la base de données, vous le
voulez?", "QUESTION", MessageBoxButtons.YesNo, MessageBoxIcon.Question) ;
if (res == DialogResult.Yes)
{
connexion();
requete.CommandText = "delete from OFFRE where [Code
service]='"+txt_codeservice.Text +"' ";
connex.Open();
requete.ExecuteNonQuery();
connex.Close();
connexion();
requete.CommandText = "delete from SERVICE where [Code
service]='" +
txt_codeservice.Text + "' ";
connex.Open();
requete.ExecuteNonQuery();
connex.Close();
MessageBox.Show("Suppression effectuée avec
succès!");
}
else
{
initialiser();
}
}
int maxcritere = 0;
private void Gestion_application_Load(object sender, EventArgs
e)
{
// TODO : cette ligne de code charge les données dans
la table 'hugaplayDataSet.SERVICE'. Vous pouvez la déplacer ou la
supprimer selon vos besoins.
this.sERVICETableAdapter.Fill(this.hugaplayDataSet.SERVICE);
connexion();
SqlDataReader lecture;
Mémoire MANKAMBA YANKUMBA Jean Luc UKA 2015 - 2016
67
MISE EN PLACE D'UN SYSTEME DECISIONNEL BASE SUR LE DATA MART ET
L'ARBRE DE DECISION POUR LE RECRUTEMENT DU PERSONNEL A LA DGR KOC
Mémoire MANKAMBA YANKUMBA Jean Luc UKA 2015 - 2016
requete.CommandText = "select * from CRITERES";
connex.Open();
lecture = requete.ExecuteReader();
while (lecture.Read())
{
maxcritere = int.Parse(lecture[0].ToString());
}
maxcritere += 1;
connex.Close();
}
private void button12_Click(object sender, EventArgs e)
{
Form form = null;
Form Form1 = new Principal();
form = Form1;
form.Show();
this.Hide();
}
private void button11_Click(object sender, EventArgs e)
{
initialiser2();
}
private void button3_Click(object sender, EventArgs e)
{
Form form = null;
Form Form1 = new Principal();
form = Form1;
form.Show();
this.Hide();
}
private void button10_Click(object sender, EventArgs e) {
of.Numoffre = txt_numoffre.Text;
of.Intituleoffre = txt_intitule.Text;
of.Datelancement = DateTime.Parse(dtp_datelancement.Text);
of.Datecloture = DateTime.Parse(dtp_datecloture.Text);
of.Lieuaffectation = txt_lieuaffectation.Text;
of.Codeservice = cmb_codeservice.Text;
connexion();
68
|
MISE EN PLACE D'UN SYSTEME DECISIONNEL BASE SUR LE DATA MART ET
L'ARBRE DE DECISION POUR LE RECRUTEMENT DU PERSONNEL A LA DGR KOC
|
requete.CommandText = "insert into OFFRE values('" +
of.Numoffre + "', '" +
of.Intituleoffre + "','" + of.Datelancement + "', '" +
of.Datecloture + "', '" +
of.Lieuaffectation + "', '" + of.Codeservice+ "') ";
connex.Open();
requete.ExecuteNonQuery();
connex.Close();
MessageBox.Show("Enregistrement effectué avec
succès!");
}
private void button9_Click(object sender, EventArgs e)
{
initialiser2();
}
private void txt_numoffre_TextChanged(object sender, EventArgs e)
{
}
private void groupBox1_Enter(object sender, EventArgs e) {
}
private void button5_Click(object sender, EventArgs e)
{
connexion();
SqlDataReader lecture;
requete.Connection = connex;
requete.CommandText = "select * from SERVICE where [Code
service]='" +
txt_codeservice.Text + "'";
connex.Open();
lecture = requete.ExecuteReader();
while (lecture.Read())
{
txt_codeservice.Text = lecture[0].ToString();
txt_nomservice.Text = lecture[1].ToString();
}
connex.Close();
}
private void button2_Click(object sender, EventArgs e)
Mémoire MANKAMBA YANKUMBA Jean Luc UKA 2015 - 2016
69
|
MISE EN PLACE D'UN SYSTEME DECISIONNEL BASE SUR LE DATA MART ET
L'ARBRE DE DECISION POUR LE RECRUTEMENT DU PERSONNEL A LA DGR KOC
|
{
ser.Codeservice = txt_codeservice.Text; ser.Nomservice =
txt_nomservice.Text;
connexion();
requete.CommandText = "update SERVICE set [Code service]='"
+
ser.Codeservice + "', [Nom service]='" + ser.Nomservice + "'
";
connex.Open();
requete.ExecuteNonQuery();
connex.Close();
MessageBox.Show("Enregistrement effectué avec
succès!");
initialiser();
}
}
}
|