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

 > 

Implantation d'un système informatisé pour paiement des travailleurs dans une entreprise commerciale.

( Télécharger le fichier original )
par Gilbert BILOLO
Institut supérieur de commerce - ACQUIS DE DROIT 2014
  

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.10 ECRITURES DES CODES SOURCES DES DIFFERENTS CONTROLES

On sous-entend par ce terme de codes sources, les instructions imposées dans l'éditeur de chaque contrôle pour le fonctionnement de ce dernier.

Pour ce qui est de notre application, nous ne saurons pas exposer tous nos codes sources. Pour ce faire, nous pouvons donner quelques uns.

'Déclaration dans la partie générale

Option Explicit

'déclaration de la variable qui contiendra le provider et le chemin de la B.D

Dim bd As New ADODB.Connection

'déclaration des variables qui contiendront le nom de la table

'(pour les mises à jour, la recherche et modifier les données de la recherche)

Dim tb As New ADODB.Recordset

Dim tb1 As New ADODB.Recordset

Dim tb2 As New ADODB.Recordset

Dim tb3 As New ADODB.Recordset

'déclaration de la variable qui contiendra le choix de l'utilisateur dans les

msgbox

im msg1, msg2 As String

D

Public Sub actualiser()

'procédure qui permet d'utiliser des boutons

'autre que adodc ou datacontrol, elle met à jour les textbox 'suivant l'enregistrement sur lequel on se place par le biais ' des boutons premier-dernier-précédent-suivant

'

Pour naviguer dans la B.D il faut que cette procédure

'soit appeler dans chaque bouton

'si début du fichier aller au dernier

' If IsNull(tb![Nom]) Then

' txtnom.Text = ""
' Else

txtnom = tb![nom]

' End If

'

'

beaucoup mieux

'sinon on peut mettre un "on error resume next" avant l'actualisation 'et là on écrira simplement

'txtnom = tb!nom

End Sub

45

' Pour arriver à écrire dans les zones de texte

Public Sub next__tab(keyascii As Integer)

If keyascii = vbKeyReturn Then

SendKeys "{TAB}" 'simuler le TAB

keyascii = 0 ' Supprimer le TAB lorsque le focus est arrivé

End If

nd Sub

E

rivate Sub cmdAjout__Click()

'vide les textbox pour un ajout 'et donne le focus à txtnom

Text2.Text = Text3.Text = Text4.Text = Text5.Text = Text6.Text = Text7.Text = Text8.Text =

"" "" "" "" "" "" ""

Text15.Text

=

""

Text16.Text

=

""

Text17.Text

=

""

Text18.Text

=

""

Text27.Text

=

""

Text28.Text

=

""

Text29.Text

=

""

Text30.Text

=

""

Text39.Text

=

""

Text40.Text

=

""

Text41.Text

=

""

Text42.Text

=

""

Text51.Text

=

""

Text52.Text

=

""

Text53.Text

=

""

Text54.Text

=

""

Text63.Text

=

""

Text64.Text

=

""

Text65.Text

=

""

Text66.Text

=

""

Text75.Text

=

""

Text76.Text

=

""

Text77.Text

=

""

Text78.Text

=

""

Text87.Text

=

""

Text88.Text

=

""

Text89.Text

=

""

Text90.Text

=

""

Text99.Text

=

""

Text100.Text

=

""

T ext101.Text

=

""

Text102.Text

=

""

T ext111.Text

=

""

Text112.Text

=

""

Text113.Text

=

""

T ext114.Text

=

""

Text123.Text

=

""

T ext124.Text

=

""

Text125.Text

=

""

T ext126.Text

=

""

Text135.Text

=

""

T ext136.Text

=

""

Text137.Text

=

""

T ext138.Text

=

""

Text147.Text

=

""

T ext148.Text

=

""

Text149.Text

=

""

T ext150.Text

=

""

cmdEnreg.Enabled = True cmdAjout.Enabled = False cmdRech.Enabled = False

46

cmdRech.Enabled = True

Text3.SetFocus

End Sub

P rivate Sub Command8__Click()

Form1.Show

E

nd Sub

rivate Sub Command9_Click()

Form3.Show

nd Sub

E

rivate Sub cmdannuler__Click() cmdAjout.Enabled = True cmdEnreg.Enabled = False cmdRech.Enabled = True Call actualiser

