Sunteți pe pagina 1din 29

C.N.

AL Odobescu, Pitesti

LUCRARE DE ATESTAT
PROFESIONAL
PROFIL INFORMATICA

Profesori indrumatori: Absolvent:


Lucan Marina Enaru Razvan Sebastian

Pitesti
Mai 2017
Evidenta unei
biblioteci
(imprumuturi carti)

2
CUPRINS

1. Introducere............................................................................................... 4

2.Structurile tabelei.................................................................................... 6
10
3. Modul de functionare................................................................................

4. Secvente de cod ale aplicatiei..................................................................... 14

5. Bibliografia .................................................................................................
33

3.Modul de functionare este urmatorul:

- se apasa dubluclick pe fiserul biblioteca.exe, nu este necesara instalarea unei variante


de FOX PRO. Parola este atestat.

3
- Utilizand meniul afisat si butoanele formularelor se navigheza intre paginile proiectului.

Mai sus este prezentata modalitatea de lucru cu instrumentele programului Visual Foxpro 9.0.

4
Forma de mai sus realizeaza modificarea cartilor din lista pe baza unui id citit de la
tastatura.
Butonul cautare are rolul de a seta textbox-ul din dreptul numar_de_inventar cu o valoare
citita de la tastatura afisand cumparatorul corespunzator valorii introduse.
Butoanele anterior, respectiv urmator permit vizualizarea inregistrarilor din tabela carti.dbf,
afisandu-le una cate una.
Butonul salvare_modificari permite salvarea modificarilor efectuate pe formular in tabela
carti.dbf.
Butonul vizualizare permite afisarea continutului din tabela carti.dbf intr-un nou formular
afca.scx.

5
Forma de mai sus permite inscrierea unui nou abonat in biblioteca.
Se introduce un cod_abonat de la tastatura, se verifica folosind butonul cautare daca mai
exista un abonat cu acelasi cod, iar in cazul unui rezultat negativ se pot completa toate celelalte
campuri cu valori intoduse de la tastatura.
Salvarea acestora se face folosind butonul Salvare-doar dupa ce toate campurile sunt
completate, in tabela fisa.dbf.
Butonul vizualizare permite afisarea continutului tabelei fisa.dbf intr-un nou formular
afab.scx.

6
Aceasta forma permite inchirierea cartilor de catre abonati.
Se introduce data de la tastatura.
Se alege abonatul din lista de abonati afisata la combo1, categoria carti alese din combo2 si
numarul de exemplare dorite.
Apasand butonul adaugare se introduc noi valori in tabela inchiriere.dbf, abonatul ales
initial ramane acelasi. Prin apasarea butonului am terminat de adaugat la acest abonat se trece la
un nou abonat din lista, pasii inchirierii cartilor fiind aceiasi.
Butonul vizualizare permite afisarea continutului din tabela inchirieri.dbf intr-un nou
formular afin.scx.

Utilizand astfel aceste instrumente (tabele, fromulare, rapoarte) ale Fox Pro-ului reusim sa
cream o aplicatie stabila care sa asigure o organizare precisa a datelor si o interfata prietenoasa cu
utilizatorul.

APLICATIA:

7
Oferim in cele ce urmeaza secvente de cod cu explicatii sumare:

Programul principal.prg
***** Configurez mediul *****
SET TALK OFF
*Prevents talk from being sent to the main Visual FoxPro window, the system
message window,the graphical status bar,or a
*user-defined window.
SET SAFETY OFF
*Specifies that a dialog box isn't displayed before an existing file is
overwritten.
SET EXACT ON
*Specifies that expressions must match character for character to be
equivalent.
*Any trailing blanks in the expressions are ignored for the comparison.
*For the comparison, the shorter of the two expressions is padded on the right
with blanks
*to match the length of the longer expression.
SET DATE TO BRITISH
*DD/MM/YY
******************************
SET SYSMENU off
_screen.WindowState=0
CLOSE ALL
CLEAR
USE carti
DO form PREZENTARE.scx
READ events
**********************
Formularul prezentare.scx
IF thisform.timer1.interval=4000
thisform.hide
thisform.release

DO form parola.scx
*RUN form parola.scx
ENDIF
**********************
Formularul parola.scx
public nrclic
nrclic=0

*Numara clic-urile pe butonul command1


thisform.text2.visible=.t.
thisform.label3.visible=.t.

nrclic=nrclic+1
thisform.text2.value=nrclic
*------------------------------------

IF nrclic=3 then
thisform.text2.visible=.f.
thisform.label3.visible=.f.

8
ENDIF

IF nrclic=4 then
thisform.text1.enabled=.f.
thisform.text2.visible=.f.
thisform.label3.visible=.f.

WAIT window ('Ai gresit parola de 3 ori. La revedere.') timeout 2

CLOSE all
thisform.release
Cancel
ENDIF
*-----------------------------------------

