Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012P75yL9Fc9EcT33tMbuxcF
1162 lines
30 KiB
Plaintext
1162 lines
30 KiB
Plaintext
Parameters tparam
|
||
|
||
Local lchost, lcUserName, lcPassword, lnIdUtil, lnIdProgram, lcUserNameApp,lcPasswordApp
|
||
Store '' To lchost, lcUserName, lcPassword, lcUserNameApp,lcPasswordApp
|
||
Store 0 To lnIdUtil, lnIdProgram
|
||
Public gcNumeProgram
|
||
|
||
gcNumeProgram = "ROAREGISTRATURA"
|
||
_Screen.Icon=gcNumeProgram+'.ico'
|
||
IF !LIKE(gcNumeProgram + '*', UPPER(ALLTRIM(JUSTSTEM(SYS(16,0)))))
|
||
Messagebox("Nu puteti porni acest program!",0+16,"Atentie")
|
||
RETURN
|
||
ENDIF
|
||
|
||
Set Century On
|
||
Set Deleted On
|
||
Set Date To Dmy
|
||
Set Exclusive Off
|
||
Set Cpdialog Off
|
||
Set Talk Off
|
||
Set Safety Off
|
||
Set Escape Off
|
||
Set Exact On
|
||
Set Mark To '/'
|
||
Set Ansi On
|
||
Set Console Off
|
||
Set Notify Off
|
||
Set Seconds Off
|
||
Set NullDisplay To ''
|
||
Set Decimals To 4
|
||
_Screen.Visible=.F.
|
||
_Screen.AutoCenter=.T.
|
||
SET SQLBUFFERING ON
|
||
|
||
|
||
|
||
*VARIABILE_______
|
||
Local lcMainClassLib
|
||
Local lcLastSetTalk,lcLastSetPath,lcLastSetClassLib,lcOnShutdown
|
||
|
||
|
||
*VARIABILE__________________________________________________________________________
|
||
Declare nror[65000]
|
||
Declare RTVA[22,2]
|
||
|
||
|
||
|
||
Public CRLF,CR,LF,Tab
|
||
Store Chr(13) + Chr(10) To CRLF
|
||
Public pcNl,pcAn
|
||
Store "" To pcNl,pcAn && se initializeaza in start00
|
||
CR=Chr(13)
|
||
LF=Chr(10)
|
||
Tab=Chr(9)
|
||
|
||
Public pcTitlu,pl_verificat
|
||
Store "" To pcTitlu
|
||
Store .F. To pl_verificat
|
||
Public BUTON, luna_inchisa, luna_neplatita, PRIMADATA, m.ctva, m.ctvam, m.ctvai, antet, m.nivel
|
||
Public OStart,OSETVIZ,OSETTULBAR,OSETINSTRUM,orm,OTEXT,OJUR,osetgest,tlbr_INSTR,tlbr_VIZ,oprinc,DIRGEN
|
||
Public pcapsocsub,pcapsocvar
|
||
pcapsocsub=0
|
||
pcapsocvar=0
|
||
Public a4
|
||
a4=.T.
|
||
m.nrgrup=999
|
||
|
||
Store .F. To luna_inchisa,tlbr_INSTRum,tlbr_VIZ
|
||
Store 1 To BUTON,col_menu
|
||
Store .T. To PRIMADATA,luna_neplatita
|
||
|
||
|
||
*** DECLARATII DE VARIABILE PUBLICE
|
||
|
||
**********************************************************************************************
|
||
*-- Save and configure environment.***********************
|
||
lcLastSetTalk=Set("TALK")
|
||
Set Talk Off
|
||
lcLastSetPath=Set("PATH")
|
||
|
||
Set Path To ;Date;Include;FERESTRE;GRAFICE;Help;CLASE;MENIURI;PROGRAME;RAPOARTE;html;
|
||
PUSH Menu _Msysmenu
|
||
lcLastSetClassLib=Set("CLASSLIB")
|
||
lcMainClassLib="clase\roaregistratura"
|
||
|
||
*CLASE__________________________________________________________
|
||
Set Classlib To (lcMainClassLib) Additive
|
||
Set Classlib To CAUT Additive
|
||
Set Classlib To ooptiuni Additive
|
||
*SET CLASSLIB TO ferestre_cere_date ADDITIVE
|
||
Set Classlib To registry Additive
|
||
Set Classlib To decabaza Additive
|
||
Set Classlib To cauta_alfa_forms Additive
|
||
Set Classlib To ferestre_oracle Additive
|
||
Set Classlib To caut_ora Additive
|
||
Set Classlib To ferestre_registratura Additive
|
||
Set Classlib To onomenclatoare Additive
|
||
*!* Set Classlib To ofundal_roaclienti Additive && modificare v 2.0.4
|
||
*!* messagebox in romana - ar trebui bagat intr-o librarie de utilitati
|
||
*!* messagebox.vcx, functia amessagebox in oproceduri_comune, imagini mb_*.bmp, messagebox.h
|
||
Set Classlib To Messagebox Additive
|
||
Set Classlib To otoolbar Additive
|
||
Set Classlib To ferestre_cere_date Additive
|
||
Set Classlib To orapoarte_comun Additive
|
||
* SET CLASSLIB TO outlook2003bar ADDITIVE
|
||
Set Classlib To onom_articole Additive
|
||
SET CLASSLIB TO serii_numere.vcx ADDITIVE
|
||
SET CLASSLIB TO ferestre_atasamente.vcx ADDITIVE
|
||
SET CLASSLIB TO wwdialogs.vcx additive && modificare v 2.0.3
|
||
SET CLASSLIB TO appwiz.vcx additive && modificare v 2.0.4
|
||
SET CLASSLIB TO accessibility.vcx additive && modificare v 2.0.4
|
||
Set Classlib To ofundal_registratura.vcx Additive && modificare v 2.0.4
|
||
*PROCEDURI______________________________________________________
|
||
Set Procedure To quitapp Additive
|
||
Set Procedure To init_program Additive
|
||
Set Procedure To oproceduri_comune Additive
|
||
Set Procedure To gencursor.prg Additive
|
||
Set Procedure To updateserver.prg Additive
|
||
Set Procedure To update_nomenclator.prg Additive
|
||
Set Procedure To onomenclatoare Additive
|
||
Set Procedure To oproceduri_ams Additive
|
||
Set Procedure To ocautare Additive
|
||
Set Procedure To oinit_optiuni Additive
|
||
Set Procedure To osecurity Additive
|
||
Set Procedure To proceduri Additive
|
||
Set Procedure To oproceduri_roaregistratura Additive
|
||
Set Procedure To acces_meniu Additive
|
||
Set Procedure To proceduri Additive
|
||
Set Procedure To oheader Additive
|
||
Set Procedure To oparteneri_contracte Additive
|
||
Set Procedure To oproceduri_maintenance.prg Additive && modifica_id_partener
|
||
Set Procedure To proceduri_excel Additive
|
||
Set Procedure To cauta_alfa Additive
|
||
SET PROCEDURE TO ini.prg ADDITIVE
|
||
Set Procedure To wwxmlhttp.prg Additive
|
||
SET PROCEDURE TO wwutils.prg ADDITIVE
|
||
SET PROCEDURE TO oserii_numere additive
|
||
SET PROCEDURE TO oproceduri_atasamente ADDITIVE
|
||
*!* modificare v 2.0.3
|
||
SET PROCEDURE TO wwconfig.prg ADDITIVE
|
||
SET PROCEDURE TO oexport.prg ADDITIVE
|
||
SET PROCEDURE TO iniacces.prg ADDITIVE
|
||
SET PROCEDURE TO oupdate.prg additive
|
||
SET PROCEDURE TO procese.prg additive
|
||
SET PROCEDURE TO version.prg additive
|
||
SET PROCEDURE TO xmlaccess.prg additive
|
||
SET PROCEDURE TO xmlparser.prg additive
|
||
SET PROCEDURE TO filebringer.prg additive
|
||
SET PROCEDURE TO wwcodeupdate.prg additive
|
||
SET PROCEDURE TO wwhttp.prg ADDITIVE
|
||
Set Procedure To wwApi.prg Additive
|
||
|
||
Declare Integer GetPrivateProfileString In Kernel32 ;
|
||
string, String, String, String @, Integer, String
|
||
Declare Integer WritePrivateProfileString In Kernel32 ;
|
||
string, String, String, String
|
||
Declare Integer CopyFile In kernel32;
|
||
STRING lpExistingFileName,;
|
||
STRING lpNewFileName,;
|
||
INTEGER bFailIfExists
|
||
Declare Integer URLDownloadToFile In urlmon.Dll;
|
||
INTEGER pCaller, String szURL, String szFileName,;
|
||
INTEGER dwReserved, Integer lpfnCB
|
||
Declare Integer PathFileExists In shlwapi;
|
||
STRING pszPath
|
||
*!* modificare v 2.0.3 ^
|
||
*----------------------------------------------------------------------------
|
||
|
||
If Pcount() = 1 And Type('tparam') = 'C'
|
||
glParametri = .T.
|
||
Private laParametri
|
||
Declare laParametri[1]
|
||
lcParam = Alltrim(tparam)
|
||
lnNr = lista2array(lcParam,@laParametri,";")
|
||
If lnNr < 6
|
||
Messagebox('Numar incorect de parametri',0+16,'Eroare')
|
||
Return
|
||
Endif
|
||
lchost = laParametri[1]
|
||
lcUserName = laParametri[2]
|
||
lcPassword = laParametri[3]
|
||
lnIdUtil = Round(Val(laParametri[4]),0)
|
||
lnIdProgram = Round(Val(laParametri[5]),0)
|
||
lnParametru_prog = Round(Val(laParametri[6]),0)
|
||
Else
|
||
glParametri = .F.
|
||
lchost = 'JCSSERVER'
|
||
lcUserName = 'CONTAFIN_ORACLE'
|
||
lcPassword = ''
|
||
lnIdUtil = 0
|
||
lnIdProgram = 0
|
||
lnParametru_prog = 0
|
||
|
||
Endif
|
||
|
||
*!* IF PCOUNT() = 1 AND TYPE('tparam') = 'C'
|
||
*!* glParametri = .T.
|
||
*!* PRIVATE laParametri
|
||
*!* DECLARE LAPARAMETRI[1]
|
||
*!* lcParam = ALLTRIM(tParam)
|
||
*!* lnNr = lista2array(lcParam,@laParametri,";")
|
||
*!* IF lnNr < 5
|
||
*!* MESSAGEBOX('Numar incorect de parametri',0+16,'Eroare')
|
||
*!* RETURN
|
||
*!* ENDIF
|
||
*!* lcHost = laParametri[1]
|
||
*!* lcUserName = laParametri[2]
|
||
*!* lcPassword = laParametri[3]
|
||
*!* lnIdUtil = ROUND(VAL(laParametri[4]),0)
|
||
*!* lnIdProgram = ROUND(VAL(laParametri[5]),0)
|
||
*!* ELSE
|
||
*!* glParametri = .F.
|
||
*!* lcHost = 'JCSSERVER'
|
||
*!* lcUserName = 'CONTAFIN_ORACLE'
|
||
*!* lcPassword = ''
|
||
*!* lnIdUtil = 8
|
||
*!* lnIdProgram = 1
|
||
*!*
|
||
*!* ENDIF
|
||
|
||
*-------------------------------------
|
||
Public glVerificTabel && daca se verifica structura tabelelor in totv.prg
|
||
glVerificTabel=.T.
|
||
|
||
Public glQuit
|
||
glQuit = .F.
|
||
|
||
Public gnIdIstoric
|
||
gnIdIstoric = 0
|
||
|
||
|
||
Public gcAppPath,gcAppName,gcAppDataPath, gcTempPath, gcCaleServerDate, gcUserNameApp, gcPasswordApp, gcDirMare
|
||
Store '' To gcUserNameApp, gcPasswordApp, gnNivelUtilizator, gnGrupUtilizator, gcAcces, gcDirMare
|
||
*!* Public gcSchemaPath
|
||
*!* Store '' To gcSchemaPath
|
||
|
||
*!* gcAppPath=Addbs(Justpath(Sys(16,0))) && d:\contafin\devize\
|
||
gcAppPath = ADDBS(ShortPath(GetAppStartPath())) && wwutils.prg
|
||
gcAppName=Allt(Uppe(Juststem(Sys(16,0)))) && "DEVIZE"
|
||
Set Path To Addbs(Substr(gcAppPath,1,Rat([\],gcAppPath,2)))+[COMUNROA\] Additive && modificare v 2.0.3
|
||
|
||
*!* gcAppDataPath=gcAppPath+"Date_"+gcAppName+"\" && D:\CONTAFIN\TRANS\DATE_TRANS && PT OPTIUNI , FISIERE SPECIFICE PROGRAMULUI SI
|
||
gcUtilizatoriPath = gcAppPath + "UTILIZATORI\"
|
||
|
||
Store "" To gcTempPath, gcCaleServerDate
|
||
|
||
*!* If !Directory(gcAppDataPath)
|
||
*!* Md (gcAppDataPath)
|
||
*!* Endif
|
||
*---------------------------------------
|
||
*** DIRGEN
|
||
liat=Rat("\",gcAppPath,2)
|
||
*!* modificare v 2.0.3
|
||
gcDirMare = Addbs(Left(gcAppPath,liat-1))
|
||
*!* DIRGEN=Addbs(Left(gcAppPath,liat-1))
|
||
dirgen = gcDirMare
|
||
*!* modificare v 2.0.3 ^
|
||
Cd &DIRGEN
|
||
|
||
*!* 21.06.2006
|
||
*!* marius.mutu
|
||
Private gcGeneralIniFile,gcSettingsFile
|
||
gcGeneralIniFile = DIRGEN + "settings.ini"
|
||
gcSettingsFile = gcGeneralIniFile
|
||
If !File(gcGeneralIniFile)
|
||
|
||
TEXT TO lcSettings NOSHOW
|
||
[errors]
|
||
host=http://romfast.dnsalias.com:3000/errors/create_xml
|
||
ENDTEXT
|
||
|
||
Strtofile(lcSettings, gcGeneralIniFile)
|
||
Endif
|
||
|
||
gcSecurityPath = DIRGEN + 'Security\'
|
||
gcSecurityFile = gcSecurityPath + 'ROA_SECURITY.TXT'
|
||
|
||
*!* Locale
|
||
Set Classlib To locale Additive
|
||
Private gcLocalePath, goLocale, gcLocale
|
||
gcLocalePath = gcAppPath + "Locale\"
|
||
*!* lcLocaleDb = gcLocalePath + "locale.dbc"
|
||
*!* Open Database (m.lcLocaleDb)
|
||
*!* modificare
|
||
*!* goLocale=Newobject("Locale","Locale.vcx")
|
||
lcLanguage = getini(gcGeneralIniFile,"locale","lang")
|
||
llLocale= getini(gcGeneralIniFile,"locale","llocale")
|
||
*!* IF !EMPTY(m.llLocale) AND m.llLocale<>'0'
|
||
*!* goLocale.llocale=.T.
|
||
*!* ENDIF
|
||
*!* modificare ^
|
||
If Empty(m.lcLanguage)
|
||
gcLocale = 'Romana'
|
||
Else
|
||
gcLocale = m.lcLanguage
|
||
Endif
|
||
*!* modificare
|
||
Local lcObjLocale
|
||
If gcLocale = 'Romana'
|
||
lcObjLocale = [Locale_dummy]
|
||
Else
|
||
lcObjLocale = [Locale]
|
||
Endif
|
||
goLocale=Newobject(lcObjLocale,"Locale.vcx")
|
||
If !Empty(m.llLocale) And m.llLocale<>'0'
|
||
goLocale.llocale=.T.
|
||
Endif
|
||
Release lcObjLocale
|
||
*!* modificare ^
|
||
goLocale.locale = gcLocale
|
||
*!* Locale ^
|
||
|
||
Private poLog,goLog && obiect pt logarea mesajelor sistemului
|
||
poLog = Newobject("Log_Mesaje","Log_Mesaje.prg")
|
||
goLog = poLog
|
||
|
||
*!* public poLog && obiect pt logarea mesajelor sistemului
|
||
*!* poLog = NEWOBJECT("Log_Mesaje","Log_Mesaje.prg")
|
||
|
||
Public glQuit
|
||
glQuit = .F.
|
||
|
||
*!* Public gnIdIstoric
|
||
*!* gnIdIstoric = 0
|
||
|
||
*!* If verificari()
|
||
*!* _Screen.Visible=.T.
|
||
*!* Do mesaj With "Se fac verificari programului","Va rugam reveniti"
|
||
*!* glQuit= .T.
|
||
*!* Quit
|
||
*!* Endif
|
||
|
||
*!* If !Debug_Start()
|
||
*!* lcParam=tparam
|
||
*!* If Empty(tparam) Or (Type('tParam')='C' And !verific_start(tparam,DIRGEN,gcAppName))
|
||
*!* _Screen.Visible=.T.
|
||
*!* Do mesaj With "Programul trebuie pornit doar din START",""
|
||
*!* Quit
|
||
*!* Endif
|
||
*!* Endif
|
||
|
||
*** verificare serie permanenta
|
||
*!* modificare v 2.0.3
|
||
*!* Public tipar,SER_PERM,SER_PERI,VERSIUNE
|
||
*!* Store .F. To SER_PERM,SER_PERI
|
||
*!* modificare v 2.0.3 ^
|
||
***************************** VARIABILE ORACLE
|
||
Private goUtilizator
|
||
Private gnHandle,gnidutil,GCCODFISCAL,GCADRESA,GCNUMEFIRMA,GCMONEDA,GNDIFZILE, gcUserNameApp, gcPasswordApp
|
||
Private gnButon && variabila pentru renunt si terminat
|
||
Store 2 To gnButon
|
||
Store '' To GCCODFISCAL,GCADRESA,GCNUMEFIRMA,GCMONEDA, gcUserNameApp, gcPasswordApp, gcNivelUtilizator, gcGrupUtilizator, gcAcces
|
||
gnHandle = -1
|
||
gnidutil = 0
|
||
|
||
Private gcHost, gcUserName, gcPassword, gofundal, gnIdProgram, gnId_prg_owner
|
||
Store 0 To gnIdProgram, gnId_prg_owner
|
||
gofundal=''
|
||
|
||
Private goFirma,gnId_Firma,gnIdFirma,gcFirma,gnAn,gnLuna && ,gnPA,gnPC
|
||
Store Null To goFirma
|
||
Store 0 To gnId_Firma, gnIdFirma, gnAn, gnLuna
|
||
Store '' To gcFirma
|
||
|
||
Private glUltimaLuna,glPrimaLuna, glLunaBuna,glLuna_neplatita,glLunaInchisa
|
||
|
||
Store .F. To glUltimaLuna,glPrimaLuna, glLunaBuna,glLuna_neplatita,glLunaInchisa
|
||
|
||
***toolbar***
|
||
PRIVATE otool,ohelp
|
||
STORE '' TO otool,ohelp
|
||
***toolbar***
|
||
|
||
Private gcS && schema firmei
|
||
Store 'DEMO' To gcS
|
||
|
||
If Type('laparametri',1)="A"
|
||
If Alen(laParametri,1)=10
|
||
gnAn = Val(laParametri[7])
|
||
gnLuna = Val(laParametri[8]) &&lansare noua
|
||
gcS = laParametri[9]
|
||
gnIdFirma = laParametri[10] && modificare v 2.0.3
|
||
Endif
|
||
Endif
|
||
|
||
Private gcCopyRight
|
||
gcCopyRight = '<27> ROA Romfast SRL'
|
||
|
||
&& obiect global wrap pt sqlexec cu text eroare si succes
|
||
Private goExecutor, goConn
|
||
goExecutor = Createobject("oExecutor")
|
||
goConn = Createobject("oConn")
|
||
|
||
*!* modificare v 2.0.3
|
||
Private goExport
|
||
goExport = CREATEOBJECT("oExportConfig")
|
||
*!* modificare v 2.0.3 ^
|
||
*!* 21.06.2006
|
||
*!* marius.mutu
|
||
Private goMyXMLHTTP
|
||
lcHostErrors = getini(gcGeneralIniFile,'errors','host')
|
||
goMyXMLHTTP = Createobject("MyXMLHTTP", lcHostErrors)
|
||
|
||
&& obiect global pt luna aleasa din calendar
|
||
Private goCalendar
|
||
Store Null To goCalendar
|
||
|
||
gcHost = lchost
|
||
gcUserName = lcUserName
|
||
gcPassword = lcPassword
|
||
gcUserNameApp = lcUserNameApp
|
||
gcPasswordApp = lcPasswordApp
|
||
gnidutil = lnIdUtil
|
||
gnIdProgram = lnIdProgram
|
||
|
||
If !glParametri
|
||
lnValid = getcrsSecurity(gcSecurityFile)
|
||
If lnValid > 0
|
||
If Used('crsHost')
|
||
Select crsHost
|
||
Go Top
|
||
gcHost = Alltrim(Host)
|
||
gcUserName = Alltrim(schema)
|
||
gcPassword = Alltrim(pwd)
|
||
Use In crsHost
|
||
Endif
|
||
Endif
|
||
Endif
|
||
|
||
*!* IF glParametri
|
||
*!* gcHost = lcHost
|
||
*!* gcUserName = lcUserName
|
||
*!* gcPassword = lcPassword
|
||
*!* gcUserNameApp = lcUserNameApp
|
||
*!* gcPasswordApp = lcPasswordApp
|
||
*!* gnIdUtil = lnIdUtil
|
||
*!* gnIdProgram = lnIdProgram
|
||
*!* ELSE
|
||
*!* gcHost = "jcsserver"
|
||
*!* gcUserName = "contafin_ORACLE"
|
||
*!* gcPassword = "123"
|
||
*!* gcUserNameApp = ''
|
||
*!* gcPasswordApp = ''
|
||
*!* gnIdUtil = 1
|
||
*!* gnIdProgram = 8
|
||
*!* ENDIF
|
||
***************************** VARIABILE ORACLE
|
||
|
||
|
||
*!* modificare v 2.0.3
|
||
*!* Use &gcAppPath\SER In 0 Alias SER Shared
|
||
*!* Select SER
|
||
*!* Go Top
|
||
*!* tipar=TIP
|
||
*!* SER_PERM=SER_PERMAN
|
||
*!* SER_PERI=SER_PERIOD
|
||
*!* VERSIUNE=VERcont
|
||
*!* MODEL_PROGRAM=MODEL
|
||
*!* Use In SER
|
||
*!* parolamea=Substr(tipar,Month(Date()),1)
|
||
*!* parolamea=parolamea+Allt(Str(Day(Date())))+Allt(Str(Month(Date())))
|
||
|
||
*!* If !_DEBUG()
|
||
*!* If SER_PERM And !verif_ser_perm()
|
||
*!* Quit
|
||
*!* Endif
|
||
*!* Endif
|
||
|
||
*!* Public cales,eserver,loc,numestatie
|
||
*!* eserver=.F.
|
||
*!* Store '' To cales,loc,numestatie
|
||
*!* modificare v 2.0.3 ^
|
||
|
||
*!* Public NUMEPROGRAM,MENIUPROGRAM,FUNDALPROGRAM
|
||
*!* NUMEPROGRAM = 'ROAREGISTRATURA'
|
||
*!* MENIUPROGRAM=gcAppPath+"meniuri\cont2000.mpr"
|
||
*!* FUNDALPROGRAM=gcAppPath+"FERESTRE\FUNDAL.scx"
|
||
*!* _program='roaregistre'
|
||
|
||
*** INITIALIZEZ CAI DATE
|
||
*!* If .F.
|
||
*!* If !Start_Nou()
|
||
*!* _Screen.WindowState=2
|
||
*!* Cd \
|
||
*!* If !Directory('c:\contafin')
|
||
*!* Md contafin
|
||
*!* Endif
|
||
*!* Cd c:\contafin\
|
||
*!* If !Directory('temp')
|
||
*!* Md temp
|
||
*!* Endif
|
||
|
||
|
||
*!* Sele 0
|
||
*!* Use c:\contafin\temp\ceprogram Alias ceprogram
|
||
*!* Scat Memv
|
||
*!* *wait wind m.util
|
||
*!* Sele ceprogram
|
||
*!* Use
|
||
*!* utilizator=m.UTIL
|
||
*!* GRUPUL=M.nrgrup
|
||
*!* If M.nrgrup=0
|
||
*!* E_UN_SUPERVIZOR=.T.
|
||
*!* Else
|
||
*!* E_UN_SUPERVIZOR=.F.
|
||
*!* Endif
|
||
|
||
*!* If File('&DIRGEN\START2000\DATA\RETEA.DBF')
|
||
*!* If !File('c:\contafin\temp\RETEA.dbf')
|
||
*!* Copy File &DIRGEN\START2000\Data\RETEA.* To c:\contafin\temp\RETEA.*
|
||
*!* Endif
|
||
*!* Sele 0
|
||
*!* Use c:\contafin\temp\RETEA
|
||
*!* eserver=Server
|
||
*!* cales=Allt(CALESERVER)
|
||
*!* Use In RETEA
|
||
*!* Endif
|
||
*!* Else
|
||
|
||
*!* gcTempPath = Init_Cale_Temp(DIRGEN)
|
||
*!* If !Directory(gcTempPath)
|
||
*!* Md (gcTempPath)
|
||
*!* Endif
|
||
|
||
*!* cales = Init_Cale_Server_Date(DIRGEN)
|
||
*!* eserver = .T.
|
||
*!* numestatie = Init_Nume_Statie(DIRGEN)
|
||
*!* utilizator = Init_Nume_Utilizator(DIRGEN)
|
||
*!* m.nivel = Round(Val(Init_Nivel_Utilizator(DIRGEN)),0)
|
||
*!* m.CONTAB = Upper(Alltrim(Init_NumeAlternativ(DIRGEN)))
|
||
|
||
*!* lcQuitData = Alltrim(DIRGEN)+"\dateretea"
|
||
*!* lcQuitName = "start_quitapp"
|
||
*!* Private goQuitApp && I'm making it private so it will die with the application.
|
||
*!* goQuitApp = quitapp(lcQuitData,lcQuitName)
|
||
|
||
*!* gnIdIstoric = Start_Istoric(m.utilizator, gcAppName, numestatie, Addbs(DIRGEN)+"DATERETEA\", "START_ISTORIC","start_ids")
|
||
|
||
|
||
*!* Endif
|
||
*!* Endif
|
||
|
||
lcOnShutdown="ShutDown()"
|
||
On Shutdown &lcOnShutdown
|
||
On Error ErrorHandler(Error(),Program(),Lineno())
|
||
_Shell="DO Cleanup IN progs\ROACLIENTI"
|
||
|
||
*-- Instantiate application object.***************************
|
||
Release goApp
|
||
Public goApp
|
||
goApp=Createobject("wzApplication")
|
||
|
||
*-- Configure application object.*****************************
|
||
*!* goApp.SetCaption("DEVIZE")
|
||
Local laVersion
|
||
Dimension laVersion(12)
|
||
If Agetfileversion(laVersion, Sys(16,0)) > 0
|
||
goApp.SetCaption(laVersion(10))
|
||
Else
|
||
goApp.SetCaption(gcNumeProgram)
|
||
Endif
|
||
Release laVersion
|
||
|
||
goApp.cStartupMenu=m.gcAppPath + "\meniuri\RoaRegistratura"
|
||
*!* goApp.cStartupForm=DIRGEN+"\devize\FERESTRE\FUNDAL"
|
||
goApp.cStartupForm = gcAppPath + 'ferestre\frm_login.scx'
|
||
|
||
_Screen.WindowState=2
|
||
*-- Show application.
|
||
|
||
Public poReg, goRegistratura
|
||
Store '' To poReg, goRegistratura
|
||
|
||
Public podg_dg, podg_referinte, podg_obs, podg_link
|
||
* STORE '' TO podg_dg, podg_ob, podg_tf, podg_tl, podg_obs, podg_link, podg_fact
|
||
|
||
*!* Private poCtrScadentar, poCtrFactGarant
|
||
*!* Store '' To poCtrScadentar, poCtrFactGarant
|
||
*!* && folosesc gencursorul pt ca am nevoie de schema pt. DATA_rata
|
||
|
||
goApp.Show
|
||
|
||
|
||
*-- Release application.
|
||
Release goApp
|
||
|
||
|
||
*-- Restore default menu.
|
||
Pop Menu _Msysmenu
|
||
|
||
*-- Restore environment.
|
||
On Error
|
||
On Shutdown
|
||
If Not lcLastSetClassLib==Set("classlib")
|
||
Release Classlib (lcMainClassLib)
|
||
Endif
|
||
If Empty(lcLastSetPath)
|
||
Set Path To
|
||
Else
|
||
Set Path To &lcLastSetPath
|
||
Endif
|
||
If lcLastSetTalk=="ON"
|
||
Set Talk On
|
||
Else
|
||
Set Talk Off
|
||
Endif
|
||
|
||
Return
|
||
|
||
|
||
|
||
|
||
* FUNCTII______________________________________________________________________
|
||
Function ErrorHandler(nError,cMethod,nLine)
|
||
Local lcErrorMsg,lcCodeLineMsg
|
||
|
||
Wait Clear
|
||
lcErrorMsg=Message()+Chr(13)+Chr(13)
|
||
lcErrorMsg=lcErrorMsg+"Method: "+cMethod
|
||
lcCodeLineMsg=Message(1)
|
||
If Between(nLine,1,10000) And Not lcCodeLineMsg="..."
|
||
lcErrorMsg=lcErrorMsg+Chr(13)+"Line: "+Alltrim(Str(nLine))
|
||
If Not Empty(lcCodeLineMsg)
|
||
lcErrorMsg=lcErrorMsg+Chr(13)+Chr(13)+lcCodeLineMsg
|
||
Endif
|
||
Endif
|
||
|
||
If Type('goMyXMLHTTP') = 'O'
|
||
lcLunaHTTP = Iif(Type('gnLuna') = 'N', Transform(gnLuna) + "/","") + Iif(Type('GNAN') = 'N', Transform(gnAn),"")
|
||
lcErrorMsgHTTP = Sys(0) + ":" + Iif(Type('GCS')='C'," " + gcS,"") + ": " + lcLunaHTTP + Chr(13) +Chr(10) + lcErrorMsg + ;
|
||
CHR(13) +Chr(10) + Chr(13) + Chr(10) + GETCALLSTACK()
|
||
lcUserName = gcUserNameApp
|
||
lcProgram = Juststem(Sys(16,0))
|
||
goMyXMLHTTP.postError(lcErrorMsgHTTP, lcUserName, lcProgram)
|
||
Endif
|
||
|
||
If AMESSAGEBOX(lcErrorMsg,17,_Screen.Caption)#1
|
||
On Error
|
||
On Shutdown
|
||
If _vfp.StartMode = 0
|
||
Debug
|
||
Suspend
|
||
Else
|
||
Quit
|
||
Endif
|
||
*!* RETURN .F.
|
||
Endif
|
||
|
||
Endfunc
|
||
|
||
|
||
|
||
Function Shutdown
|
||
|
||
*!* =End_Istoric(gnIdIstoric, Addbs(DIRGEN)+"DATERETEA\", "START_ISTORIC")
|
||
If Type("goApp")=="O" And Not Isnull(goApp)
|
||
Return goApp.OnShutDown()
|
||
Endif
|
||
Cleanup()
|
||
Quit
|
||
Endfunc
|
||
|
||
|
||
Function Cleanup
|
||
|
||
If Cntbar("_msysmenu")=7
|
||
Return
|
||
Endif
|
||
On Error
|
||
On Shutdown
|
||
Set Classlib To
|
||
Set Path To
|
||
Clear All
|
||
Close All
|
||
Pop Menu _Msysmenu
|
||
Return
|
||
|
||
|
||
|
||
*-----------------------------------------------------
|
||
|
||
Function verif_ser_perm
|
||
Clear
|
||
|
||
Return PORNIRE()
|
||
********
|
||
*?pornire()
|
||
|
||
*!* Function PORNIRE
|
||
*!* Set Exact On
|
||
*!* Private calewin,calesys,checksum1,checksum2,serinreg,serdisk,file1,file2,valret,serdisktemp,ser1,ser2,key1,KEY2
|
||
*!* Store '' To calewin,serinreg,serdisk,calesys,serdisktemp,catehd,ser1,ser2,key1,KEY2
|
||
*!* Store 0 To checksum1,checksum2
|
||
*!* Store .T. To valret
|
||
*!* Declare Integer SHGetFolderPath In SHFOLDER.Dll ;
|
||
*!* INTEGER hwndOwner, ;
|
||
*!* INTEGER nFolder, ;
|
||
*!* INTEGER hToken, ;
|
||
*!* INTEGER dwFlags, ;
|
||
*!* STRING @ pszPath
|
||
*!* Declare Integer GetActiveWindow In WIN32API
|
||
*!* #Define CSIDL_WINDOWS 36
|
||
*!* #Define CSIDL_SYSTEM 37
|
||
*!* #Define CSIDL_PROGRAMS 38
|
||
*!* lcPath = Repl(Chr(0),261)
|
||
*!* =SHGetFolderPath(GetActiveWindow(),CSIDL_WINDOWS,0,0,@lcPath)
|
||
*!* calewin=Left(lcPath,At(Chr(0),lcPath)-1)
|
||
*!* lcPath = Repl(Chr(0),261)
|
||
*!* =SHGetFolderPath(GetActiveWindow(),CSIDL_SYSTEM,0,0,@lcPath)
|
||
*!* calesys=Left(lcPath,At(Chr(0),lcPath)-1)
|
||
*!* &&se verifica existenta celor trei fisiere
|
||
*!* If (Not File(calesys+'\diskserial.dll')) Or (Not File(calesys+'\getmacip.dll')) Or (Not File(calewin+'\comdir.snr'))
|
||
*!* valret=.F.
|
||
*!* Endif
|
||
*!* If valret
|
||
*!* file1=Filetostr(calesys+'\diskserial.dll')
|
||
*!* checksum1=Sys(2007,file1)
|
||
*!* file2=Filetostr(calesys+'\getmacip.dll')
|
||
*!* checksum2=Sys(2007,file2)
|
||
*!* &&severifica daca dll-urile nu au fost modificate
|
||
*!* If (Val(checksum1) != 58755) Or (Val(checksum2) != 30476)
|
||
*!* valret=.F.
|
||
*!* Endif
|
||
*!* Endif
|
||
*!* &&se citesc seriile tutturor celor patru hard disk-uri posibile(pe IDE primary master,primary slave...)
|
||
*!* &&se tine minte primul cu seria nenula-daca nu s-a putut citi seria de la nici unul se pune o serie default
|
||
*!* &&seria default este "NUAREHAR"
|
||
*!* If valret
|
||
*!* Declare Integer GetSerialNumber In diskSerial.Dll Integer ,String
|
||
*!* catehd=0
|
||
*!* For i=0 To 3
|
||
*!* serdisktemp=Space(40)
|
||
*!* GetSerialNumber(i,@serdisktemp)
|
||
*!* If (Len(Alltrim(serdisktemp))!=0) And (catehd=0)
|
||
*!* serdisktemp=sircaracter(serdisktemp)
|
||
*!* serdisk=serdisktemp
|
||
*!* catehd=catehd+1
|
||
*!* Endif
|
||
*!* Endfor
|
||
*!* If (Len(Alltrim(serdisk))=0)
|
||
*!* serdisk='NUAREHAR'
|
||
*!* Else
|
||
*!* If ((Len(Alltrim(serdisk))>0) And (Len(Alltrim(serdisk))<8))
|
||
*!* serdisk=serdisk+Replicate('1',8-Len(Alltrim(serdisk)))
|
||
*!* Endif
|
||
*!* Endif
|
||
*!* serdisk=Substr(Alltrim(serdisk),Len(Alltrim(serdisk))-7,8)
|
||
*!* Endif
|
||
*!* &&se citeste din comdir.snr seria de inregistrare si se verifica egalitatea cu seria obtinuta anterior
|
||
*!* If valret
|
||
*!* gnFileHandle = Fopen(calewin+'\comdir.snr')
|
||
*!* nSize = Fseek(gnFileHandle, 0, 2) && Move pointer to EOF
|
||
*!* If nSize!=9
|
||
*!* valret=.F.
|
||
*!* Else
|
||
*!* = Fseek(gnFileHandle, 0, 0) && Move pointer to BOF
|
||
*!* cString = Fread(gnFileHandle,9)
|
||
*!* ser1=Substr(cString,1,4)
|
||
*!* ser2=Substr(cString,5,4)
|
||
*!* key1=Substr(cString,9,1)
|
||
*!* KEY2=DECTOBIN(Alltrim(HEXDEC(key1)))
|
||
*!* serinreg=decodare1(Alltrim(Upper(ser1)),KEY2)+decodare1(Alltrim(Upper(ser2)),KEY2)
|
||
*!* If serdisk!=serinreg
|
||
*!* valret=.F.
|
||
*!* Endif
|
||
*!* Endif
|
||
*!* = Fclose(gnFileHandle)
|
||
*!* Endif
|
||
*!* seriedisk1=serdisk
|
||
*!* serieinreg1=serinreg
|
||
*!* On Error valret=.F.
|
||
*!* Return valret
|
||
|
||
*!* FUNCTION PORNIRE
|
||
*!* SET EXACT ON
|
||
*!* PRIVATE calewin,calesys,checksum1,checksum2,serinreg,serdisk,file1,file2,valret,serdisktemp,ser1,ser2,key1,KEY2
|
||
*!* STORE '' TO calewin,serinreg,serdisk,calesys,serdisktemp,catehd,ser1,ser2,key1,KEY2
|
||
*!* STORE 0 TO checksum1,checksum2
|
||
*!* STORE .T. TO valret
|
||
*!* DECLARE INTEGER SHGetFolderPath IN SHFOLDER.DLL ;
|
||
*!* INTEGER hwndOwner, ;
|
||
*!* INTEGER nFolder, ;
|
||
*!* INTEGER hToken, ;
|
||
*!* INTEGER dwFlags, ;
|
||
*!* STRING @ pszPath
|
||
*!* DECLARE INTEGER GetActiveWindow IN WIN32API
|
||
*!* #DEFINE CSIDL_WINDOWS 36
|
||
*!* #DEFINE CSIDL_SYSTEM 37
|
||
*!* #DEFINE CSIDL_PROGRAMS 38
|
||
*!* lcPath = REPL(CHR(0),261)
|
||
*!* =SHGetFolderPath(GetActiveWindow(),CSIDL_WINDOWS,0,0,@lcPath)
|
||
*!* calewin=LEFT(lcPath,AT(CHR(0),lcPath)-1)
|
||
*!* lcPath = REPL(CHR(0),261)
|
||
*!* =SHGetFolderPath(GetActiveWindow(),CSIDL_SYSTEM,0,0,@lcPath)
|
||
*!* calesys=LEFT(lcPath,AT(CHR(0),lcPath)-1)
|
||
*!* &&se verifica existenta celor trei fisiere
|
||
*!* lcTextEroare = ""
|
||
*!* IF (NOT FILE(calesys+'\diskserial.dll')) OR (NOT FILE(calesys+'\getmacip.dll')) OR (NOT FILE(calewin+'\comdir.snr'))
|
||
*!* valret=.F.
|
||
*!* lcTextEroare = lcTextEroare + calesys + '\diskserial.dll ' + TRANSFORM(FILE(calesys+'\diskserial.dll')) + ;
|
||
*!* ' ' + calesys+'\getmacip.dll' + TRANSFORM(FILE(calesys+'\getmacip.dll')) + ' ' + calewin+'\comdir.snr' + TRANSFORM(FILE(calewin+'\comdir.snr')) + CHR(13) + CHR(10)
|
||
*!* ENDIF
|
||
*!* IF valret
|
||
*!* file1=FILETOSTR(calesys+'\diskserial.dll')
|
||
*!* checksum1=SYS(2007,file1)
|
||
*!* file2=FILETOSTR(calesys+'\getmacip.dll')
|
||
*!* checksum2=SYS(2007,file2)
|
||
*!* &&severifica daca dll-urile nu au fost modificate
|
||
*!* IF (VAL(checksum1) != 58755) OR (VAL(checksum2) != 30476)
|
||
*!* valret=.F.
|
||
*!* lcTextEroare = lcTextEroare + 'checksum1 ' + checksum1 + ' checksum2 ' + checksum2 + CHR(13) + CHR(10)
|
||
*!* ENDIF
|
||
*!* ENDIF
|
||
*!* &&se citesc seriile tutturor celor patru hard disk-uri posibile(pe IDE primary master,primary slave...)
|
||
*!* &&se tine minte primul cu seria nenula-daca nu s-a putut citi seria de la nici unul se pune o serie default
|
||
*!* &&seria default este "NUAREHAR"
|
||
*!* IF valret
|
||
*!* DECLARE INTEGER GetSerialNumber IN diskSerial.DLL INTEGER ,STRING
|
||
*!* catehd=0
|
||
*!* FOR i=0 TO 3
|
||
*!* serdisktemp=SPACE(40)
|
||
*!* GetSerialNumber(i,@serdisktemp)
|
||
*!* IF (LEN(ALLTRIM(serdisktemp))!=0) AND (catehd=0)
|
||
*!* serdisktemp=sircaracter(serdisktemp)
|
||
*!* serdisk=serdisktemp
|
||
*!* catehd=catehd+1
|
||
*!* ENDIF
|
||
*!* ENDFOR
|
||
*!* IF (LEN(ALLTRIM(serdisk))=0)
|
||
*!* serdisk='NUAREHAR'
|
||
*!* ELSE
|
||
*!* IF ((LEN(ALLTRIM(serdisk))>0) AND (LEN(ALLTRIM(serdisk))<8))
|
||
*!* serdisk=serdisk+REPLICATE('1',8-LEN(ALLTRIM(serdisk)))
|
||
*!* ENDIF
|
||
*!* ENDIF
|
||
*!* serdisk=SUBSTR(ALLTRIM(serdisk),LEN(ALLTRIM(serdisk))-7,8)
|
||
*!* ENDIF
|
||
*!* &&se citeste din comdir.snr seria de inregistrare si se verifica egalitatea cu seria obtinuta anterior
|
||
*!* IF valret
|
||
*!* gnFileHandle = FOPEN(calewin+'\comdir.snr')
|
||
*!* nSize = FSEEK(gnFileHandle, 0, 2) && Move pointer to EOF
|
||
*!* IF nSize!=9
|
||
*!* valret=.F.
|
||
*!* lcTextEroare = lcTextEroare + 'nSize ' + TRANSFORM(nSize) + CHR(13) + CHR(10)
|
||
*!* ELSE
|
||
*!* = FSEEK(gnFileHandle, 0, 0) && Move pointer to BOF
|
||
*!* cString = FREAD(gnFileHandle,9)
|
||
*!* ser1=SUBSTR(cString,1,4)
|
||
*!* ser2=SUBSTR(cString,5,4)
|
||
*!* key1=SUBSTR(cString,9,1)
|
||
*!* KEY2=DECTOBIN(ALLTRIM(HEXDEC(key1)))
|
||
*!* serinreg=decodare1(ALLTRIM(UPPER(ser1)),KEY2)+decodare1(ALLTRIM(UPPER(ser2)),KEY2)
|
||
*!* IF serdisk!=serinreg
|
||
*!* valret=.F.
|
||
*!* lcTextEroare = lcTextEroare + 'serdisk ' + serdisk + ' serinreg ' + serinreg + CHR(13) + CHR(10)
|
||
*!* ENDIF
|
||
*!* ENDIF
|
||
*!* = FCLOSE(gnFileHandle)
|
||
*!* ENDIF
|
||
*!* seriedisk1=serdisk
|
||
*!* serieinreg1=serinreg
|
||
*!* ON ERROR valret=.F.
|
||
*!* poLog.Log('Eroare verificare serie ' + CHR(13) + CHR(10) + lcTextEroare, PROGRAM())
|
||
*!* IF TYPE('goMyXMLHTTP') = 'O'
|
||
*!* IF !EMPTY(lcTextEroare)
|
||
*!* goMyXMLHTTP.postError('Eroare verificare serie ' + CHR(13) + CHR(10) + lcTextEroare, gcUserNameApp, JUSTSTEM(SYS(16,0)))
|
||
*!* ENDIF
|
||
*!* ENDIF
|
||
*!* RETURN valret
|
||
*************
|
||
|
||
*************
|
||
Function decodare1
|
||
Parameters lstring,CHEIE
|
||
Local lens,poz1,poz2,POZ3,lret,LRET2,lcstring,val1,lret1
|
||
lret=''
|
||
lret1=''
|
||
LRET2=''
|
||
lcstring=Alltrim(Upper(lstring))
|
||
lens=Len(lcstring)
|
||
For i=1 To 4
|
||
poz1=Substr(lcstring,i,1)
|
||
val1=Asc(poz1)
|
||
POZ3=Substr(CHEIE,i,1)
|
||
Do Case
|
||
Case val1>=48 And val1<=57
|
||
If ((val1-47)+Int(Val(POZ3)))<=10
|
||
poz2=Chr(val1+Int(Val(POZ3)))
|
||
Else
|
||
poz2=Chr(val1+Int(Val(POZ3))-10)
|
||
Endif
|
||
Case val1>=65 And val1<=90
|
||
If ((val1-64)+2*Int(Val(POZ3)))<=26
|
||
poz2=Chr(val1+2*Int(Val(POZ3)))
|
||
Else
|
||
poz2=Chr(val1+2*Int(Val(POZ3))-26)
|
||
Endif
|
||
Endcase
|
||
LRET2=LRET2+poz2
|
||
Endfor
|
||
For i=1 To lens
|
||
poz1=Substr(LRET2,i,1)
|
||
val1=Asc(poz1)
|
||
Do Case
|
||
Case val1>=48 And val1<=57
|
||
If ((val1-47)+i)<=10
|
||
poz2=Chr(val1+i)
|
||
Else
|
||
poz2=Chr(val1+i-10)
|
||
Endif
|
||
Case val1>=65 And val1<=90
|
||
If ((val1-64)+2*i)<=26
|
||
poz2=Chr(val1+2*i)
|
||
Else
|
||
poz2=Chr(val1+2*i-26)
|
||
Endif
|
||
Endcase
|
||
lret=lret+poz2
|
||
Endfor
|
||
lens=Len(lret)
|
||
For i=1 To lens
|
||
poz1=Substr(lret,i,1)
|
||
val1=Asc(poz1)
|
||
Do Case
|
||
Case val1>=48 And val1<=57
|
||
poz2=Chr(val1+17)&& din 0-9 in A-J
|
||
Case val1>=65 And val1<=74
|
||
poz2=Chr(val1-17)&& din A-J in 0-9
|
||
Case val1>=75 And val1<=82
|
||
poz2=Chr(val1+8)&&din K-R in S-Z
|
||
Case val1>=83 And val1<=90
|
||
poz2=Chr(val1-8)&&din S-Z in K-R
|
||
Endcase
|
||
lret1=lret1+poz2
|
||
Endfor
|
||
Return lret1
|
||
***********
|
||
&&transformarea in decimal a unui caracter hexa
|
||
Function HEXDEC
|
||
Lparameters LC
|
||
Local LV
|
||
Do Case
|
||
Case LC=='0'
|
||
LV='0'
|
||
Case LC=='1'
|
||
LV='1'
|
||
Case LC=='2'
|
||
LV='2'
|
||
Case LC=='3'
|
||
LV='3'
|
||
Case LC=='4'
|
||
LV='4'
|
||
Case LC=='5'
|
||
LV='5'
|
||
Case LC=='6'
|
||
LV='6'
|
||
Case LC=='7'
|
||
LV='7'
|
||
Case LC=='8'
|
||
LV='8'
|
||
Case LC=='9'
|
||
LV='9'
|
||
Case LC=='A'
|
||
LV='10'
|
||
Case LC=='B'
|
||
LV='11'
|
||
Case LC=='C'
|
||
LV='12'
|
||
Case LC=='D'
|
||
LV='13'
|
||
Case LC=='E'
|
||
LV='14'
|
||
Case LC=='F'
|
||
LV='15'
|
||
Endcase
|
||
Return LV
|
||
****************
|
||
&&codarea binara din hexa pe patru biti
|
||
Function DECTOBIN
|
||
Parameters sc
|
||
Local lretf
|
||
Do Case
|
||
Case sc=='0'
|
||
lretf='0000'
|
||
Case sc=='1'
|
||
lretf='0001'
|
||
Case sc=='2'
|
||
lretf='0010'
|
||
Case sc=='3'
|
||
lretf='0011'
|
||
Case sc=='4'
|
||
lretf='0100'
|
||
Case sc=='5'
|
||
lretf='0101'
|
||
Case sc=='6'
|
||
lretf='0110'
|
||
Case sc=='7'
|
||
lretf='0111'
|
||
Case sc=='8'
|
||
lretf='1000'
|
||
Case sc=='9'
|
||
lretf='1001'
|
||
Case sc=='10'
|
||
lretf='1010'
|
||
Case sc=='11'
|
||
lretf='1011'
|
||
Case sc=='12'
|
||
lretf='1100'
|
||
Case sc=='13'
|
||
lretf='1101'
|
||
Case sc=='14'
|
||
lretf='1110'
|
||
Case sc=='15'
|
||
lretf='1111'
|
||
Endcase
|
||
Return lretf
|
||
***********
|
||
Function ECARACTER
|
||
Parameters strg1
|
||
Private pz,ch,lcstring,vret,lg1
|
||
Store 0 To pz,lg1
|
||
Store '' To ch,lcstring
|
||
Store .T. To vret
|
||
lcstring=Upper(strg1)
|
||
lg1=Len(lcstring)
|
||
For ind1=1 To lg1
|
||
ch=Substr(lcstring,ind1,1)
|
||
If (Not Between(Asc(ch),48,57)) And (Not Between(Asc(ch),65,90))
|
||
vret=.F.
|
||
Exit
|
||
Endif
|
||
Endfor
|
||
Return vret
|
||
************
|
||
Function sircaracter
|
||
Parameters strg1
|
||
Private pz,ch,lcstring,vret,lg1,lciesire
|
||
Store 0 To pz,lg1
|
||
Store '' To ch,lcstring,lciesire
|
||
Store .T. To vret
|
||
strg1=Strtran(strg1,Alltrim(Chr(39)),'')&&caracterul '
|
||
strg1=Strtran(strg1,Alltrim(Chr(39)),'')&&caracterul "
|
||
lcstring=Upper(Alltrim(strg1))
|
||
lg1=Len(lcstring)
|
||
For ind1=1 To lg1
|
||
ch=Substr(lcstring,ind1,1)
|
||
If Between(Asc(ch),48,57) Or Between(Asc(ch),65,90)
|
||
lciesire=lciesire+ch
|
||
Endif
|
||
Endfor
|
||
Return lciesire
|
||
|
||
|
||
|
||
***-------------------------------------
|
||
Procedure _DEBUG
|
||
|
||
Private lcret,lcfisier,lcPath,lccalewin
|
||
Declare Integer SHGetFolderPath In SHFOLDER.Dll ;
|
||
INTEGER hwndOwner, ;
|
||
INTEGER nFolder, ;
|
||
INTEGER hToken, ;
|
||
INTEGER dwFlags, ;
|
||
STRING @ pszPath
|
||
Declare Integer GetActiveWindow In WIN32API
|
||
#Define CSIDL_WINDOWS 36
|
||
|
||
|
||
lcPath = Repl(Chr(0),261)
|
||
=SHGetFolderPath(GetActiveWindow(),CSIDL_WINDOWS,0,0,@lcPath)
|
||
lccalewin=Left(lcPath,At(Chr(0),lcPath)-1)
|
||
|
||
lcret=.F.
|
||
lcfisier=Addbs(lccalewin)+[DEBUG.TXT]
|
||
|
||
lcLog = '1 ' + lcfisier
|
||
poLog.Log(lcLog,Program())
|
||
|
||
If File(lcfisier)
|
||
LCVAL=Filetostr(lcfisier)
|
||
|
||
LNVAL1=Mod(Val(Right(LCVAL,1)),2) && restul 1 sau 0; daca e impar e 1
|
||
lnval2=Val(Left(LCVAL,Len(LCVAL)-1))
|
||
|
||
lcLog = Transform(LNVAL1) + ' ' + Transform(lnval2)
|
||
poLog.Log(lcLog,Program())
|
||
|
||
If LNVAL1=1 Or Year(Date())-Month(Date())=lnval2
|
||
lcret=.T.
|
||
Endif
|
||
Endif
|
||
|
||
lcLog = Transform(lcret)
|
||
poLog.Log(lcLog,Program())
|
||
|
||
Return lcret
|
||
|
||
Endproc
|
||
|
||
|
||
Function Start_Nou
|
||
*!* llExista_Branch = Exista_Branch(,,dirgen)
|
||
|
||
*!* lcLog = TRANSFORM(llExista_Branch)
|
||
*!* poLog.log(lcLog,PROGRAM())
|
||
Return Exista_Branch(,,DIRGEN)
|
||
Return llExista_Branch
|
||
|
||
Endfunc && start_nou
|
||
|
||
Procedure Debug_Start
|
||
|
||
lcFile = gcAppPath + "debug.txt"
|
||
If File(lcFile)
|
||
lcLog = 'debug_start'
|
||
poLog.Log(lcLog,Program())
|
||
Else
|
||
lcLog = '!debug_start'
|
||
poLog.Log(lcLog,Program())
|
||
Endif
|
||
|
||
If File(lcFile) Or !Start_Nou()
|
||
Return .T.
|
||
Endif
|
||
Return .F.
|
||
|
||
Endproc && Debug_Start
|
||
************************************************************************
|
||
Procedure verificari
|
||
Parameters tcFisierVerif
|
||
|
||
lcverificari = Addbs(gcAppPath)+gcAppName+".txt"
|
||
|
||
|
||
If File(lcverificari)
|
||
Return .T.
|
||
Endif
|
||
Return .F.
|
||
|
||
Endproc && verificari***************
|
||
|
||
Procedure myinstance
|
||
Parameters myApp
|
||
=Ddesetoption("SAFETY",.F.)
|
||
ichannel = Ddeinitiate(myApp,"ZOOM")
|
||
If ichannel =>0
|
||
=Ddeterminate(ichannel)
|
||
Quit
|
||
Endif
|
||
=Ddesetservice(myApp,"define")
|
||
=Ddesetservice(myApp,"execute")
|
||
=Ddesettopic(myApp,"","ddezoom")
|
||
Return
|
||
******************************************
|
||
Procedure ddezoom
|
||
Parameter ichannel,saction,sitem,sdata,sformat,istatus
|
||
Zoom Window Screen Norm
|
||
Return
|
||
**********************************************************
|
||
** EOF
|
||
**********************************************************
|