Files
roadef/Meniuri/blocaredel.mn2

168 lines
5.1 KiB
Plaintext

*--------------------------------------------------------------------------------------------------------------------------------------------------------
* (EN) AUTOGENERATED - ATTENTION!! - NOT INTENDED FOR EXECUTION!! USE ONLY FOR MERGING CHANGES AND STORING WITH SCM TOOLS!!
*--------------------------------------------------------------------------------------------------------------------------------------------------------
*< FOXBIN2PRG: Version="1.21" SourceFile="blocaredel.mnx" CPID="1252" /> (Solo para binarios VFP 9 / Only for VFP 9 binaries)
*
*<MenuType>4</MenuType>
*<MenuLocation>REPLACE</MenuLocation>
*<MenuCode>
DEFINE POPUP Shortcut SHORTCUT RELATIVE FROM MROW(),MCOL()
DEFINE BAR 1 OF Shortcut PROMPT "\<Blocare de luna"
ON SELECTION BAR 1 OF Shortcut DO BAR_1_OF_Shortcut_FB2P
DEFINE BAR 2 OF Shortcut PROMPT "\<Situatia lunilor blocate"
ON SELECTION BAR 2 OF Shortcut DO BAR_2_OF_Shortcut_FB2P
ACTIVATE POPUP Shortcut
*</MenuCode>
*<Procedures>
PROCEDURE BAR_1_OF_Shortcut_FB2P
sele calendar
loca for nl=m.nl and an=m.an
if smf
do mesaj with 'Luna '+m.nl+' '+m.an+' este inchisa!',''
else
oi=crea('danuinchid')
oi.show(1)
if buton=1
sele calendar
loca for nl=m.nl and an=m.an
repl smf with .t.
luna_inchisa=.t.
endif
endif
ENDPROC && BAR_1_OF_Shortcut_FB2P
PROCEDURE BAR_2_OF_Shortcut_FB2P
Store 0 To lnprogram,lnfirma,lncalendar
Store {//} To lddata
Store '' To lcfirma,lcprogram
Store '' To poLista1
Store '' To poLista2
Store '' To poLista3
Store '' To pcselect
*///////////////////////////////////////////////////////////////////////////////////
*-----------
*!* pcSchema=['']
*!* pcSelect=[select id_program,denumire from contafin_oracle.nom_programe where 1=2]
*!* pcOrder=[denumire]
*!* pcFiltru = [1=1]
*!* llAfiseaza = .F.
*!* gencursor('poLista1','crsprograme',pcSelect,pcFiltru,pcSchema,pcOrder,llAfiseaza)
*!* poLista1.ca_baza1.afisare()
*--------
lcsql = "select id_program,denumire from contafin_oracle.nom_programe order by denumire"
*STRTOFILE(lcsql,'c:\seleprograme.txt')
lnSucces=goExecutor.oExecute(lcsql,'crsprograme')
If lnSucces<0
aMESSAGEBOX(goExecutor.cEroare,16,"Eroare")
Return
Endif
Select crsprograme
Go Top
lnprogram=id_program
lcprogram=Alltrim(denumire)
*///////////////////////////////////////////////////////////////////////////////////
*///////////////////////////////////////////////////////////////////////////////////
*---------
*!* pcSchema=['']
*!* pcSelect=['select id_firma,schema from contafin_oracle.nom_firme ]
*!* pcOrder=[schema]
*!* pcFiltru = []
*!* llAfiseaza = .F.
*!* gencursor('poLista2','crsfirme',pcSelect,pcFiltru,pcSchema,pcOrder,llAfiseaza)
*!* poLista2.ca_baza1.afisare()
*---------
lcsql = "select id_firma,schema from contafin_oracle.nom_firme order by firma"
*STRTOFILE(lcsql,'c:\selefirme.txt')
lnSucces=goExecutor.oExecute(lcsql,'crsfirme')
If lnSucces<0
aMESSAGEBOX(goExecutor.cEroare,16,"Eroare")
Return
Endif
Select crsfirme
Go Top
lnfirma=id_firma
lcfirma=Alltrim(schema)
*///////////////////////////////////////////////////////////////////////////////////
*///////////////////////////////////////////////////////////////////////////////////
* se face un update la tabela de blocari
lcsql= " select id_calendar,nl,an from "+lcfirma+".calendar where ( id_calendar not in "+;
" (select id_calendar from "+lcfirma+".blocatprogramluni where id_program ="+Alltrim(Str(lnprogram))+" ) )"
lnSucces=goExecutor.oExecute(lcsql,'crsplusluni')
If lnSucces<0
aMESSAGEBOX(goExecutor.cEroare,16,"Eroare")
Return
Endif
Select crsplusluni
*brow
If Reccount()>0
*MESSAGEBOX("intrat in scan ! ")
Scan
lcsql=" insert into "+lcfirma+".blocatprogramluni(id_program,id_calendar,blocat,lunaan)"+;
" values ( "+Alltrim(Str(lnprogram))+","+Alltrim(Str(id_calendar))+",0,"+;
" to_date("+Alltrim(nl)+"||'/'||"+Alltrim(an)+",'mm/yyyy') )"
Strtofile(lcsql,'c:\insertluni.txt')
lnSucces=goExecutor.oExecute(lcsql)
If lnSucces<0
aMESSAGEBOX(goExecutor.cEroare,16,"Eroare")
Return
Endif
Select crsplusluni
Endscan
Endif
*-----------
*!* pcSchema=['']
*!* pcSelect=['select lunaan,blocat from ]+lcfirma+[.blocatprogramluni where 1=2']
*!* pcOrder=[lunaan]
*!* pcFiltru = [id_program=]+ALLTRIM(STR(lnprogram))
*!* llAfiseaza = .F.
*!* gencursor('poLista3','crslunian',pcSelect,pcFiltru,pcSchema,pcOrder,llAfiseaza)
*!* poLista.ca_baza1.afisare()
*-----------
lcsql = " select lunaan,blocat,id_calendar from "+lcfirma+".blocatprogramluni where "+;
" id_program="+Alltrim(Str(lnprogram))+"order by lunaan "
*STRTOFILE(lcsql,'c:\selelunianblocat.txt')
lnSucces=goExecutor.oExecute(lcsql,'crslunian')
If lnSucces<0
aMESSAGEBOX(goExecutor.cEroare,16,"Eroare")
Return
Endif
Select crslunian
*///////////////////////////////////////////////////////////////////////////////////
ovizblocate=Createobject('frm_viz_blocate')
ovizblocate.Show(1)
ENDPROC && BAR_2_OF_Shortcut_FB2P
*</Procedures>