*Parola
IF thisform.text1.value='atestat' then
WAIT window ('Intrare permisa!') timeout 2
thisform.hide
thisform.release
DO menu1.mpr
_screen.WindowState=2
DO form biblio.scx
*RUN form biblio.scx
ELSE
=messagebox('Ai gresit parola! Mai incearca !',48,'Mesaj de
eroare')
thisform.text1.value=' '
thisform.text1.setfocus
ENDIF
***********************
Formularul biblio.scx
ThisForm.Text1.Value=str(Day(Date()),7)+' '+str[month(Date()),3]+'
'+str(Year(Date()),6)

ThisForm.Text3.Value=Time()
***********************
Formularul abonat.scx
CLOSE ALL
USE fisa.dbf IN 1
thisform. text1.value=0
thisform. text2.value=' '
thisform. text3.value=' '
thisform. text4.value=' '
thisform. combo1.value=' '
thisform. text6.value=' '
thisform.text7.value=0
*****************************
IF THISFORM.TEXT4.VALUE=' '
messagebox('Introduceti adresa abonatului !',46,'Mesaj de eroare' )
THISFORM.TEXT4.SETFOCUS
THISFORM.TEXT4.VALUE=' '
ENDIF
*****************************
SELECT 1

9
locate for thisform.text1.value=cod
if found()
messagebox('Acest cod mai exista!',46,'Mesaj de eroare' )
THISFORM.TEXT1.VALUE=0
THISFORM.TEXT1.SETFOCUS

else
thisform.text2.enabled=.t.
thisform.text3.enabled=.t.
thisform.text4.enabled=.t.
thisform.combo1.enabled=.t.
thisform.text6.enabled=.t.
thisform.text7.enabled=.t.

thisform.text2.setfocus

endif
****************************
IF THISFORM.text7.VALUE=0
messagebox('Introduceti numarul de la B.I sau C.I!',46,'Mesaj de eroare' )
THISFORM.text7.SETFOCUS
THISFORM.text7.VALUE=0
else

SELECT 1
append blank
replace cod with thisform.text1.value
replace nume with thisform.text2.value
replace pre with thisform.text3.value
replace adr with thisform.text4.value
replace iden with thisform.combo1.value
replace seria with thisform.text6.value
replace nr with thisform.text7.value

thisform.text1.setfocus
thisform. text1.value=0
thisform. text2.value=' '
thisform. text3.value=' '
thisform. text4.value=' '
thisform. combo1.value=' '
thisform. text6.value=' '
thisform.text7.value=0

wait window 'S-a facut adaugarea datelor ' timeout 1


thisform.text2.enabled=.f.
thisform.text3.enabled=.f.
thisform.text4.enabled=.f.
thisform.combo1.enabled=.f.
thisform.text6.enabled=.f.
thisform.text7.enabled=.f.

thisform.command1.enabled=.f.
ENDIF
*****************************
DO FORM AFAB

10
***********************
Formularul adcateg.scx
CLOSE ALL
USE categ IN 1
thisform.text1.Value=' '
thisform.text2.Value=0
*****************************
SELECT 1
*LOCATE FOR ALLTRIM(str(codcat))=ALLTRIM(thisform.text2.value)
LOCATE FOR thisform.text2.value=codcat
IF FOUND()
MESSAGEBOX('Acest cod mai exista!')
thisform.text2.Value=0
thisform.command4.SetFocus
thisform.text2.Enabled=.f.
thisform.text1.Enabled=.f.
ELSE

thisform.text1.SetFocus

endif
****************************
thisform.text2.Enabled=.t.
thisform.text2.Value=0
thisform.text2.setfocus
thisform.text1.Enabled=.t.
****************************
SELECT 1
APPEND BLANK
replace codcat WITH thisform.text2.value
replace categ WITH thisform.text1.Value
thisform.text1.Value=' '
thisform.text2.Value=0
WAIT window 'S-a facut adaugarea categoriei dorite' TIMEOUT 1
thisform.text1.Enabled= .F.
thisform.text2.Enabled= .F.
thisform.command4.SetFocus
****************************
DO FORM afcateg
***********************
Formularul afisarecarte.scx
cod=Val(substr(This.Value,1,1))
Requery("cartet")
***********************
Formularul carti.scx
close all
use carti in 1
use ani in 2
use categ IN 3
sele 1
SET EXACT ON
THISFORM.TEXT1.VALUE=0
THISFORM.TEXT2.VALUE=' '
THISFORM.TEXT3.VALUE=' '
THISFORM.TEXT4.VALUE=' '

11
THISFORM.COMBO4.VALUE=' '
THISFORM.COMBO3.VALUE=' '
THISFORM.TEXT7.VALUE=' '
THISFORM.combo5.VALUE=0
thiSFORM.COMBO1.VALUE=' '
THISFORM.TEXT10.VALUE=' '
THISFORM.COMBO2.VALUE=' '
THISFORM.TEXT12.VALUE=' '
THISFORM.combo6.VALUE=' '
THISFORM.TEXT14.VALUE=' '
THISFORM.TEXT15.VALUE=' '
THISFORM.TEXT16.VALUE=' '
THISFORM.TEXT17.VALUE=' '
THISFORM.TEXT18.VALUE=' '
THISFORM.TEXT19.VALUE=' '
THISFORM.TEXT20.VALUE=0
*******************************
IF THISFORM.combo1.VALUE=' '
messagebox('Introduceti D sau N !',46,'Mesaj de eroare' )
THISFORM.combo1.SETFOCUS
THISFORM.combo1.VALUE=' '
ENDIF
******************************
IF thisform.combo1.value='D'
thisform.text10.enabled=.t.
thisform.text10.setfocus
ELSE
thisform.combo2.setfocus
thisform.text10.Enabled=.f.
ENDIF
******************************
sele 1
locate for thisform.text1.value=nrin
if found()
messagebox('Acest numar de inventar mai exista!',16,'Mesaj de eroare')
thisform.text1.setfocus
thisform.text1.value=0
else
thisform.text2.enabled=.t.
thisform.text3.enabled=.t.
thisform.text4.enabled=.t.
thisform.combo4.enabled=.t.
thisform.combo3.enabled=.t.
thisform.text7.enabled=.t.
thisform.combo5.enabled=.t.
thisform.combo1.enabled=.t.
thisform.combo2.enabled=.t.
thisform.text15.enabled=.t.
thisform.text16.enabled=.t.
thisform.text17.enabled=.t.
thisform.text18.enabled=.t.
thisform.text19.enabled=.t.
thisform.text20.enabled=.t.
thisform.text2.setfocus
endif
*****************************

12
IF THISFORM.TEXT1.VALUE=0
messagebox('Acest cod nu poate fi introdus!',16,'Mesaj de eroare')
thisform.text1.setfocus
thisform.text1.value=0
endif
*****************************
sele 1
append blank
replace nrin with thisform.text1.value
replace titlu with thisform.text2.value
replace autor with thisform.text3.value
replace ed with thisform.text4.value
replace anap with thisform.combo4.displayvalue
replace lunaap with thisform.combo3.value
replace locap with thisform.text7.value
replace categ with thisform.text5.value
replace codcat WITH thisform.combo5.value
replace tra with thisform.combo1.value

replace tradu with thisform.text10.value


replace reed with thisform.combo2.value

replace reped with thisform.text12.value


replace dan with thisform.combo6.value
replace loc with thisform.text14.value
replace tiparit with thisform.text15.value
replace adtip with thisform.text16.value
replace red with thisform.text17.value
replace tehred with thisform.text18.value
replace cop with thisform.text19.value
replace nrex with thisform.text20.value

thisform.text1.setfocus
thisform.text1.value=0
THISFORM.TEXT2.VALUE=' '
THISFORM.TEXT3.VALUE=' '
THISFORM.TEXT4.VALUE=' '
THISFORM.COMBO4.VALUE=' '
THISFORM.COMBO3.VALUE=' '
THISFORM.TEXT7.VALUE=' '
THISFORM.combo5.VALUE=' '
thisform.text5.Value=' '
THISFORM.COMBO1.VALUE=' '
THISFORM.TEXT10.VALUE=' '
THISFORM.COMBO2.VALUE=' '
THISFORM.TEXT12.VALUE=' '
THISFORM.combo6.VALUE=' '
THISFORM.TEXT14.VALUE=' '
THISFORM.TEXT15.VALUE=' '
THISFORM.TEXT16.VALUE=' '
THISFORM.TEXT17.VALUE=' '
THISFORM.TEXT18.VALUE=' '
THISFORM.TEXT19.VALUE=' '
THISFORM.TEXT20.VALUE=0

wait window 'S-a facut adaugarea datelor' timeout 1

13
thisform.text2.enabled=.f.
thisform.text3.enabled=.f.
thisform.text4.enabled=.f.
thisform.combo4.enabled=.f.
thisform.combo3.enabled=.f.
thisform.text7.enabled=.f.
thisform.combo5.enabled=.f.
thisform.combo1.enabled=.f.
thisform.text10.enabled=.f.
thisform.combo2.enabled=.f.
thisform.text12.enabled=.f.
thisform.combo6.enabled=.f.
thisform.text14.enabled=.f.
thisform.text15.enabled=.f.
thisform.text16.enabled=.f.
thisform.text17.enabled=.f.
thisform.text18.enabled=.f.
thisform.text19.enabled=.f.
thisform.text20.enabled=.f.
thisform.command1.enabled=.f.
*******************************
SELECT 1
DO FORM afca.scx
***********************
Formularul form2.scx
CLOSE ALL
USE carti IN 1
USE fisa IN 2
USE categ IN 3
USE inchiriere IN 4
thisform.text1.Value=' '
thisform.text2.Value=' '
thisform.text3.Value={}
thisform.text4.Value={}
thisform.text5.Value=0
thisform.text6.Value=0
*******************************
SELECT 2

locate for ALLTRIM(thisform.combo1.value)=ALLTRIM(STR(cod))


if found ()
thisform.text6.Value=cod
thisform.text1.Value=nume
thisform.text2.value=pre
ENDIF
******************************
SELECT 4
locate for thisform.text6.value=cod
if found ()
thisform.edit1.value=titlu
endif
******************************

sele 4
locate for thisform.edit1.value=titlu

14
Thisform.text5.value=nrin
thisform.text3.value=datain
*********************************

SELECT 4
replace datare with thisform.text4.value
thisform.text4.Value={}
thisform.text3.Value={}
thisform.text5.Value=0
thisform.edit1.setfocus
*********************************
DO FORM afre
***********************
Formularul inchirierecarti.scx
close all

USE carti.dbf IN 1
USE fisa.dbf IN 2
USE categ.dbf IN 3
USE inchiriere.dbf IN 4

SET EXACT ON
thisform.text6.Value=0
thisform.text1.Value=' '
thisform.text3.Value=' '
thisform.text2.Value=0
thisform.text4.Value=' '
thisform.spinner1.Value=0
thisform.combo2.value=' '
thisform.edit1.Value=' '
thisform.text8.Value={}
*thisform.combo3.value=0
*ThisForm.Text8.Value=str(Day(Date()),7)+'\'+str[month(Date()),3]+'\'+str(Year
(Date()),6)
*********************************
SELECT 2
locate for ALLTRIM(thisform.combo1.value)=ALLTRIM(STR(cod))
thisform.text1.value=nume
thisform.text3.value=pre
thisform.text6.value=cod
thisform.combo2.enabled=.t.