tb.MoveFirst End Sub

P rivate Sub cmdEnreg_Click()

'pour s'assurer de ne pas ajouter un enregistrement vide et une adresse

'ou un n° sans nom

If (Text3.Text = "" And Text4.Text = "" And Text5.Text = "" And Text6.Text

= "" And Text15.Text = "" And Text16.Text = "") Then

If (Text17.Text = "" And Text17.Text = "" And Text27.Text = "" And Text28.Text = "" And Text29.Text = "" And Text30.Text = "" And Text39.Text = "" And Text40.Text = "" And Text41.Text = "" And Text42.Text = "" And Text51.Text = "" And Text52.Text = "" And Text53.Text = "" And Text54.Text = "" And Text63.Text = "" And Text64.Text = "") Then

If (Text65.Text = "" And Text66.Text = "" And Text75.Text = "" And Text76.Text = "" And Text77.Text = "" And Text78.Text = "" And Text87.Text = "" And Text88.Text = "" And Text89.Text = "" And Text90.Text = "" And Text99.Text = "" And Text100.Text = "" And Text101.Text = "" And Text102.Text = "") Then

If (Text111.Text = "" And Text112.Text = "" And Text113.Text = "" And Text114.Text = "" And Text123.Text = "" And Text124.Text = "" And Text125.Text = "" And Text126.Text = "" And Text135.Text = "" And Text136.Text = "" And Text137.Text = "" And Text138.Text = "" And Text147.Text = "" And Text148.Text = "" And

Text149.Text = "" And Text150.Text = "" And Text2.Text = "" And Text7.Text = "" And

Text8.Text = "") Then

msg1 = MsgBox("Vous devez obligatoirement renseigner le champ 'Nom' !",

vbInformation + vbOKOnly)

Text3.SetFocus

Exit Sub

End If

nd If

E

E

nd If

E

nd If

'

si erreur l'ignorée (pour pouvoir ajouter un enregistrement

'qui ne comporterait pas toutes les données ex:date de naissance)

On Error Resume Next

'ajout d'un enregistrement et

tb.AddNew

'indication des textbox contenant les données qui doivent être ajouter

Text3.Text

'dans les champ

tb![IDAGENTS] =

tb![IDAGENTS1] = Text4.Text tb![IDAGENTS2] = Text5.Text tb![IDAGENTS3] = Text6.Text tb![nom] = Text15.Text tb![nom1] = Text16.Text tb![nom2] = Text17.Text tb![nom3] = Text18.Text tb![Postnom] = Text27.Text tb![Postnom1] = Text28.Text tb![Postnom2] = Text29.Text tb![Postnom3] = Text30.Text tb![Fonction] = Text39.Text tb![Fonction1] = Text40.Text tb![Fonction2] = Text41.Text tb![Fonction3] = Text42.Text tb![SEXE] = Text51.Text

47

48

tb![SEXE1] = Text52.Text tb![SEXE2] = Text53.Text tb![SEXE3] = Text54.Text tb![ADRESSE] = Text63.Text tb![ADRESSE1] = Text64.Text tb![ADRESSE2] = Text65.Text tb![ADRESSE3] = Text66.Text tb![Dette] = Text75.Text tb![Dette1] = Text76.Text tb![Dette2] = Text77.Text tb![Dette3] = Text78.Text tb![NJP] = Text87.Text tb![NJP1] = Text88.Text tb![NJP2] = Text89.Text tb![NJP3] = Text90.Text tb![SALAIREDEBASE] = Text99.Text tb![SALAIREDEBASE1] = Text100.Text tb![SALAIREDEBASE2] = Text101.Text tb![SALAIREDEBASE3] = Text102.Text tb![Avance] = Text111.Text tb![Avance1] = Text112.Text tb![Avance2] = Text113.Text tb![Avance3] = Text114.Text tb![ALLOCATFAM] = Text123.Text tb![ALLOCATFAM1] = Text124.Text tb![ALLOCATFAM2] = Text125.Text tb![ALLOCATFAM3] = Text126.Text tb![prime] = Text135.Text tb![prime1] = Text136.Text tb![prime2] = Text137.Text tb![prime3] = Text138.Text tb![NET_A_PAYER] = Text147.Text t b![NET__A__PAYER1] = Text148.Text tb![NET_A_PAYER2] = Text149.Text t b![NET__A__PAYER3] = Text150.Text

