rapport mini projet zakaria elyamni tdi22 sala aljadida
DESCRIPTION
Uploaded from Google DocsTRANSCRIPT
TSDI << Promotion 2009/2011 >>
- 1 -
Sous thème :
Elaborée par : Mr.Elyamni zakaria Mr.Naciri Yacine
Filière : Développement informatique
Promotion : 2009/2011
Encadré par : Mlle Srir Hanane
TSDI << Promotion 2009/2011 >>
- 2 -
REMERCIEMENT……………………………………………………………………………… ..
DEDICACES………………………………………………………………………………………….
presentationD’application………………………………………………………………… presentation des formulaires……………………………………………………… CODE DES BUTTON : 1-AJOUTER 2-MODIFIER 3-SUPPRIMER 4-NOUVEAU 5-RECHERCHER CODE DE COMBO BOX……………………………………………………………… CODE DE DATA GRID ……………………………………………………………… CONCLUSION……………………………………………………………………………..
TSDI << Promotion 2009/2011 >>
- 3 -
« REMERCIEMENT »
Avant de commencer la présentation de ce rapport, Je profite de cette occasion pour remercier toutes les personnes qui ont l’amabilité de m’aider de prés ou de loin à réaliser ce travail.
Je tiens à remercier en premier lieu Mme
Srir Hanane pour ses conseils et ses orientations, mes remerciements vont aussi à toute la section TSDI.
Je dédie ce modeste travail :
A ma très chère famille et à toute la section TSDI et mes amis.
TSDI << Promotion 2009/2011 >>
- 4 -
C’est avec un grand amour et une profonde reconnaissance que je dédie ce
modeste travail :
A mes très chers parents :
Pour leur grand sacrifice et leur assistance durant toute la période des études.
A ma sœur et mon frère bien aimés pour leurs encouragements.
A tous mes ami(e) s :
Vous êtes les meilleurs. Je vous souhaite d’avantage du succès
TSDI << Promotion 2009/2011 >>
- 5 -
Présentation D’application
Notre Gestion chargé de présenter les services
adéquats aux clients afin de subvenir à leurs besoins et
leurs tendances de trouver des Local dans des
meilleures conditions. Puis enregistrer chaque
propriétaire avec leur agent et chaque agent avec leur
client et enfin consulter tous les information dans une
data Grid.
TSDI << Promotion 2009/2011 >>
- 6 -
Le menu : c’est une feuille MDI permet de présenter les
différents feuilles de l’application.
= Help provider (une propriété qui permet de aide l’utilisateur)
= Shortcut Key C’est une Méthode Pour L’accès rapide A L’application
Cet formulaire permet de choisir le traitement que vous voulez mais en remarqua que les buttons client et lister sont Enabled c’est-à-dire Que vous pouvez pas le utiliser avant de enregistrer un propriétaire
TSDI << Promotion 2009/2011 >>
- 7 -
Cet formulaire permet de Saisir les informations du
Propriétaire
= buttons permet de revenir en arrière
Au pied du formulaire en remarqua q’il y a une progressebar qui permet de afficher une barre de remplissage qui indique a l’utilisateur la progression d’une opération
Remarque :
TSDI << Promotion 2009/2011 >>
- 8 -
Normalement en Zone de texte de label de ‘Num et Adresse Du Local ‘ Il faut tapez Des Chaîne de caractère mais dans notre cas l’utilisateur tape un entier alors l programme doit être Signé un Message D’erreur et Normales j ai Choisi La propriété ERORPROVIDER
Le Bouton Enregistre : permet de enregistrer les propriétaire dans un fichier
TSDI << Promotion 2009/2011 >>
- 9 -
Dim file As StreamWriter
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
ErrorProvider1.Clear()
Timer1.Start()
file = New StreamWriter("c:\propriétaire.txt", True)
If IsNumeric(TextBox1.Text) = True Then
p(i).num_pro = TextBox1.Text
Else
ErrorProvider1.SetError(TextBox1, "Il Faut Tapez Un
Nombre")
End If
If IsNumeric(TextBox2.Text) = False Then
p(i).nom = TextBox2.Text
Else
ErrorProvider1.SetError(TextBox2, "Il Faut Tapez Un
Chaine De Caractére")
End If
If IsNumeric(TextBox3.Text) = False Then
p(i).prenom = TextBox3.Text
Else
ErrorProvider1.SetError(TextBox3, "Il Faut Tapez Un
Chaine De Caractére")
End If
If IsNumeric(TextBox4.Text) = False Then
p(i).ad = TextBox4.Text
Else
ErrorProvider1.SetError(TextBox4, "Il Faut Tapez Un
Chaine De Caractére")
End If
If IsNumeric(TextBox5.Text) = True Then
p(i).tel_pre = TextBox5.Text
Else
ErrorProvider1.SetError(TextBox5, "Il Faut Tapez Un
Nombre")
End If
If IsNumeric(TextBox6.Text) = True Then
p(i).tel_pro = TextBox6.Text
Else
ErrorProvider1.SetError(TextBox6, "Il Faut Tapez Un
Nombre")
End If
If IsNumeric(TextBox7.Text) = False Then
p(i).typel = TextBox7.Text
Else
ErrorProvider1.SetError(TextBox7, "Il Faut Tapez Un
Chaine De Caractére")
End If
TSDI << Promotion 2009/2011 >>
- 10 -
If IsNumeric(TextBox8.Text) = False Then
p(i).num_adl = TextBox8.Text
Else
ErrorProvider1.SetError(TextBox8, "Il Faut Tapez Un
Chaine De Caractére")
End If
If IsNumeric(TextBox9.Text) = False Then
p(i).qua = TextBox9.Text
Else
ErrorProvider1.SetError(TextBox9, "Il Faut Tapez Un
Chaine De Caractére")
End If
If IsNumeric(TextBox10.Text) = True Then
p(i).ann_con = TextBox10.Text
Else
ErrorProvider1.SetError(TextBox10, "Il Faut Tapez Un
Nombre")
End If
If IsNumeric(TextBox11.Text) = True Then
p(i).sh = TextBox11.Text
Else
ErrorProvider1.SetError(TextBox11, "Il Faut Tapez Un
Nombre")
End If
If IsNumeric(TextBox12.Text) = True Then
p(i).st = TextBox12.Text
Else
ErrorProvider1.SetError(TextBox12, "Il Faut Tapez Un
Nombre")
End If
If IsNumeric(TextBox13.Text) = True Then
p(i).nbp = TextBox13.Text
Else
ErrorProvider1.SetError(TextBox13, "Il Faut Tapez Un
Nombre")
End If
If IsNumeric(TextBox14.Text) = True Then
p(i).nb_etag = TextBox14.Text
Else
ErrorProvider1.SetError(TextBox14, "Il Faut Tapez Un
Nombre")
End If
If IsNumeric(TextBox15.Text) = True Then
p(i).gua = TextBox15.Text
Else
ErrorProvider1.SetError(TextBox15, "Il Faut Tapez Un
Nombre")
TSDI << Promotion 2009/2011 >>
- 11 -
End If
p(i).statue = RadioButton1.Text
p(i).statue1 = RadioButton2.Text
file.Write(p(i).num_pro)
file.Write(";")
file.Write(p(i).nom)
file.Write(";")
file.Write(p(i).prenom)
file.Write(";")
file.Write(p(i).ad)
file.Write(";")
file.Write(p(i).tel_pre)
file.Write(";")
file.Write(p(i).tel_pro)
file.Write(";")
file.Write(p(i).typel)
file.Write(";")
file.Write(p(i).num_adl)
file.Write(";")
file.Write(p(i).qua)
file.Write(";")
file.Write(p(i).ann_con)
file.Write(";")
file.Write(p(i).sh)
file.Write(";")
file.Write(p(i).st)
file.Write(";")
file.Write(p(i).nbp)
file.Write(";")
file.Write(p(i).nb_etag)
file.Write(";")
If RadioButton1.Checked = True Then
file.Write(p(i).statue)
Else
file.Write(p(i).statue1)
End If
file.Write(";")
file.WriteLine(p(i).gua)
file.Close()
i = i + 1 Le Bouton rechercher : permet rechercher les propriétaire selon Votre Numéro dans un fichier Private Sub Button3_Click(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles Button3.Click
rech = New StreamReader("c:\propriétaire.txt")
x = InputBox("Entrez Le Nom du ProPriéTaire Que Vous Voulez
TSDI << Promotion 2009/2011 >>
- 12 -
RecHercHer")
cond = False
Do Until rech.EndOfStream
ligne = rech.ReadLine
tab = ligne.Split(";")
If tab(0) = x Then
cond = True
Exit Do
End If
Loop
If cond = True Then
TextBox1.Text = tab(0)
TextBox2.Text = tab(1)
TextBox3.Text = tab(2)
TextBox4.Text = tab(3)
TextBox5.Text = tab(4)
TextBox6.Text = tab(5)
TextBox7.Text = tab(6)
TextBox8.Text = tab(7)
TextBox9.Text = tab(8)
TextBox10.Text = tab(9)
TextBox11.Text = tab(10)
TextBox12.Text = tab(11)
TextBox13.Text = tab(12)
TextBox14.Text = tab(13)
If RadioButton1.Text = tab(14) Then
RadioButton1.Checked = True
Else
RadioButton2.Checked = True
End If
TextBox15.Text = tab(15)
Else
If MsgBox("Aucun Propritaire trouvé...tu veux le
enregistrer!!!", MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
TextBox1.Text = x
TextBox2.Clear()
TextBox3.Clear()
TextBox5.Clear()
TextBox4.Clear()
TextBox6.Clear()
TextBox7.Clear()
TextBox8.Clear()
TextBox9.Clear()
TextBox10.Clear()
TextBox11.Clear()
TextBox12.Clear()
TextBox13.Clear()
TSDI << Promotion 2009/2011 >>
- 13 -
TextBox14.Clear()
TextBox15.Clear()
rech.Close()
End If
End If
rech.Close()
End Sub Le Bouton Supprimer : permet de Supprimer les propriétaire dans u fichier Private Sub Button6_Click(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles Button6.Click
sup = New StreamReader("c:\propriétaire.txt")
file = New StreamWriter("c:\prop.txt", True)
x = InputBox("Entrez Le Nombre De Propriétair Que Vous
Voulez Supprimmer")
Do Until sup.EndOfStream
ligne = sup.ReadLine
tab = ligne.Split(";")
If tab(0) <> x Then
file.WriteLine(ligne)
End If
Loop
sup.Close()
file.Close()
Kill("c:\propriétaire.txt")
Rename("c:\prop.txt", "c:\propriétaire.txt")
TextBox1.Clear()
TextBox2.Clear()
TextBox3.Clear()
TextBox4.Clear()
TextBox5.Clear()
TextBox6.Clear()
TextBox7.Clear()
TextBox8.Clear()
TextBox9.Clear()
TextBox10.Clear()
TextBox11.Clear()
TextBox12.Clear()
TextBox13.Clear()
TextBox14.Clear()
TextBox15.Clear()
End Sub Le Bouton modifier : permet de modifier les propriétaire dans un fichier mais après un recherche
TSDI << Promotion 2009/2011 >>
- 14 -
sup = New StreamReader("c:\propriétaire.txt")
file2 = New StreamWriter("c:\prop.txt", True)
x = TextBox1.Text
Do Until sup.EndOfStream
ligne = sup.ReadLine
tab = ligne.Split(";")
If tab(0) <> x Then
file2.WriteLine(ligne)
End If
Loop
p(i).num_pro = TextBox1.Text
p(i).nom = TextBox2.Text
p(i).prenom = TextBox3.Text
p(i).ad = TextBox4.Text
p(i).tel_pre = TextBox5.Text
p(i).tel_pro = TextBox6.Text
p(i).typel = TextBox7.Text
p(i).num_adl = TextBox8.Text
p(i).qua = TextBox9.Text
p(i).ann_con = TextBox10.Text
p(i).sh = TextBox11.Text
p(i).st = TextBox12.Text
p(i).nbp = TextBox13.Text
p(i).nb_etag = TextBox14.Text
p(i).gua = TextBox15.Text
p(i).statue = RadioButton1.Text
p(i).statue1 = RadioButton2.Text
file2.Write(p(i).num_pro)
file2.Write(";")
file2.Write(p(i).nom)
file2.Write(";")
file2.Write(p(i).prenom)
file2.Write(";")
file2.Write(p(i).ad)
file2.Write(";")
file2.Write(p(i).tel_pre)
file2.Write(";")
file2.Write(p(i).tel_pro)
file2.Write(";")
file2.Write(p(i).typel)
file2.Write(";")
file2.Write(p(i).num_adl)
file2.Write(";")
file2.Write(p(i).qua)
file2.Write(";")
file2.Write(p(i).ann_con)
file2.Write(";")
file2.Write(p(i).sh)
TSDI << Promotion 2009/2011 >>
- 15 -
file2.Write(";")
file2.Write(p(i).st)
file2.Write(";")
file2.Write(p(i).nbp)
file2.Write(";")
file2.Write(p(i).nb_etag)
file2.Write(";")
If RadioButton1.Checked = True Then
file2.Write(p(i).statue)
Else
file2.Write(p(i).statue1)
End If
file2.Write(";")
file2.WriteLine(p(i).gua)
sup.Close()
file2.Close()
Kill("c:\propriétaire.txt")
Rename("c:\prop.txt", "c:\propriétaire.txt")
i = i + 1
End Sub Le Bouton Nouveau : permet de Vider les champ Private Sub Button1_Click(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles Button1.Click
ErrorProvider1.Clear()
TextBox1.Clear()
TextBox2.Clear()
TextBox3.Clear()
TextBox4.Clear()
TextBox5.Clear()
TextBox6.Clear()
TextBox7.Clear()
TextBox8.Clear()
TextBox9.Clear()
TextBox10.Clear()
TextBox11.Clear()
TextBox12.Clear()
TextBox13.Clear()
TextBox14.Clear()
TextBox15.Clear()
End Sub Le Bouton Mondater : permet de afficher la formulaire Agent
TSDI << Promotion 2009/2011 >>
- 16 -
Cet formulaire permet de Saisir les informations d’Agent
Combo box : permet de lister les nom de propriétaire en charge de la formulaire et pour cela en tape le code en FORM_LOAD
Private Sub Form4_Load(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles MyBase.Load
ajou = New StreamReader("c:\propriétaire.txt")
Do Until ajou.EndOfStream
ligne = ajou.ReadLine
tab = ligne.Split(";")
ComboBox1.Items.Add(tab(1))
Loop End Sub
Remarque :
Les buttons (rechercher, modifier, supprimer, nouveau) sont les même donc c’est pas la peine de répéter le code des formulaire
TSDI << Promotion 2009/2011 >>
- 17 -
Cet formulaire permet de Saisir les informations d’u client
Combo box : permet de lister les nom de propriétaire en charge de la formulaire et pour cela en tape le code en FORM_LOAD
ajou = New StreamReader("c:\agent.txt")
Do Until ajou.EndOfStream
ligne = ajou.ReadLine
tab = ligne.Split(";")
ComboBox1.Items.Add(tab(1))
Loop
ajou.Close() Combo box : quand en choisie un nom il faut automatiquement Remplir les information de ce agent et l code de cette partie c’est : afii = New StreamReader("c:\propriétaire.txt")
afi = New StreamReader("c:\agent.txt")
TSDI << Promotion 2009/2011 >>
- 18 -
Do Until afi.EndOfStream
ligne = afi.ReadLine
tab = ligne.Split(";")
If tab(1) = ComboBox1.Text Then
x = tab(0)
Do Until afii.EndOfStream
ligne1 = afii.ReadLine
tab1 = ligne1.Split(";")
If tab1(1) = x Then
Label1.Text = tab1(6)
Label2.Text = tab1(7)
Label3.Text = tab1(10)
Label4.Text = tab1(11)
Label5.Text = tab1(12)
Label6.Text = tab1(14)
End If
Loop
End If
Loop
afi.Close()
afii.Close()
End Sub
Remarque :
En remarque dans notre code que j’ai ouvrir deux fichier en mode lecture car le client a une relation par l’agent et l’agent a une relation parle propriétaire et a cause de ça en ouvre deux fichier le fichier propriétaire et le fichier agent dans la premier en compare le nom d’agent avec les agent enregistrer puis en affiche les information du propriétaire qui Mondater a l’agent le local
TSDI << Promotion 2009/2011 >>
- 19 -
Cet formulaire permet de consulter les information
Data Grid : en stock les information du client et d’agent selon le code suivant : Imports System.IO
Public Class Form6
Dim i As Integer
Dim tab(100), tab1(100), tab2(100) As String
Dim s, ligne, p As String
Dim dt As DataTable
Dim dr, dr1 As DataRow
Dim c1, c4, c5, c6, c7, c8, c9, c10, c11 As DataColumn
Dim lire As StreamReader
Private Sub Form6_Load(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles MyBase.Load
lire = New StreamReader("c:\client.txt")
dt = New DataTable
c1 = New DataColumn("Nom D'agent", GetType(String))
c4 = New DataColumn("Nom Du Client", GetType(String))
c5 = New DataColumn("Prenom Du Client",
GetType(String))
c6 = New DataColumn("Type Local", GetType(String))
c7 = New DataColumn("Surface habital",
GetType(Integer))
c8 = New DataColumn("Surface Terain",
GetType(Integer))
c9 = New DataColumn("Nombre De Piéce",
GetType(Integer))
c10 = New DataColumn("Statue Local", GetType(String))
c11 = New DataColumn("Visite/Rendez-Vous",
GetType(String))
dt.Columns.Add(c1)
TSDI << Promotion 2009/2011 >>
- 20 -
dt.Columns.Add(c4)
dt.Columns.Add(c5)
dt.Columns.Add(c6)
dt.Columns.Add(c7)
dt.Columns.Add(c8)
dt.Columns.Add(c9)
dt.Columns.Add(c10)
dt.Columns.Add(c11)
Do Until lire.EndOfStream
s = lire.ReadLine
tab = s.Split(";")
dr = dt.NewRow
dr(0) = tab(0)
dr(1) = tab(1)
dr(2) = tab(2)
dr(3) = tab(7)
dr(4) = tab(9)
dr(5) = tab(10)
dr(6) = tab(11)
dr(7) = tab(12)
dr(8) = tab(6)
dt.Rows.Add(dr)
Loop
DataGridView1.DataSource = dt
lire.Close()
End Sub
TSDI << Promotion 2009/2011 >>
- 21 -
Conclusion
Nous espérons que ce projet vous satisfera et vous facilitera les tâches que vous devez accomplir.