*thisform.combo1.enabled=.f.
*thisform.text8.Enabled=.f.
thisform.combo2.setfocus
********************************
thisform.spinner1.Enabled=.f.
SELECT 1
*cat=categ
*SET FILTER TO

locate for thisform.combo2.value=categ

if found ()

15
thisform.edit1.value=titlu
thisform.edit1.enabled=.t.
else
messagebox('La aceasta categorie nu exista carti, mai reveniti! ')

thisform.edit1.Value=' '

ENDIf
*******************************
sele 1

locate for thisform.edit1.value=titlu


Thisform.text2.value=nrin
thisform.text4.value=titlu
Thisform.text5.value=autor
thisform.spinner1.Enabled=.t.
thisform.spinner1.setfocus
thisform.command1.Enabled=.t.
*******************************
IF THISFORM.SPINNER1.VALUE=0
messagebox('Introduceti numarul de lexemplare!',46,'Mesaj de eroare' )
THISFORM.SPINNER1.SETFOCUS
THISFORM.spinner1.VALUE=0
else
rasp=messagebox('Doriti sa efectuati adaugarea cartii !',4+32+256,'Mesaj!')

SELE 1

LOCATE for thisform.edit1.value=titlu


DO case
CASE rasp=6
WAIT window 'Ati apasat YES' timeout 1