'mise à jour de la table

tb.Update

msg1 = MsgBox("L'enregistrement de vos données a été fait avec succès !",

vbInformation + vbOKOnly)

cmdRech.Enabled = True

cmdEnreg.Enabled = False

End Sub

P

cmdAjout.Enabled = True

rivate Sub cmdQuitter_Click()

msg1 = MsgBox("Voulez-vous quitter la gestion de paie ?", vbQuestion + vbYesNoCancel)

If msg1 = vbYes Then

End

ElseIf msg1 = vbNo Then

Load Me

End If

'remplace

'Select Case msg1

'Case vbYes

'Unload Me

'Case vbNo

'Cancel = 1

'(zlub) End Sub

P

' End Select

rivate Sub cmdRech_Click()

'pour s'assurer que la textbox est renseignée sinon message

If (Text163 = "" Or IsNull(Text163) = True) Then

msg1 = MsgBox("Vous devez renseigner le champ 'Nom et prénom' !",

vbInformation + vbOKOnly)

Text163.SetFocus

Else

'ouverture de la table Gestion de paie et recherche de tous les champs

'où champ [Nom]=txt15recherche.text et/ou champ

'Postnom]=txt27recherche2.text

tb1.Open "SELECT * FROM [Agents] WHERE [nom] like '%" & Text163.Text &

"%'", bd, adOpenKeyset, adLockBatchOptimistic

'si les données existent alors affichage du résultat dans les

'textbox sinon message et initialisation des textbox

If Not tb1.EOF Then

Text3.Text = tb1!IDAGENTS & ""

Text4.Text = tb1![IDAGENTS1] & ""

Text5.Text = tb1![IDAGENTS2] & ""

Text6.Text = tb1![IDAGENTS3] & ""

Text15.Text = tb1!nom & ""

Text16.Text = tb1![nom1] & ""

Text17.Text = tb1![nom2] & ""

Text18.Text = tb1![nom3] & ""

Text27.Text = tb1!Postnom & ""

Text28.Text = tb1![Postnom1] & ""

Text29.Text = tb1![Postnom2] & ""

Text30.Text = tb1![Postnom3] & ""

Text39.Text = tb1!Fonction & ""

Text40.Text = tb1![Fonction1] & ""

Text41.Text = tb1![Fonction2] & ""

Text42.Text = tb1![Fonction3] & ""

Text51.Text = tb1!SEXE & ""

Text52.Text = tb1![SEXE1] & ""

Text53.Text = tb1![SEXE2] & ""

Text54.Text = tb1![SEXE3] & ""

Text63.Text = tb1!ADRESSE & ""

Text64.Text = tb1![ADRESSE1] & ""

Text65.Text = tb1![ADRESSE2] & ""

Text66.Text = tb1![ADRESSE3] & ""

Text75.Text = tb1!Dette & ""

Text76.Text = tb1![Dette1] & ""

Text77.Text = tb1![Dette2] & ""

Text78.Text = tb1![Dette3] & ""

Text87.Text = tb1!NJP & ""

Text88.Text = tb1![NJP1] & ""

Text89.Text = tb1![NJP2] & ""

Text90.Text = tb1![NJP3] & ""

Text99.Text = tb1!SALAIREDEBASE & ""

Text100.Text = tb1![SALAIREDEBASE1] & ""

Text101.Text = tb1![SALAIREDEBASE2] & ""

Text102.Text = tb1![SALAIREDEBASE3] & ""

Text111.Text = tb1!Avance & ""

Text112.Text = tb1![Avance1] & ""

Text113.Text = tb1![Avance2] & ""

Text114.Text = tb1![Avance3] & ""

Text123.Text = tb1!ALLOCATFAM & ""

Text124.Text = tb1![ALLOCATFAM1] & ""

Text125.Text = tb1![ALLOCATFAM2] & ""

Text126.Text = tb1![ALLOCATFAM3] & ""

Text135.Text = tb1!prime & ""

Text136.Text = tb1![prime1] & ""

Text137.Text = tb1![prime2] & ""

Text138.Text = tb1![prime3] & ""

Text147.Text = tb1!NET__A__PAYER & ""

Text148.Text = tb1![NET_A_PAYER1] & ""

