Professional Documents
Culture Documents
Principal: A - A 10 A A-5 - A
Principal: A - A 10 A A-5 - A
Cmdsalir a=thisform.Height DO WHILE a>10 a=a-5 thisform.height=a ENDDO thisform.Release Cmdlogin DO FORM login login.show thisform.Visible= .F. Cmdsistema DO FORM sistema sistema.show thisform.Visible= .F. Cmdcambio
DO FORM cambio cambio.show thisform.Visible= .F.
Cmdcerrar thisform.Init() Form init thisform.cmdsistema.Enabled= .F. thisform.cmdcambio.Enabled=.f. Form LOAD SET DEFAULT TO c:\cindy\proyecto3\
Login Cmdentrar
IF thisform.txtusuario.Value=usuario AND thisform.txtpass.value=contra MESSAGEBOX("Bienvenido al Sistema",48,"Gracias") principal.show principal.cmdsistema.enabled=.T. principal.cmdcambio.enabled=.T. a=thisform.Height DO WHILE a>10 a=a-5 thisform.height=a ENDDO thisform.Release ELSE MESSAGEBOX("Usuario y Contrasea Incorrecta",48,"Error") ENDIF
Cmdsalir
a=thisform.Height DO WHILE a>10 a=a-5 thisform.height=a ENDDO thisform.Release principal.show
Form
load
Form
init
Cambio
Cmdok
select usuarios
IF ((thisform.txtactual.Value=thisform.txtconfirmar.Value) and (thisform.txtanterior.Value=contra))then
replace contra WITH thisform.txtactual.Value MESSAGEBOX("Contrasea Cambiada") thisform.txtanterior.Value="" thisform.txtactual.value="" thisform.txtconfirmar.Value="" thisform.txtanterior.SetFocus ELSE MESSAGEBOX("Revise Bien sus Datos") ENDIF
Cmdregresar
a=thisform.Height DO WHILE a>10 a=a-5 thisform.height=a ENDDO principal.show() thisform.Release
Form
load
Sistema
Form load
USE c:\cindy\proyecto3\empleados.dbf SELECT empleados SEt ORDER to IDENTIDAD
Form
activate
thisform.txtid.Format="9999-9999-99999" thisform.txtid.InputMask="9999-9999-99999"
Cmdbuscar
USE c:\cindy\proyecto3\empleados.dbf SET SAFETY OFF SELECT empleados INDEX on identidad TO iden2.idx SEEK thisform.txtid.value IF FOUND() MESSAGEBOX("Identidad Encontrada") MESSAGEBOX("Cargando Datos") thisform.txtid.Value=identidad thisform.txtnombre.Value=nombre thisform.txtht.Value=ht thisform.txtpht.Value=pht thisform.txtsueldo.Value=sueldo thisform.txtihss.Value=ihss thisform.txttotal.Value=total MESSAGEBOX("Datos cargados Exitosamente") ELSE MESSAGEBOX("Identidad no existe") ENDIF
Cmdagregar USE c:\cindy\proyecto3\empleados.dbf SET SAFETY OFF SELECT empleados INDEX on identidad TO iden2.idx APPEND BLANK replace identidad WITH thisform.txtid.Value replace nombre WITH thisform.txtnombre.Value replace ht WITH VAL(thisform.txtht.text) replace pht WITH VAL(thisform.txtpht.Text) replace sueldo WITH VAL(thisform.txtsueldo.Text) replace ihss WITH VAL(thisform.txtihss.Text) replace total WITH VAL(thisform.txttotal.Text) MESSAGEBOX("datos guardado correctamente") thisform.cmdlimpiar.Click() Cmdlimpiar thisform.txtid.Value="" thisform.txtnombre.Value="" thisform.txtht.Value="" thisform.txtpht.Value="" thisform.txtsueldo.Value="" thisform.txtihss.Value="" thisform.txttotal.Value="" thisform.txtid.SetFocus
Cmdeliminar res=MESSAGEBOX("desea eliminar el registro",4) IF res=6 then DELETE PACK MESSAGEBOX("registro borrado exitosamente") thisform.cmdlimpiar.Click() ELSE MESSAGEBOX("registro no ha sido eliminado") ENDIF cmdmodificar res=MESSAGEBOX("desea modificar el registro",4) IF res=6 then replace identidad WITH thisform.txtid.Value replace nombre WITH thisform.txtnombre.Value replace ht WITH VAL(thisform.txtht.text) replace pht WITH VAL(thisform.txtpht.Text) replace sueldo WITH VAL(thisform.txtsueldo.Text) replace ihss WITH VAL(thisform.txtihss.Text) replace total WITH VAL(thisform.txttotal.Text) MESSAGEBOX("datos modificados correctamente") thisform.cmdlimpiar.Click() ELSE MESSAGEBOX("datos no fueron modificados ") ENDIF cmdsalir a=thisform.Height DO WHILE a>10 a=a-5 thisform.height=a ENDDO principal.show thisform.Release