sele 4
append blank
replace cod with thisform.text6.value
replace nume with thisform.text1.value
replace pre with thisform.text3.value
replace nrin with thisform.text2.value
replace titlu with thisform.text4.value
replace autor with thisform.text5.value
replace nrex with thisform.spinner1.value
replace datain with thisform.text8.value
replace categ WITH thisform.combo2.value

thisform.combo1.enabled=.f.
thisform. text2.value=0
thisform. text4.value=' '
thisform.text5.value=' '
thisform.spinner1.value=0
thisform.edit1.value=' '
thisform.combo2.Value=' '
thisform.combo2.setfocus
*thisform.spinner1.SetFocus=.f.
thisform.edit1.Enabled=.f.

16
CASE rasp=7
WAIT window 'Ati apasat NO. Nu sa facut adaugarea cartii!' timeout 1

thisform. text2.value=0
thisform. text4.value=' '
thisform.text5.value=' '
thisform.spinner1.value=0
thisform.edit1.value=' '
thisform.combo2.Value=' '
thisform.combo2.SetFocus
thisform.edit1.Enabled= .F.

ENDCASE
thisform.spinner1.Enabled= .F.
thisform.command4.Enabled=.t.
ENDIF
thisform.command1.Enabled=.f.
********************************
thisform.combo1.enabled=.t.
thisform.text8.Enabled=.t.
thisform.combo1.value=' '
thisform.text6.value=0
thisform.text1.value=' '
thisform.text3.value=' '
thisform.text8.Value={}
thisform.text2.value=0
thisform.text4.value=' '
thisform.text5.value=' '
thisform.spinner1.value=0
thisform.edit1.value=' '
thisform.combo2.Value=' '

thisform.combo2.enabled=.f.
thisform.edit1.enabled=.f.
thisform.spinner1.Enabled=.f.
thisform.command1.Enabled=.f.
thisform.text8.setfocus
*********************************
DO FORM afin
***********************
Formularul listareabonat.scx(formularul Adaugare_furnizor.scx este
aprox. la fel)
CLOSE ALL

USE fisa.dbf IN 1
********************************
REPORT FORM abonat to printer noconsole
********************************
SELECT 1
SET filter to alltrim(str(cod))=alltrim(thisform.combo1.displayvalue)
REPORT form abonat.FRX preview
set filter to
***********************
Formularul modabonat.scx