ext149.Text = tb1![NET__A__PAYER2] & ""

Text150.Text = tb1![NET_A_PAYER3] & ""

T

Text163.Text = "" T ext163.SetFocus

Else

msg2 = MsgBox("Ces Données n'existent pas !", vbInformation +

vbOKOnly)

Text163.Text = "" Text163.SetFocus End If

tb1.Close

49

End If

End Sub

P rivate Sub Command1_Click()

End Sub

rivate Sub Cmdtotal_Click()

Dim N3, N4, N5, N6, Tot As Currency

N3 = Text147.Text

N4 = Text148.Text

N5 = Text149.Text

N6 = Text150.Text

Tot = Val(N3) + Val(N4) + Val(N5) + Val(N6)

Text2.Text = "$" & Tot

End Sub

P

P

rivate Sub Form__Load()

'renseignements concernant la B.D'

'provider = fournisseur de données

'Microsoft jet oledb pour Access

'4.0 à partir d'access 2000

'connectionstring = chemin et nom de la B.D

'app.path signifie que la B.D se trouve dans le répertoire du projet VB

'il ne faudra pas oublier de l'ajouter lors de l'empactage

'Il suffit de copier le chemin d'accès inscrit dans Connectingstring voir le

'le contenu entre guillements en rouge

bd.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data

Source=C:\Users\Gilberth\Documents\Gestion de paie.mdb;Persist Security Info=False"

bd.Open

' renseignements concernant le recordset'

'tb.open = ouverture de la table

'où tb est la variable déclarée qui va contenir

'le nom de la table

'"select * from nom de la table"

'veut dire sélection de tous les champs(*)

'de la table (nom de la table)

'bd = variable déclarée contenant le chemin

'et le nom de la base

'adopendynamic = type des recordsets

'adlockoptimistic = type de verrouillage des recordsets

'pour plus d'info voir sur le site vbgenerator

'le cours sur l'accès au base de données

'on peut également indiquer le type de curseur

'client ou serveur

'si il n'est pas spécifier serveur par défaut

'pour plus d'info voir sur le site dévellopez.com

'le fichier pdf de J-M Rabilloud "Les recordset ADO"

tb2.Open "select * from AGENTS", bd, adOpenDynamic, adLockOptimistic

cmdEnreg.Enabled = True

End Sub

P

Call actualiser

rivate Sub Form__QueryUnload(Cancel As Integer, UnloadMode As Integer)

'si clic sur croix

If cmdRech.Enabled = True Then

msg1 = MsgBox("Voulez-vous enregistrer les données avant de quitter ?",

vbQuestion + vbYesNoCancel)

If msg1 = vbYes Then Call cmdEnreg__Click Unload Me

ElseIf msg1 = vbNo Then Unload Me

Else

Cancel = 1

End If

Else

msg1 = MsgBox("Voulez-vous vraiment fermer la gestion de paie ?",

vbQuestion + vbYesNo)

If msg1 = vbNo Then

Cancel = 1

End If

50

End If 'remplace 'Select Case msg1 'Case vbYes 'Unload Me 'Case vbNo ' Cancel = 1 ' End Select

End Sub

P

' (zlub)

rivate Sub Form_Unload(Cancel As Integer)

'procédure pour s'assurer que lorsque l'on quittera le programme 'les tables et la base de données soient fermées

On Error Resume Next 'si erreur ignorer (bd ou tb déja fermer)

tb.Close tb1.Close tb2.Close tb3.Close bd.Close

et tb = Nothing

S

Set tb1 = Nothing Set tb2 = Nothing Set tb3 = Nothing End Sub

P rivate Sub P__Click() Form2.Show

E

nd Sub

rivate Sub Label2_Click()

End Sub

P rivate Sub Text163_Change()

Text163.SetFocus

cmdRech.Enabled = True

End Sub

III.11 Schema du projet de réseau local sans fil(WiFi)

Administrateur Général Comptable

IP

:: 192.168.01.01

 

IP

: 192.168.01.02

MRS

:: 255.225.255.0

 

MRS

: 255.225.255.0

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








"La première panacée d'une nation mal gouvernée est l'inflation monétaire, la seconde, c'est la guerre. Tous deux apportent une prospérité temporaire, tous deux apportent une ruine permanente. Mais tous deux sont le refuge des opportunistes politiques et économiques"   Hemingway