17
CLOSE ALL
USE FISA.DBF IN 1
SELECT 1
SET EXACT on
thisform.text1.Value=0
thisform.text2.value=' '
thisform.text3.value=' '
thisform.text4.value=' '
thisform.combo1.value=' '
thisform.text6.value=' '
thisform.text7.value=0
****************************
IF THISFORM.TEXT2.VALUE=' '
messagebox('Introduceti numele abonatului !',46,'Mesaj de eroare' )
THISFORM.TEXT2.SETFOCUS
THISFORM.TEXT2.VALUE=' '
ENDIF
*****************************
IF THISFORM.TEXT3.VALUE=' '
messagebox('Introduceti prenumele abonatului !',46,'Mesaj de eroare' )
THISFORM.TEXT3.SETFOCUS
THISFORM.TEXT3.VALUE=' '
ENDIF
*****************************
SELECT 1
Locate FOR cod = ThisForm.text1.Value
IF FOUND()
MESSAGEBOX('Codul abonatului exista!',48,'Atentionare!')
*thisform.command6.Enabled=.t.
thisform.text1.Enabled=.f.
thisform.text1.Value=cod
thisform.text2.Value=nume
thisform.text3.value=pre
thisform.text4.value=adr
thisform.combo1.value=iden
thisform.text6.value=seria
thisform.text7.value=nr

thisform.text1.Enabled=.f.
thisform.text2.Enabled=.t.
thisform.text3.Enabled=.t.
thisform.text4.Enabled=.t.
thisform.combo1.Enabled=.t.
thisform.text6.Enabled=.t.
thisform.text7.Enabled=.t.
*thisform.text7.setfocus
*thisform.command3.enabled= .T.

ELSE
MESSAGEBOX('Codul abonatului nu exista!',46,'Atentionare')
*thisform.command6.Enabled=.f.
*thisform.text1.Enabled=.f.
thisform.text1.enabled=.t.
thisform.text1.SETfocus
thisform.text1.Value=0

18
ENDIF
********************************
SELECT 1
*thisform.command4.Enabled=.t.
if Not BOF()
Skip -1
thisform.text1.Enabled=.f.
thisform.text2.Enabled=.t.
thisform.text3.Enabled=.t.
thisform.text4.Enabled=.t.
thisform.combo1.Enabled=.t.
thisform.text6.Enabled=.t.
thisform.text7.Enabled=.t.

thisform.text2.setfocus
thisform.text1.value=cod
thisform.text2.value=nume
thisform.text3.value=pre
thisform.text4.value=adr
thisform.combo1.Value=iden
thisform.text6.Value=seria
thisform.text7.Value=nr

Else
MessageBox('Nu mai sunt abonati',48,'Atentionare!')
Endif
******************************
SELECT 1
*thisform.command3.Enabled=.t.
If Not Eof()
Skip
If Not Eof()
thisform.text1.value=cod
thisform.text1.Enabled=.f.
thisform.text2.Enabled=.t.
thisform.text3.Enabled=.t.
thisform.text4.Enabled=.t.
thisform.combo1.Enabled=.t.
thisform.text6.Enabled=.t.
thisform.text7.Enabled=.t.

ThisForm.Text1.Refresh
ThisForm.Text2.Refresh
ThisForm.Text3.Refresh
ThisForm.Text4.Refresh
ThisForm.combo1.Refresh
ThisForm.Text6.Refresh
ThisForm.Text7.Refresh

thisform.text2.Value=nume
thisform.text3.Value=pre
thisform.text4.Value=adr
thisform.combo1.Value=iden
thisform.text6.Value=seria
thisform.text7.Value=nr

19
*thisform.text7.setfocus

Else
MessageBox('Nu mai sunt abonati',48,'Atentionare!')
Endif
Endif
********************************
IF THISFORM.text7.VALUE=0
messagebox('Introduceti numarul de la B.I sau C.I!',46,'Mesaj de eroare' )
THISFORM.text7.SETFOCUS
THISFORM.text7.VALUE=0
else

SELE 1

replace nume with thisform.text2.value


replace pre with thisform.text3.value
replace adr with thisform.text4.value
replace iden with thisform.combo1.value
replace seria with thisform.text6.value
replace nr with thisform.text7.value
wait window 'S-a facut modificarea datelor ' timeout 1

thisform.text2.enabled=.f.
thisform.text3.enabled=.f.
thisform.text4.enabled=.f.
thisform.combo1.enabled=.f.
thisform.text6.enabled=.f.
thisform.text7.enabled=.f.

thisform.text2.value=' '
thisform.text3.value=' '
thisform.text4.value=' '
thisform.combo1.value=' '
thisform.text6.value=' '
thisform.text7.value=0

thisform.text1.Enabled=.t.
thisform.text1.Value=0
thisform.text1.setfocus
endif
*******************************
DO FORM AFAB
***********************
Formularul modcarti.scx
close all
use carti.dbf in 1
use ani.dbf in 2
USE categ.dbf IN 3
sele 1
SET EXACT ON
thisform.text1.Value=0
THISFORM.TEXT2.VALUE=' '

20
THISFORM.TEXT3.VALUE=' '
THISFORM.TEXT4.VALUE=' '
THISFORM.COMBO4.VALUE=' '
THISFORM.COMBO3.VALUE=' '
THISFORM.TEXT7.VALUE=' '
THISFORM.COMBO5.VALUE=' '
THISFORM.COMBO1.VALUE=' '
THISFORM.TEXT10.VALUE=' '
THISFORM.COMBO2.VALUE=' '
THISFORM.TEXT12.VALUE=' '
THISFORM.combo7.VALUE=' '
THISFORM.TEXT14.VALUE=' '
THISFORM.TEXT15.VALUE=' '
THISFORM.TEXT16.VALUE=' '
THISFORM.TEXT17.VALUE=' '
THISFORM.TEXT18.VALUE=' '
THISFORM.TEXT19.VALUE=' '
THISFORM.TEXT20.VALUE=0
*****************************
IF thisform.combo1.value='D'
thisform.text10.enabled=.t.
thisform.text10.setfocus
ELSE
thisform.combo2.setfocus
thisform.text10.Enabled=.f.
ENDIF
**********************************
SELECT 1
Locate FOR nrin = ThisForm.text1.Value
IF FOUND()
MESSAGEBOX('Codul carti exista!',48,'Atentionare!')
*thisform.command6.Enabled=.t.
thisform.text1.Enabled=.f.

thisform.text2.value=titlu
thisform.text3.value=autor
thisform.text4.value=ed
thisform.combo4.Value=anap
thisform.combo3.Value=lunaap
thisform.text7.Value=locap
thisform.combo5.Value=categ
thisform.combo1.Value=tra
thisform.text10.Value=tradu
thisform.combo2.Value=reed
thisform.text12.Value=reped
thisform.combo7.Value=dan
thisform.text14.Value=loc
thisform.text15.Value=tiparit
thisform.text16.Value=adtip
thisform.text17.Value=red
thisform.text18.Value=tehred
thisform.text19.Value=cop
thisform.text20.Value=nrex

thisform.text1.Enabled=.f.

21
thisform.text2.enabled=.t.
thisform.text3.enabled=.t.
thisform.text4.enabled=.t.
thisform.combo4.enabled=.t.
thisform.combo3.enabled=.t.
thisform.text7.enabled=.t.
thisform.combo5.enabled=.t.
thisform.combo1.enabled=.t.
thisform.combo2.enabled=.t.
thisform.text15.enabled=.t.
thisform.text16.enabled=.t.
thisform.text17.enabled=.t.
thisform.text18.enabled=.t.
thisform.text19.enabled=.t.
thisform.text20.enabled=.t.
*thisform.text10.enabled=.t.
*thisform.text12.enabled=.t.
*thisform.combo7.enabled=.t.
*thisform.text14.enabled=.t.
thisform.text15.Enabled=.t.
thisform.text16.Enabled=.t.
thisform.text17.Enabled=.t.
thisform.text18.Enabled=.t.
thisform.text19.Enabled=.t.
thisform.text20.Enabled=.t.
thisform.text7.Enabled=.t.
*thisform.text7.setfocus
*thisform.command3.enabled= .T.

ELSE
MESSAGEBOX('Codulcarti nu exista!',46,'Atentionare')
*thisform.command6.Enabled=.f.
*thisform.text1.Enabled=.f.
thisform.text1.enabled=.t.
thisform.text1.SETfocus
thisform.text1.Value=0

ENDIF
********************************
SELECT 1
*thisform.command3.Enabled=.t.
if Not BOF()
Skip -1
thisform.text1.Enabled=.f.

thisform.text2.enabled=.t.
thisform.text3.enabled=.t.
thisform.text4.enabled=.t.
thisform.combo4.enabled=.t.
thisform.combo3.enabled=.t.
thisform.text7.enabled=.t.
thisform.combo5.enabled=.t.
thisform.combo1.enabled=.t.
thisform.combo2.enabled=.t.
thisform.text15.enabled=.t.
thisform.text16.enabled=.t.

22
thisform.text17.enabled=.t.
thisform.text18.enabled=.t.
thisform.text19.enabled=.t.
thisform.text20.enabled=.t.
*thisform.text10.enabled=.t.
*thisform.text12.enabled=.t.
*thisform.combo7.enabled=.t.
*thisform.text14.enabled=.t.
thisform.text15.Enabled=.t.
thisform.text16.Enabled=.t.
thisform.text17.Enabled=.t.
thisform.text18.Enabled=.t.
thisform.text19.Enabled=.t.
thisform.text20.Enabled=.t.

thisform.text2.setfocus

thisform.text1.value=nrin
thisform.text2.value=titlu
thisform.text3.value=autor
thisform.text4.value=ed
thisform.combo4.Value=anap
thisform.combo3.Value=lunaap
thisform.text7.Value=locap
thisform.combo5.Value=categ
thisform.combo1.Value=tra
thisform.text10.Value=tradu
thisform.combo2.Value=reed
thisform.text12.Value=reped
thisform.combo7.Value=dan
thisform.text14.Value=loc
thisform.text15.Value=tiparit
thisform.text16.Value=adtip
thisform.text17.Value=red
thisform.text18.Value=tehred
thisform.text19.Value=cop
thisform.text20.Value=nrex

Else
MessageBox('Nu mai sunt cartii',48,'Atentionare!')
Endif
*********************************
SELECT 1

If Not Eof()
Skip
If Not Eof()
thisform.text1.value=nrin

thisform.text1.Enabled=.f.

thisform.text2.Enabled=.t.
thisform.text3.Enabled=.t.
thisform.text4.Enabled=.t.
thisform.combo4.Enabled=.t.
thisform.combo3.enabled=.t.

23
thisform.text7.Enabled=.t.
thisform.combo5.Enabled=.t.
thisform.combo1.Enabled=.t.
* thisform.text10.Enabled=.t.
thisform.combo2.Enabled=.t.
* thisform.text12.Enabled=.t.
* thisform.combo7.Enabled=.t.
*thisform.text14.Enabled=.t.
thisform.text15.Enabled=.t.
thisform.text16.Enabled=.t.
thisform.text17.Enabled=.t.
thisform.text18.Enabled=.t.
thisform.text19.Enabled=.t.
thisform.text20.Enabled=.t.

ThisForm.Text1.Refresh
ThisForm.Text2.Refresh
ThisForm.Text3.Refresh
ThisForm.Text4.Refresh
ThisForm.combo1.Refresh
ThisForm.combo2.Refresh
ThisForm.combo3.Refresh
ThisForm.combo4.Refresh
ThisForm.combo5.Refresh

ThisForm.combo7.Refresh
ThisForm.Text7.Refresh
ThisForm.Text10.Refresh
ThisForm.Text12.Refresh
ThisForm.Text14.Refresh
ThisForm.Text15.Refresh
ThisForm.Text16.Refresh
ThisForm.Text17.Refresh
ThisForm.Text18.Refresh
ThisForm.Text19.Refresh
ThisForm.Text20.Refresh
thisform.text2.Value=titlu
thisform.text3.Value=autor
thisform.text4.Value=ed
thisform.combo4.Value=anap
thisform.combo3.Value=lunaap
thisform.text7.Value=locap
thisform.combo5.Value=categ
thisform.combo1.Value=tra
thisform.text10.Value=tradu
thisform.combo2.Value=reed
thisform.text12.Value=reped
thisform.combo7.Value=dan
thisform.text14.Value=loc
thisform.text15.Value=tiparit
thisform.text16.Value=adtip
thisform.text17.Value=red
thisform.text18.Value=tehred
thisform.text19.Value=cop
thisform.text20.Value=nrex
Else

24
MessageBox('Nu mai sunt carti',48,'Atentionare!')
Endif
Endif
********************************
sele 1
replace titlu with thisform.text2.value
replace autor with thisform.text3.value
replace ed with thisform.text4.value
replace anap with thisform.combo4.value
replace lunaap with thisform.combo3.value
replace locap with thisform.text7.value
replace categ with thisform.combo5.value
replace tra with thisform.combo1.value
replace tradu with thisform.text10.value
replace reed with thisform.combo2.value
replace reped with thisform.text12.value
replace dan with thisform.combo7.value
replace loc with thisform.text14.value
replace tiparit with thisform.text15.value
replace adtip with thisform.text16.value
replace red with thisform.text17.value
replace tehred with thisform.text18.value
replace cop with thisform.text19.value
replace nrex with thisform.text20.value

wait window 'S-a efectuat modificarea datele' timeout 1


thisform.text1.Enabled=.t.
thisform.text2.enabled=.f.
thisform.text3.enabled=.f.
thisform.text4.enabled=.f.
thisform.combo4.enabled=.f.
thisform.combo3.enabled=.f.
thisform.text7.enabled=.f.
thisform.combo5.Enabled=.f.
thisform.combo1.enabled=.f.
thisform.text10.enabled=.f.
thisform.combo2.enabled=.f.
thisform.text12.enabled=.f.
thisform.combo7.enabled=.f.
thisform.text14.enabled=.f.
thisform.text15.enabled=.f.
thisform.text16.enabled=.f.
thisform.text17.enabled=.f.
thisform.text18.enabled=.f.
thisform.text19.enabled=.f.
thisform.text20.enabled=.f.

thisform.text1.Value=0
THISFORM.TEXT2.VALUE=' '
THISFORM.TEXT3.VALUE=' '
THISFORM.TEXT4.VALUE=' '
THISFORM.COMBO4.VALUE=' '
THISFORM.COMBO3.VALUE=' '
THISFORM.TEXT7.VALUE=' '
THISFORM.combo5.VALUE=' '

25
THISFORM.COMBO1.VALUE=' '
THISFORM.TEXT10.VALUE=' '
THISFORM.COMBO2.VALUE=' '
THISFORM.TEXT12.VALUE=' '
THISFORM.combo7.VALUE=' '
THISFORM.TEXT14.VALUE=' '
THISFORM.TEXT15.VALUE=' '
THISFORM.TEXT16.VALUE=' '
THISFORM.TEXT17.VALUE=' '
THISFORM.TEXT18.VALUE=' '
THISFORM.TEXT19.VALUE=' '
THISFORM.TEXT20.VALUE=0

thisform.text1.setfocus
*****************************
DO FORM AFCa
***********************
Formularul stabonat.scx
close all
use fisa in 1
*sele 1
*thisform.list1.value=0
*thisform. text2.value=' '
*thisform. text3.value=' '
*thisform. text4.value=' '
*thisform. combo1.value=' '
*thisform. text6.value=' '
*thisform.text7.value=' '
*thisform. combo2.value=' '
*thisform. text9.value=0
*****************************
sele 1
LOCATE FOR alltrim(THISFORM.list1.VALUE)=alltrim(str(COD))
thisform.text2.value=nume
thisform.text3.value=pre
thisform.text4.value=adr
thisform.combo1.value=iden
thisform.text6.value=seria
thisform.text7.value=nr
******************************
thisform.command2.enabled=.t.
rasp=messagebox('Doriti sa efectuati stergerea',4+32+256,'Sergere')
SELE 1
LOCATE for alltrim(thisform.list1.value)=alltrim(str(cod))
DO case
CASE rasp=6
WAIT window 'Ati apasat YES' timeout 1
Delete for alltrim(thisform.list1.value)=alltrim(str(cod))
*BROWSE
PACK
CASE rasp=7
WAIT window 'Ati apasat NO. Nu sa facut stergerea' timeout 1
ENDCASE
thisform. text2.value=' '
thisform. text3.value=' '

26
thisform. text4.value=' '
thisform. combo1.value=' '
thisform. text6.value=' '
thisform.text7.value=' '
***********************
Formularul stcarti.scx
close all
use carti.dbf in 1
use ani.dbf in 2

sele 1
SET EXACT ON

THISFORM.TEXT2.VALUE=' '
THISFORM.TEXT3.VALUE=' '
THISFORM.TEXT4.VALUE=' '
THISFORM.COMBO4.VALUE=' '
THISFORM.COMBO3.VALUE=' '
THISFORM.TEXT7.VALUE=' '
THISFORM.TEXT8.VALUE=' '
THISFORM.COMBO1.VALUE=' '
THISFORM.TEXT10.VALUE=' '
THISFORM.COMBO2.VALUE=' '
THISFORM.TEXT12.VALUE=' '
THISFORM.TEXT13.VALUE=0
THISFORM.TEXT14.VALUE=' '
THISFORM.TEXT15.VALUE=' '
THISFORM.TEXT16.VALUE=' '
THISFORM.TEXT17.VALUE=' '
THISFORM.TEXT18.VALUE=' '
THISFORM.TEXT19.VALUE=' '
THISFORM.TEXT20.VALUE=0
********************************
sele 1
LOCATE FOR alltrim(THISFORM.LIST1.VALUE)=alltrim(str(NRIN))
THISFORM.TEXT2.VALUE=TITLU
THISFORM.TEXT3.VALUE=autor
THISFORM.TEXT4.VALUE=ed
THISFORM.combo4.VALUE=anap
THISFORM.combo3.VALUE=lunaap
THISFORM.TEXT7.VALUE=locap
THISFORM.TEXT8.VALUE=categ
THISFORM.combo1.VALUE=tra
THISFORM.TEXT10.VALUE=tradu
THISFORM.combo2.VALUE=reed
THISFORM.TEXT12.VALUE=reped
THISFORM.TEXT13.VALUE=dan
THISFORM.TEXT14.VALUE=loc
THISFORM.TEXT15.VALUE=tiparit
THISFORM.TEXT16.VALUE=adtip
THISFORM.TEXT17.VALUE=red
THISFORM.TEXT18.VALUE=tehred
THISFORM.TEXT19.VALUE=cop
THISFORM.TEXT20.VALUE=nrex
********************************

27
thisform.command1.enabled=.t.
rasp=messagebox('Doriti sa efectuati stergerea',4+32+256,'Sergere')
sele 1
locate for alltrim(thisform.list1.value)=alltrim(str(nrin))
do case
case rasp=6
wait window 'Ati apasat YES' timeout 1
delete for alltrim (thisform.list1.value)=alltrim(str(nrin))
*browse
pack
case rasp=7
wait window 'Ati apasat NO. Nu sa facut stergerea' timeout 1
endcase
THISFORM.TEXT2.VALUE=' '
THISFORM.TEXT3.VALUE=' '
THISFORM.TEXT4.VALUE=' '
THISFORM.COMBO4.VALUE=' '
THISFORM.COMBO3.VALUE=' '
THISFORM.TEXT7.VALUE=' '
THISFORM.TEXT8.VALUE=' '
THISFORM.COMBO1.VALUE=' '
THISFORM.TEXT10.VALUE=' '
THISFORM.COMBO2.VALUE=' '
THISFORM.TEXT12.VALUE=' '
THISFORM.TEXT13.VALUE=0
THISFORM.TEXT14.VALUE=' '
THISFORM.TEXT15.VALUE=' '
THISFORM.TEXT16.VALUE=' '
THISFORM.TEXT17.VALUE=' '
THISFORM.TEXT18.VALUE=' '
THISFORM.TEXT19.VALUE=' '
THISFORM.TEXT20.VALUE=0

5. BIBLIOGRAFIE

1. M. Homorodeanu, S. Petrescu, Limbajul de programare Visual Fox-Pro 6.0,


Editura Niculescu ,2003
2. Mariana, Ionut si Ioana Pantiru, Manual pentru clasa a XIIa, Editura L&S
INFOMAT, 2002
3. Eugen Popescu, Doina Preda, Mihaela Codres, Ecaterina Boarna, Daniel Codres,
Sofia Vitelaru, Visual FoxPro - Teorie si aplicatii, Editura Else, 2009

28
NOTA: Am utilizat limbajul de programare Visual FoxPro pentru a creearea lucrarea de atestat,
deoarece acest limbaj are un viitor in domeniul economic (de gestiune a bazelor de date),dar si
pentru modul placut de lucru .

29

S-ar putea să vă placă și