* Thực thể khen thưởng:
- Tên thực thể : Khen thưởng
- Tên viết tắt : KHENTHUONG
- Mỗi thể hiện của thực thể KHENTHUONG là một đối tượng dùng để lưu trữ tất cả các lần khen thưởng của Nhân viên trong một tháng, bởi một mã số nhất định là khen thưởng ( MS_KT ). Mỗi lần khen thưởng được biết qua ngày khen thưởng ( NGAYKT ), Lý do khen thưởng ( LYDO ), Hình thức khen thưởng ( HTKT ) và số biên bản xác định số lần khen thưởng đó ( SOBB ).
152 trang |
Chia sẻ: aloso | Lượt xem: 1677 | Lượt tải: 0
Bạn đang xem trước 20 trang tài liệu Chuyên đề Xây dựng hệ thống thông tin quản lý nhân sự tại công ty cổ phần Thiên Minh, để xem tài liệu hoàn chỉnh bạn click vào nút DOWNLOAD ở trên
ng ban'
RETURN
ENDIF
IF !FILE(sPath + "Luong" + RIGHT(STR(m.Year), 2) + ".DBF")
_Fields = "Manv C(5)"
FOR I = 1 TO 12
_Fields = _Fields + ", Hssp" + TRANS(I, "@L ##") + " N(5,2)"
_Fields = _Fields + ", L_sp" + TRANS(I, "@L ##") + " N(5,2)"
_Fields = _Fields + ", L_phep" + TRANS(I, "@L ##") + " N(5,2)"
_Fields = _Fields + ", L_khac" + TRANS(I, "@L ##") + " N(5,2)"
ENDFOR
CREATE TABLE (sPath + "Luong" + RIGHT(STR(m.Year), 2)) (&_Fields)
INDEX ON Manv TAG Manv
USE
ENDIF
SELECT 0
USE (sPath + "Luong" + RIGHT(STR(m.Year), 2)) ORDER Manv ALIAS Luong
SELECT 0
USE (sPath + "LLNV") ORDER Manv ALIAS LLNV NOUPDATE
SELECT 0
USE (sPath + "Hopdong") ORDER Manv ALIAS Hopdong NOUPDATE
SELECT 0
USE (sPath + "Macv") ORDER Macv ALIAS Macv NOUPDATE
SELECT Manv ;
FROM LLNV ;
WHERE Manv NOT IN (SELECT Manv FROM Luong) ;
INTO TABLE (sTmp + "tAdd_Manv")
USE IN tAdd_Manv
SELECT Luong
IF _TALLY#0
APPE FROM (sTmp + "tAdd_Manv")
ENDIF
DELETE ;
FROM Luong WHERE Manv NOT IN (SELECT Manv FROM LLNV)
SET PROC TO smLib
DO Window
_Hssp = "Hssp" +TRANS(m.Thang, "@L ##")
_L_sp = "L_sp" +TRANS(m.Thang, "@L ##")
_L_phep = "L_phep"+TRANS(m.Thang, "@L ##")
_L_khac = "L_khac"+TRANS(m.Thang, "@L ##")
SELECT ;
SPACE(1) AS Tag, ;
Manv, ;
LLNV.Ten AS Ten, ;
LLNV.Ho+LLNV.Ten AS Tennv, ;
Hopdong.Macv AS Macv, ;
Macv.Diengiai AS Chucvu, ;
&_Hssp AS Hssp, ;
&_L_sp AS L_sp, ;
&_L_phep AS L_phep, ;
&_L_khac AS L_khac ;
FROM Luong ;
WHERE Manv IN (SELECT Manv FROM LLNV WHERE ALLT(Madv)=ALLT(m.Madv)) ;
INTO TABLE (sTmp + "tLuongtmp")
SET RELATION TO Manv INTO LLNV
SET RELATION TO Manv INTO Hopdong ADDI
REPLACE ALL ;
Ten WITH LLNV.Ten, ;
Tennv WITH ALLT(LLNV.Ho)+" " + ALLT(LLNV.Ten), ;
Macv WITH Hopdong.Macv
SET RELATION TO Macv INTO Macv
REPLACE ALL Chucvu WITH Macv->Diengiai
SET RELATION TO
INDEX ON Manv TAG Manv
INDEX ON Macv+UPPER(ALLT(Ten)) TAG Stt
GOTO TOP
ON KEY LABEL SPACEBAR DO k_Tag
ON KEY LABEL CTRL+A DO k_TagAll
ON KEY LABEL CTRL+U DO k_TagUn
ON KEY LABEL F3 DO Sua WITH VARREAD()
ON KEY LABEL F4 DO Copy_hssp
sDynamicBackColor="IIF(EMPTY(Tag), 16777215, 16771538)"
BROWSE ;
FIELDS;
Tag, ;
Manv :H="Ma nv", ;
Tennv :H="Ten nhan vien", ;
Chucvu:18:H="Chuc vu", ;
Hssp :P="@Z 99.99", ;
L_sp :H="Cong sp" :P="@Z 99.99", ;
L_phep:H="Cong phep":P="@Z 99.99", ;
L_khac:H="Cong nghi":P="@Z 99.99", ;
L_tg=L_sp+L_phep+L_khac :H="Cong tgian" :P="@Z 99.99" ;
NAME oBrowse ;
NOAPPEND NODELETE NOMODIFY ;
WHEN Change_Color_Of_Browse(RECNO(), sDynamicBackColor);
WINDOW M_WinBrw;
TITLE "Cham cong thang " + TRANS(m.Thang) + " –
BP: " + Cat_dau(ALLT(m.Tendv)) + ". SPACEBAR/^+A/^+U-
Danh dau/Chon tat/Huy chon, F3-Sua, F4-Copy hssp, Esc-Quay ra"
*!*
*!* NAME oBrowse;
*!* NOAPPEND NOMODIFY NODELETE ;
*!* WHEN ChangeColor(RECNO());
*!* WINDOW M_WinBrw ;
*!* FONT M_Font, M_FntSize -2;
*!* TITLE M_Prompt + [. F3-Sua, F4-Them, F8-Xoa,
^F/G-Tim, Esc-Quay ra];
ON KEY LABEL F4
ON KEY LABEL F3
ON KEY LABEL SPACEBAR
ON KEY LABEL CTRL+A
ON KEY LABEL CTRL+U
DO Rel_Window
*+Update vao file goc
SELECT tLuongTmp
SET ORDER TO Manv
SELECT Luong
SET RELATION TO Manv INTO tLuongTmp
sReplace = "Hssp"+TRANS(m.Thang, "@L ##") + " WITH tLuongTmp->Hssp"
sReplace = sReplace + ", L_sp" +TRANS(m.Thang,
"@L ##")+" WITH tLuongTmp->L_sp"
sReplace = sReplace + ", L_phep"+TRANS(m.Thang, "@L ##")
+" WITH tLuongTmp->L_phep"
sReplace = sReplace + ", L_khac"+TRANS(m.Thang, "@L ##")
+" WITH tLuongTmp->L_khac"
sReplace = sReplace + " FOR Manv = tLuongTmp->Manv"
REPLACE &sReplace
USE IN Luong
USE IN LLNV
USE IN Hopdong
USE IN Macv
USE IN tLuongtmp
DELETE FILE (sTmp + "tAdd_Manv.*")
DELETE FILE (sTmp + "tLuongtmp.*")
SELECT(curSelect)
RETURN
ENDPROC
*!* Cham cong
PROCEDURE Sua
PARAMETER _FieldVar
PRIVATE curRec, nRec, m.Nhan_huy
curRec = RECNO()
STORE 0 TO nRec
COUNT TO nRec FOR !EMPTY(Tag)
IF curRec <= RECCOUNT()
GOTO curRec
ENDIF
IF nRec = 0
=Messagebox("Phai danh dau truoc khi sua!", 61, "Note")
RETURN
ENDIF
STORE .T. TO _Lock1, _Lock2, _Lock3, _Lock4
DO CASE
CASE UPPER(ALLT(_FieldVar)) == [L_SP]
STORE .F. TO _Lock2, _Lock3, _Lock4
CASE UPPER(ALLT(_FieldVar)) == [L_PHEP]
STORE .F. TO _Lock1, _Lock3, _Lock4
CASE UPPER(ALLT(_FieldVar)) == [L_KHAC]
STORE .F. TO _Lock1, _Lock2, _Lock4
CASE UPPER(ALLT(_FieldVar)) == [HSSP]
STORE .F. TO _Lock1, _Lock2, _Lock3
OTHERWISE
ENDCASE
m.Nhan_huy = 1
SCAT MEMV
PUSH KEY CLEAR
DO FORM Luong-f3
POP KEY
IF LASTKEY()=27 OR m.Nhan_huy # 1
RETURN
ENDIF
SELECT tLuongtmp
DO CASE
CASE UPPER(ALLT(_FieldVar)) == [L_SP]
REPLACE ALL ;
Tag WITH "", ;
L_sp WITH m.L_sp ;
FOR !EMPTY(Tag)
CASE UPPER(ALLT(_FieldVar)) == [L_PHEP]
REPLACE ALL ;
Tag WITH "", ;
L_phep WITH m.L_phep ;
FOR !EMPTY(Tag)
CASE UPPER(ALLT(_FieldVar)) == [L_KHAC]
REPLACE ALL ;
Tag WITH "", ;
L_khac WITH m.L_khac ;
FOR !EMPTY(Tag)
CASE UPPER(ALLT(_FieldVar)) == [HSSP]
REPLACE ALL ;
Tag WITH "", ;
Hssp WITH m.Hssp ;
FOR !EMPTY(Tag)
OTHERWISE
REPLACE ALL ;
Tag WITH "", ;
Hssp WITH m.Hssp, ;
L_sp WITH m.L_sp, ;
L_phep WITH m.L_phep, ;
L_khac WITH m.L_khac ;
FOR !EMPTY(Tag)
ENDCASE
GOTO curRec
RETURN
*!*----------------------------------------------------
*!* Thu tuc Copy he so sp tu thang truoc sang thang nay
*!*----------------------------------------------------
PROCEDURE Copy_hssp
PRIVATE curSelect, curRec
_CoKhong = Messagebox("Copy he so san pham tu thang truoc sang?", 289, "Note")
IF _CoKhong = 2
RETURN
ENDIF
curSelect = SELECT()
curRec = RECNO()
IF m.Thang = 1
IF !FILE(sPath + "Luong" + RIGHT(STR(m.Year-1), 2) + ".DBF")
RETURN
ENDIF
USE (sPath + "Luong" + RIGHT(STR(m.Year-1), 2)) ALIAS Luong0 IN 0 NOUP
SELECT Manv, Hssp12 AS Hssp;
FROM Luong0 ;
WHERE Manv IN (SELECT Manv FROM tLuongtmp) AND Hssp12#0 ;
INTO CURS tHssp
INDEX ON Manv TAG Manv
USE IN Luong0
ELSE
_Hssp0 = "Hssp" +TRANS(m.Thang-1, "@L ##")
SELECT Manv, &_Hssp0 AS Hssp;
FROM Luong ;
WHERE Manv IN (SELECT Manv FROM tLuongtmp) AND &_Hssp0#0 ;
INTO CURS tHssp
INDEX ON Manv TAG Manv
ENDIF
SELECT tLuongtmp
SET RELATION TO Manv INTO tHssp
REPLACE ALL Hssp WITH tHssp.Hssp FOR Manv==tHssp.Manv
SET RELATION TO
USE IN tHssp
SELECT(curSelect)
IF curRec<=RECCOUNT()
GOTO curRec
ENDIF
RETURN
---------------------------
File:Luong-in.PRG
*!* ------------------------------------------------------------
*!* Chuong trinh in bang luong
*!* Nguoi viet: Hong Tu
*!* Ngay viet: 17-06-2003
*!* -------------------------------------------------------------
PRIVATE curSelect, sPath, sTmp, sRpt, m.Nhan_huy, m.Thang, m.Year
CLOS DATA
curSelect = SELECT()
sPath = PATH_HUMAN+"\Data\"
sTmp = PATH_HUMAN+"\Text\"
sRpt = PATH_HUMAN+"\Repo\"
SET PROC TO smLib
DO Window
SELECT 0
USE (sPath + "Luong-in") ALIAS aLuong
SELECT 0
USE (sPath + "Bophan") ORDER Madv ALIAS Bophan
STORE MONTH(DATE()) TO m.Thang
STORE YEAR(DATE()) TO m.Year
m.Madv = ""
m.Nhan_huy = 1
ON KEY LABEL F3 DO Khai_bao
DO FORM Luong-in
ON KEY LABEL F3
m.Tendv = IIF(SEEK(m.Madv, "Bophan"), Bophan.Tenbp, "")
_Key = ".T."
IF !EMPTY(m.Madv)
_Key = "ALLT(Madv)=ALLT(m.Madv)"
ENDIF
IF LASTKEY() = 27 OR m.Nhan_huy = 0
USE IN Bophan
USE IN aLuong
SELECT(curSelect)
DO Rel_Window
RETURN
ENDIF
IF !FILE(sPath + "Luong" + RIGHT(STR(m.Year), 2) + ".DBF")
WAIT WIND NOWA 'Chua cap nhat bang cham cong trong thang!'
USE IN Bophan
USE IN aLuong
DO Rel_Window
RETURN
ENDIF
*+Lay cac bien khai bao san trong file mau
SELECT aLuong
GO TOP
SCAN
_Bien = ALLT(Bien)
PRIVATE &_Bien
STORE aLuong.Gia_tri TO &_Bien
ENDS
USE IN aLuong
SELECT 0
USE (sPath + "Luong" + RIGHT(STR(m.Year), 2)) ORDER Manv ALIAS Luong
SELECT 0
USE (sPath + "LLNV") ORDER Manv ALIAS LLNV NOUPDATE
SELECT 0
USE (sPath + "Hopdong") ORDER Manv ALIAS Hopdong NOUPDATE
SELECT 0
USE (sPath + "Macv") ORDER Macv ALIAS Macv NOUPDATE
_Hssp = "Hssp" +TRANS(m.Thang, "@L ##")
_L_sp = "L_sp" +TRANS(m.Thang, "@L ##")
_L_phep = "L_phep"+TRANS(m.Thang, "@L ##")
_L_khac = "L_khac"+TRANS(m.Thang, "@L ##")
_p_Tien = "999999999999"
SELECT ;
SPACE(5) AS Stt, ;
Manv, ;
LLNV.Ten AS Ten, ;
LLNV.Ho+LLNV.Ten AS Tennv, ;
LLNV.Madv AS Madv, ;
Hopdong.Macv AS Macv, ;
Macv.Diengiai AS Chucvu, ;
Hopdong.Hs_lc AS Hs_lc, ;
Hopdong.Hs_cv AS Hs_cv, ;
Hopdong.Luonghd AS Luonghd, ;
&_Hssp AS Hssp, ;
&_L_sp AS L_sp, ;
&_L_phep AS L_phep, ;
&_L_khac AS L_khac, ;
&_p_Tien AS Luongcd, ;
&_p_Tien AS Luongtg, ;
&_p_Tien AS Luongtg1, ;
&_p_Tien AS Luongsp, ;
&_p_Tien AS Luongsp1, ;
&_p_Tien AS Tinh_trich ;
FROM Luong ;
WHERE Manv IN (SELECT Manv FROM LLNV WHERE &_Key) ;
INTO TABLE (sTmp + "tLuongtmp")
SET RELATION TO Manv INTO LLNV
SET RELATION TO Manv INTO Hopdong ADDI
REPLACE ALL ;
Ten WITH LLNV.Ten, ;
Tennv WITH ALLT(LLNV.Ho)+" " + ALLT(LLNV.Ten), ;
Madv WITH LLNV.Madv, ;
Macv WITH Hopdong.Macv, ;
Hs_lc WITH Hopdong.Hs_lc, ;
Hs_cv WITH Hopdong.Hs_cv, ;
Luonghd WITH Hopdong.Luonghd
SET RELATION TO Macv INTO Macv
REPLACE ALL Chucvu WITH Macv->Diengiai
SET RELATION TO
*+Tinh luong:
&&Tien luong che do hang thang
REPLACE ALL ;
Luongcd WITH ROUND(Luonghd*(Hs_lc+Hs_cv), m_Round), ;
Tinh_trich WITH ROUND(Luonghd*(Hs_lc+IIF(Hs_cv<=0.1,0,Hs_cv))*m_Tinh_trich/100, m_Round)
&&Tien luong lam theo thoi gian
IF m_L_tg # 0
REPLACE ALL ;
Luongtg WITH ROUND((L_sp+L_phep+L_khac)*Luongcd/m_L_tg, m_Round)
ENDIF
&&Tien luong lam theo san pham
IF m_L_sp # 0
REPLACE ALL ;
Luongsp WITH ROUND(L_sp*(Hssp*m_Gia_hssp)/m_L_sp, m_Round)
ENDIF
&&Lam tron tien luong den hang ngan
IF m_Round_Luong # 0
REPLACE ALL ;
Luongtg1 WITH m_Round_Luong*ROUND(Luongtg/m_Round_Luong, m_Round), ;
Luongsp1 WITH m_Round_Luong*ROUND(Luongsp/m_Round_Luong, m_Round), ;
Tinh_trich WITH m_Round_Luong*ROUND(Tinh_trich/m_Round_Luong, m_Round)
ELSE
REPLACE ALL ;
Luongtg1 WITH Luongtg, Luongsp1 WITH Luongsp
ENDIF
*+ Tinh tong luong theo tung bo phan
INDEX ON Madv TAG Madv
TOTAL ON Madv TO (sTmp+"tTotal")
SELECT 0
USE (sTmp+"tTotal")
SET RELATION TO Madv INTO Bophan
REPLACE ALL ;
Stt WITH "", ;
Tennv WITH SPACE(5)+ALLT(Bophan->Tenbp)
SET RELATION TO
*+ Xap xep bang luong theo tung phong ban+chuc vu
SELECT tLuongtmp
COPY STRUC TO (sTmp+"tLuongtmp2")
SELECT 0
USE (sTmp+"tLuongtmp2") ALIAS tLuong
SELECT tTotal
SCAN FOR LuongTg1+Luongsp1>0
SCAT MEMV FIELDS ;
Madv,Tennv,L_sp,L_phep,L_khac,Luongtg,Luongtg1,Luongsp,Luongsp1,Tinh_trich
SELECT tLuong
APPE BLANK
GATHER MEMV
SELECT * ;
FROM tLuongtmp ;
WHERE Madv = ALLT(m.Madv) AND LuongTg1+Luongsp1>0;
ORDE BY Macv, Ten ;
INTO TABLE (sTmp+"tL_bp")
REPLACE ALL Stt WITH TRANS(RECNO())
USE IN tL_bp
SELECT tLuong
APPE FROM (sTmp+"tL_bp")
APPEN BLANK
DELETE FILE (sTmp + "tL_bp.*")
SELECT tTotal
ENDS
USE IN tTotal
USE IN Luong
USE IN LLNV
USE IN Hopdong
USE IN Macv
USE IN Bophan
USE IN tLuongtmp
SELECT tLuong
GOTO BOTT
DELETE
GOTO TOP
ON KEY LABEL F7 DO Print
BROWSE ;
FIELDS;
Stt, ;
Tennv :H="Ten nhan vien", ;
Chucvu :H="Chuc vu":18, ;
Hs_lc :H="Hslcb":P="@Z 999.99", ;
Hs_cv :H="Hstn":P="@Z 999.99", ;
Luongcd :H="Luong che do":P="@Z 999 999 999", ;
L_tg=L_sp+L_phep+L_khac :H="Cong tg" :P="@Z 999.99", ;
Luongtg :P="@Z 999 999 999", ;
Luongtg1 :H="Luong tgian":P="@Z 999 999 999", ;
Hssp :P="@Z 999.99", ;
L_sp :H="Cong sp" :P="@Z 999.99", ;
Luongsp :P="@Z 999 999 999", ;
Luongsp1 :H="Luong sp":P="@Z 999 999 999", ;
Tinh_trich:H="BHXH+YT":P="@Z 999 999 999", ;
Cong_luong=Luongtg1+Luongsp1-Tinh_trich:H=[Tong luong]:P="@Z 999 999 999" ;
NAME oBrowse NOWA;
NOAPPEND NODELETE NOMODIFY ;
WHEN Change_Color_Of_Browse(RECNO());
WINDOW M_WinBrw;
TITLE "Bang tinh luong thang " + TRANS(m.Thang) + " nam " + STR(m.Year,4) + ". F7-In, Esc-Quay ra"
oBrowse.SetAll("DynamicFontBold", "EMPTY(Stt) AND !EMPTY(Tennv)", "Column")
oBrowse.SetAll("DynamicForeColor", "IIF(EMPTY(Stt) AND !EMPTY(Tennv),10485760,0)", "Column")
BROWSE LAST
ON KEY LABEL F7
USE IN tLuong
DO Rel_Window
DELETE FILE (sTmp + "tLuongtmp.*")
DELETE FILE (sTmp + "tLuongtmp2.*")
DELETE FILE (sTmp + "tTotal.*")
SELECT(curSelect)
RETURN
ENDPROC
*!*----------------------------
*!*Khai bao file Mau tinh luong
*!*----------------------------
PROCEDURE Khai_bao
PRIVATE curSelect
curSelect=SELECT()
PUSH KEY CLEAR
SELECT aLuong
BROWSE ;
FIELDS ;
Dien_giai: R,;
Gia_tri:F:P=[@Z 999 999 999.99];
NAME oBrowse ;
NOAP NODE ;
WHEN Change_Color_Of_Browse(RECNO()) ;
WINDOW m_WinBrw ;
TITLE "Khai bao cac chi tieu tinh luong. ESC-Thoat"
POP KEY
SELECT(curSelect)
RETURN
*!*-----------------------------
*!*In bao cao luong
*!*-----------------------------
PROCEDURE Print
DO CASE
CASE m.Nhan_huy = 2 &&In
REPORT FORM (sRpt + "Luong-in") TO PRINT PROMPT NOCONSOLE
CASE m.Nhan_huy = 1 &&View
MODIFY WINDOW m_WinBrw TITLE "Bang tinh luong thang " + TRANS(m.Thang) + " nam " + STR(m.Year,4) + ". Esc - Quay ra"
MOVE WINDOW m_WinBrw CENTER
KEYB "{CTRL+F10}"
REPORT FORM (sRpt + "Luong-in") PREVIEW WINDOW m_WinBrw
ENDCASE
RETURN
------------------------------
File:main.prg
*!* Ngui Viet: Hong Tu.
SET TALK OFF
CLEAR
SET STATUS BAR ON
ON KEY
CLOSE ALL
DO HideToolBar
SET SYSMENU TO
SET SYSMENU AUTOMATIC
*!* SET CENTURY ON
*!* SET CLOCK STATUS
*!* SET ESCAPE OFF
*!* SET EXCLUSIVE OFF
*!* SET EXACT OFF
*!* SET DATE TO FRENCH
*!* SET SAFETY OFF
*!* SET STATUS OFF
*!* SET HEADING OFF
*!* SET REPROCESS TO -1
*!* SET REFRESH TO 1, 1
*!* SET SCOREBOARD OFF
*!* SET MULTILOCKS ON
*!* SET STATUS BAR OFF
*!* SET TALK OFF
*!* SET HOURS TO 24
*!* SET DELETED ON
*!* Clear WINDOW
*!* Clear ALL
*!* ON ERROR
*!* RELEASE PAD _MTable OF _MSYSMENU
*!* RELEASE PAD _MEdit OF _MSYSMENU
*!* RELEASE PAD _MFile OF _MSYSMENU
*!* RELEASE PAD _MView OF _MSYSMENU
*!* RELEASE PAD _MSM_WINDO OF _MSYSMENU
*!* RELEASE PAD _MSM_FORMAT OF _MSYSMENU
*!* RELEASE PAD _MSM_TOOLS OF _MSYSMENU
*!* RELEASE PAD _MSM_PROG OF _MSYSMENU
*!* RELEASE PAD _MSM_SYSTM OF _MSYSMENU
*!* RELEASE PAD _MSM_TEXT OF _MSYSMENU
******************
Source='\OutSourcing'
******************
_Path = SYS(5)+SYS(2003)
_Path = LEFT(_Path,LEN(_Path)-7)
PATH_SYS = _Path+'system'
PATH_HUMAN = _Path
PRE_DIR = PATH_HUMAN
USE &PATH_SYS.\maincode
STORE CODEPRO TO CODEPROVINCE
STORE CODEHOSP TO CODEHOSPITAL
STORE benhvien TO Mbenhvien
STORE ALLTRIM(LOAIBV) TO MLOAIBV
STORE DIENTHOAI TO MDIENTHOAI
STORE SOYTE TO MSOYTE
USE
_TITLE = 'Quan ly nhan su'
_ADDRESS = ''
_TELE = MDIENTHOAI
_HTL_LOOP = .T.
******************************
m_ScrRow = SROW()
m_ScrCol = SCOL()
m_Font_Name = 'Vn-Sans-Serif'
m_Font_Size = 10
_SCREEN.ICON = PATH_HUMAN +'picture\ICON01.ico'
_SCREEN.CLOSABLE = .T.
_SCREEN.CAPTION = 'Quan ly nhan su'
_SCREEN.PICTURE = PATH_HUMAN+'picture\nhansu.jpg'
_SCREEN.WINDOWSTATE = 2
SET DEFAULT TO &PATH_HUMAN.\program
SET PROC TO smLib
Show WINDOW ALL
DO LOGIN
DO PATH_HUMAN+'PROGRAM\menuns'
ON KEY LABEL ALT+Q DO Squit1
*!* DO DONG_BAR
*!* DO PHIM
*!* DO WHILE (_HTL_LOOP)
*!* DO HT_DATE
*!* IF LEN(MENU())=0
*!* DO MENUNS
*!* ENDIF
*!* ENDDO
*!* SET SYSMENU TO DEFAULT
*!* _SCREEN.BACKCOLOR = RGB(255, 255, 255)
*!* _SCREEN.PICTURE = ""
*!* Clear
*!* CLOSE DATABASES
*!* QUIT
*!* RETURN
*!* *!* ENDPROC
PROCEDURE LOGIN
RETPASS = .F.
DO FORM PATH_HUMAN+'PROGRAM\fuser'
IF .NOT. RETPASS
QUIT
ENDIF
Release RETPASS
RETURN
ENDPROC
*********************************************************
FUNCTION HideToolBar
*-- Releases all Visual FoxPro toolbars
LOCAL i
TB_FORMDESIGNER_LOC = "Form Designer"
TB_STANDARD_LOC = "Standard"
TB_LAYOUT_LOC = "Layout"
TB_QUERY_LOC = "Query Designer"
TB_VIEWDESIGNER_LOC = "View Designer"
TB_COLORPALETTE_LOC = "Color Palette"
TB_FORMCONTROLS_LOC = "Form Controls"
TB_DATADESIGNER_LOC = "Database Designer"
TB_REPODESIGNER_LOC = "Report Designer"
TB_REPOCONTROLS_LOC = "Report Controls"
TB_PRINTPREVIEW_LOC = "Print Preview"
WIN_COMMAND_LOC = "Command" && Command Window
WIN_PROJECT_MAN = "Project Manager"
DIMENSION aToolBars [13,2]
aToolBars[1,1] = TB_FORMDESIGNER_LOC
aToolBars[2,1] = TB_STANDARD_LOC
aToolBars[3,1] = TB_LAYOUT_LOC
aToolBars[4,1] = TB_QUERY_LOC
aToolBars[5,1] = TB_VIEWDESIGNER_LOC
aToolBars[6,1] = TB_COLORPALETTE_LOC
aToolBars[7,1] = TB_FORMCONTROLS_LOC
aToolBars[8,1] = TB_DATADESIGNER_LOC
aToolBars[9,1] = TB_REPODESIGNER_LOC
aToolBars[10,1] = TB_REPOCONTROLS_LOC
aToolBars[11,1] = TB_PRINTPREVIEW_LOC
aToolBars[12,1] = WIN_COMMAND_LOC
aToolBars[13,1] = WIN_PROJECT_MAN
FOR i = 1 TO ALEN(aToolBars, 1)
aToolBars[i,2] = WVISIBLE(aToolBars[i,1])
IF aToolBars[i,2]
HIDE WINDOW (aToolBars[i,1])
ENDIF
ENDFOR
Return
PROC RE_FOX
IF FILE("RESET.PRG")
DO RESET
ENDIF
RETURN
FUNCTION Squit1
_SCREEN.BACKCOLOR=RGB(255,255,255)
CLEAR EVENTS
IF FILE("RESET.PRG")
DO RESET
ENDIF
RETURN
-----------------------------------
File:menuns.prg
*!* Ngoi Viet:Hong Tu.
_MEXIT = .F.
SET SYSMENU TO
SET SYSMENU AUTOMATIC
DO WHILE .NOT. _MEXIT
DEFINE PAD HUMAN OF _MSYSMENU PROMPT "\<A. Can bo" KEY ALT+A, "" COLOR SCHEME 3
DEFINE PAD PAYROLL OF _MSYSMENU PROMPT "\<B. Lao dong - Tien luong" KEY ALT+C, "" COLOR SCHEME 3
DEFINE PAD TRUYVAN OF _MSYSMENU PROMPT "\<C. Truy van" KEY ALT+B, "" COLOR SCHEME 3
DEFINE PAD HETHONG OF _MSYSMENU PROMPT "\<D. He thong" KEY ALT+D, "" COLOR SCHEME 3
ON PAD HUMAN OF _MSYSMENU ACTIVATE POPUP _HUMAN
ON PAD TRUYVAN OF _MSYSMENU ACTIVATE POPUP _TRUYVAN
ON PAD PAYROLL OF _MSYSMENU ACTIVATE POPUP _PAYROLL
ON PAD HETHONG OF _MSYSMENU ACTIVATE POPUP _HETHONG
DEFINE POPUP _HUMAN SHADOW MARGIN RELATIVE COLOR SCHEME 4
******************
DEFINE BAR 1 OF _HUMAN PROMPT "\<1. Ly lich nhan vien"
DEFINE BAR 2 OF _HUMAN PROMPT "\-"
DEFINE BAR 3 OF _HUMAN PROMPT "\<2. In ly lich"
DEFINE BAR 4 OF _HUMAN PROMPT "\<3. In ly lich trich ngang"
* DEFINE BAR 5 OF _HUMAN PROMPT "\<4. In lý lịch, quá trình đào tạo, gia cảnh"
DEFINE BAR 6 OF _HUMAN PROMPT "\-"
DEFINE BAR 7 OF _HUMAN PROMPT "\<5. Danh sach cong nhan vien"
DEFINE BAR 8 OF _HUMAN PROMPT "\<6. Danh sach con cai CB-CNV"
DEFINE BAR 9 OF _HUMAN PROMPT "\<7. Qua trinh cong tac"
DEFINE BAR 10 OF _HUMAN PROMPT "\<8. Danh sach nhan vien moi nghi viec"
*!* DEFINE BAR 11 OF _HUMAN PROMPT "\<9. Thống kê nhân sự"
ON SELECTION BAR 1 OF _HUMAN DO FORM FLLNV
ON SELECTION BAR 3 OF _HUMAN DO FORM LYLICH
ON SELECTION BAR 4 OF _HUMAN DO FORM LLTN
* ON SELECTION BAR 5 OF _HUMAN DO FORM B_GROUND
ON SELECTION BAR 7 OF _HUMAN DO FORM DSNV
ON SELECTION BAR 8 OF _HUMAN DO FORM NS133
ON SELECTION BAR 9 OF _HUMAN DO FORM NS132
ON SELECTION BAR 10 OF _HUMAN DO FORM NVMOI
*!* ON SELECTION BAR 11 OF _HUMAN DO FORM NS131
******************
DEFINE POPUP _PAYROLL SHADOW MARGIN RELATIVE COLOR SCHEME 4
DEFINE BAR 1 OF _PAYROLL PROMPT "\<1. Bang cham cong CB - CNV hang thang"
DEFINE BAR 2 OF _PAYROLL PROMPT "\<2. Bang tinh luong CB - CNV hang thang"
DEFINE BAR 3 OF _PAYROLL PROMPT "\-"
DEFINE BAR 4 OF _PAYROLL PROMPT "\<3. Danh sach lao dong cap so BHXH"
DEFINE BAR 5 OF _PAYROLL PROMPT "\<4. Danh sach CB - CNV de nghi nang luong"
DEFINE BAR 6 OF _PAYROLL PROMPT "\<5. Thong ke lao dong tien luong"
ON SELECTION BAR 1 OF _PAYROLL DO Luong_nv
ON SELECTION BAR 2 OF _PAYROLL DO Luong-in
ON SELECTION BAR 4 OF _PAYROLL DO FORM LD244
ON SELECTION BAR 5 OF _PAYROLL DO FORM LD2471
ON SELECTION BAR 6 OF _PAYROLL DO FORM LD249
******************
DEFINE POPUP _TRUYVAN SHADOW MARGIN RELATIVE COLOR SCHEME 4
DEFINE BAR 1 OF _TRUYVAN PROMPT "\<1. Do tuoi trung binh"
DEFINE BAR 2 OF _TRUYVAN PROMPT "\<2. Muc luong binh quan"
DEFINE BAR 3 OF _TRUYVAN PROMPT "\<3. Thong ke tinh trang gia dinh"
DEFINE BAR 4 OF _TRUYVAN PROMPT "\<4. Tinh hinh cong viec"
DEFINE BAR 5 OF _TRUYVAN PROMPT "\<5. Nghe nghiep dao tao"
DEFINE BAR 6 OF _TRUYVAN PROMPT "\<6. Gia canh"
DEFINE BAR 7 OF _TRUYVAN PROMPT "\<7. Di nuoc ngoai"
ON SELECTION BAR 1 OF _TRUYVAN DO FORM NS127
ON SELECTION BAR 2 OF _TRUYVAN DO FORM NS128
ON SELECTION BAR 3 OF _TRUYVAN DO FORM NS129
ON SELECTION BAR 4 OF _TRUYVAN DO FORM NS121
ON SELECTION BAR 5 OF _TRUYVAN DO FORM NS122
ON SELECTION BAR 6 OF _TRUYVAN DO FORM NS124
ON SELECTION BAR 7 OF _TRUYVAN DO FORM NS126
******************
DEFINE POPUP _HETHONG SHADOW MARGIN RELATIVE COLOR SCHEME 4
DEFINE BAR 1 OF _HETHONG PROMPT "\<1. Cai dat font chu"
* DEFINE BAR 1 OF _HETHONG PROMPT "\<1. Danh muc"
DEFINE BAR 2 OF _HETHONG PROMPT "\<2. Danh muc cac tinh, thanh pho"
DEFINE BAR 3 OF _HETHONG PROMPT "\<3. Ma ngach cong chuc"
DEFINE BAR 4 OF _HETHONG PROMPT "\-"
DEFINE BAR 5 OF _HETHONG PROMPT "\<4. Quan ly mat khau"
DEFINE BAR 6 OF _HETHONG PROMPT "\-"
DEFINE BAR 7 OF _HETHONG PROMPT "\<5. Bao tri va backup so lieu"
DEFINE BAR 8 OF _HETHONG PROMPT "\-"
DEFINE BAR 9 OF _HETHONG PROMPT "\<6. Ket thuc"
_pIs = PATH_HUMAN + [font\]
ON SELECTION BAR 1 OF _HETHONG DO InstFont WITH _pIs IN installfont
ON SELECTION BAR 2 OF _HETHONG DO Btd
ON SELECTION BAR 3 OF _HETHONG DO FORM FMANGACH
ON SELECTION BAR 5 OF _HETHONG DO PRGMS
ON SELECTION BAR 7 OF _HETHONG DO Backup
ON SELECTION BAR 9 OF _HETHONG DO HT_EXIT
ACTIVATE MENU _MSYSMENU
ENDDO
ENDPROC
--------------------------------
File:prgms.prg
CLOSE TABLE ALL
PASSWORD = PATH_HUMAN+'\data\PWHUMAN.DBF'
DBF_TEMP = SYS(2023)+'\'+RIGHT(SYS(2015), 8)+'.DBF'
PRIVATE MUSR_NAME, J, PSW1, PSW2, MRECNO
STORE '' TO MUSR_NAME, PSW1, PSW2, MPOS
STORE 0 TO J, MRECNO
IF .NOT. FILE(PASSWORD)
CREATE TABLE (PASSWORD) (USER_NAME C (40), PASSWORD C (30), CHUCDANH C (30))
USE
ENDIF
SELECT 0
USE (PASSWORD) ALIAS PASSWORD
COPY TO (DBF_TEMP) STRUCTURE
SELECT 0
USE (DBF_TEMP) ALIAS TEMP
DO READ_PSW
FRMPW = CREATEOBJECT('PSW_IN')
FRMPW.SHOW(1)
CLOSE TABLE ALL
ERASE (DBF_TEMP)
RETURN
ENDPROC
DEFINE CLASS psw_in AS FORM
SCALEMODE = 0
HEIGHT = 12
WIDTH = 70
ICON = Path_human + 'Picture\User'
BACKCOLOR = RGB(192, 192, 192)
BORDERSTYLE = 2
WINDOWTYPE = 1
AUTOCENTER = .T.
SHOWTIPS = .T.
CONTROLBOX = .F.
USER_NAME = ''
ADD OBJECT LBLNAME AS LABEL WITH FONTNAME = '.VnAvant', TOP = 2.25, LEFT = 2, HEIGHT = 1.2, WIDTH = 15.0, BACKCOLOR = RGB(192, 192, 192), FORECOLOR = RGB(0, 0, 160)
ADD OBJECT CBOUSR_NAME AS COMBOBOX WITH TOP = 2, LEFT = 19.0, HEIGHT = 1.7, WIDTH = 25.0, INPUTMASK = 'XXXXXXXXXXXXXXX', FONTNAME = '.VnAvant', FONTSIZE = 9, COLUMNCOUNT = 1, COLUMNWIDTHS = '12', FIRSTELEMENT = 1, STYLE = 2, ROWSOURCETYPE = 2, ROWSOURCE = 'USER_NAME.USER_NAME', CONTROLSOURCE = 'USER_NAME'
ADD OBJECT CMDHIEUCHINH AS COMMANDBUTTON WITH FONTNAME = '.VnAvant', TOP = 1, LEFT = 50, HEIGHT = 1.8, WIDTH = 15, BACKCOLOR = RGB(192, 192, 192), FORECOLOR = RGB(0, 0, 160)
*
PROCEDURE cmdHIEUCHINH.click
LOCAL FRMCHANGE
FRMCHANGE = CREATEOBJECT('EDIT_FRM')
FRMCHANGE.BORDERSTYLE = 2
FRMCHANGE.SHOW(1)
IF PSW1=PSW2 .AND. FREPEAT
REPLACE PASSWORD WITH PSW2
THISFORM.REFRESH
ELSE
WAIT WINDOW TIMEOUT 0.5 'Mat khau khong thay doi !'
ENDIF
RELEASE EDIT_FRM
THISFORM.REFRESH
ENDPROC
ADD OBJECT CMDTHEM AS COMMANDBUTTON WITH FONTNAME = '.VnAvant', TOP = 3, LEFT = 50, HEIGHT = 1.8, WIDTH = 15, BACKCOLOR = RGB(192, 192, 192), FORECOLOR = RGB(0, 0, 160)
*-------------------------------------------------------------------------------------
PROCEDURE cmdTHEM.Click
LOCAL FRMADD
FRMADD = CREATEOBJECT('ADD_FRM')
FRMADD.SHOW(1)
IF PSW1=PSW2 .AND. .NOT. EMPTY(MUSR_NAME)
SELECT USER_NAME
APPEND BLANK
REPLACE USER_NAME WITH MUSR_NAME, PASSWORD WITH PSW2, CHUCDANH WITH MPOS
ELSE
WAIT WINDOW TIMEOUT 0.5 'Khong the them'
ENDIF
RELEASE ADD_FRM
THISFORM.REFRESH
THISFORM.CBOUSR_NAME.REFRESH
ENDPROC
ADD OBJECT CMDXOA AS COMMANDBUTTON WITH FONTNAME = '.VnAvant', TOP = 5, LEFT = 50, HEIGHT = 1.8, WIDTH = 15, BACKCOLOR = RGB(192, 192, 192), FORECOLOR = RGB(0, 0, 160)
*-------------------------------------------------------------------------------------
PROCEDURE cmdXOA.click
LOCAL MREC, MRECLUU
SELECT USER_NAME
MRECLUU = RECNO()
COUNT FOR .NOT. DELETED() TO MREC
GOTO MRECLUU
IF MREC>1
LOCAL FRMDELETE
FRMDELETE = CREATEOBJECT('DEL_FRM')
FRMDELETE.SHOW(1)
RELEASE DEL_FRM
THISFORM.REFRESH
ELSE
WAIT WINDOW TIMEOUT 0.5 'Khong cho phep huy !'
ENDIF
ENDPROC
ADD OBJECT CMDDONGY AS COMMANDBUTTON WITH FONTNAME = '.VnAvant', TOP = 7, LEFT = 50, HEIGHT = 1.8, WIDTH = 15, BACKCOLOR = RGB(192, 192, 192), FORECOLOR = RGB(0, 0, 160), CANCEL = .T.
*-------------------------------------------------------------------------------------
PROCEDURE cmdDONGY.Click
RELEASE THISFORM
ENDPROC
*-------------------------------------------------------------------------------------
PROCEDURE load
SELECT 0
USE (DBF_TEMP) ALIAS USER_NAME
ENDPROC
*-------------------------------------------------------------------------------------
PROCEDURE init
PUBLIC FREPEAT
FREPEAT = .T.
THIS.CAPTION = 'Quan ly mat khau'
THIS.LBLNAME.CAPTION = 'Người dùng'
THIS.CMDHIEUCHINH.CAPTION = '\<Sửa'
THIS.CMDTHEM.CAPTION = '\<Thêm'
THIS.CMDXOA.CAPTION = '\<Hủy'
THIS.CMDDONGY.CAPTION = 'Th\<oát'
ENDPROC
PROCEDURE destroy
USE IN USER_NAME
DO UPD_PAS
RELEASE FREPEAT
ENDPROC
ENDDEFINE
*-------------------------------------------------------------------------------------
DEFINE CLASS ASK_FRM AS FORM
SCALEMODE = 0
MAXBUTTON = .F.
MINBUTTON = .F.
CONTROLBOX = .F.
WINDOWTYPE = 1
ICON = Path_human + 'Picture\User'
TOP = 2
LEFT = 2
HEIGHT = 4
WIDTH = 42
AUTOCENTER = .T.
BACKCOLOR = RGB(192, 192, 192)
BORDERSTYLE = 2
ENDDEFINE
*
DEFINE CLASS EDIT_FRM AS ASK_FRM
ADD OBJECT TXTMATMA AS TEXTBOX WITH TOP = 1, LEFT = 22, HEIGHT = 1.6, WIDTH = 18, PASSWORDCHAR = '*'
*
PROCEDURE txtmatma.Valid
IF UPPER(ALLTRIM(THISFORM.TXTMATMA.VALUE))==UPPER(ALLTRIM(USER_NAME.PASSWORD))
RELEASE THISFORM
LOCAL FRMNEWPSW
FRMNEWPSW = CREATEOBJECT('NEWPSW_FRM')
FRMNEWPSW.SHOW(1)
ELSE
WAIT WINDOW TIMEOUT 0.5 'Mat khau khong thay doi ! '
FREPEAT = .F.
RELEASE THISFORM
ENDIF
ENDPROC
ADD OBJECT LBLTEN AS LABEL WITH FONTNAME = '.VnAvant', TOP = 1.25, LEFT = 0, HEIGHT = 1, WIDTH = 20, BACKCOLOR = RGB(192, 192, 192), FORECOLOR = RGB(0, 0, 160)
*
PROCEDURE init
THIS.CAPTION = 'Thay doi mat khau'
THIS.LBLTEN.CAPTION = 'Mật khẩu củ :'
ENDPROC
ENDDEFINE
*
DEFINE CLASS NEWPSW_FRM AS EDIT_FRM
*
PROCEDURE txtmatma.Valid
PSW1 = UPPER(ALLTRIM(THISFORM.TXTMATMA.VALUE))
RELEASE THISFORM
LOCAL FRMREPSW
FRMREPSW = CREATEOBJECT('REPSW_FRM')
FRMREPSW.SHOW(1)
ENDPROC
ADD OBJECT LBLTENMOI AS LABEL WITH FONTNAME = '.VnAvant', TOP = 1.25, LEFT = 0, HEIGHT = 1.25, WIDTH = 21, BACKCOLOR = RGB(192, 192, 192), FORECOLOR = RGB(0, 0, 160)
*
PROCEDURE init
THIS.CAPTION = 'Mat khau moi'
THIS.LBLTENMOI.CAPTION = 'Mật khẩu mới'
ENDPROC
ENDDEFINE
*-------------------------------------------------------------------------------------
DEFINE CLASS REPSW_FRM AS EDIT_FRM
PROCEDURE INIT
THISFORM.TXTMATMA.LEFT = 22
THISFORM.CAPTION = 'Lap lai mat khau'
THISFORM.LBLTENLAI.CAPTION = 'Lập lại mật khẩu'
ENDPROC
*-------------------------------------------------------------------------------------
PROCEDURE txtmatma.Valid
PSW2 = UPPER(ALLTRIM(THISFORM.TXTMATMA.VALUE))
RELEASE THISFORM
ENDPROC
ADD OBJECT LBLTENLAI AS LABEL WITH FONTNAME = '.VnAvant', TOP = 1.25, LEFT = 0, HEIGHT = 1.25, WIDTH = 22, BACKCOLOR = RGB(192, 192, 192), FORECOLOR = RGB(0, 0, 160)
ENDDEFINE
*-------------------------------------------------------------------------------------
DEFINE CLASS ADD_FRM AS PASS_FRM
CONTROLBOX = .F.
PROCEDURE txtNAME.Valid
LOCATE FOR USER_NAME=THISFORM.TXTNAME.VALUE
IF FOUND()
RELEASE THISFORM
ELSE
MUSR_NAME = ALLTRIM(THISFORM.TXTNAME.VALUE)
ENDIF
ENDPROC
*-------------------------------------------------------------------------------------
PROCEDURE txtCODE.Valid
PSW1 = UPPER(ALLTRIM(THISFORM.TXTCODE.VALUE))
ENDPROC
*-------------------------------------------------------------------------------------
PROCEDURE txtPOS.Valid
MPOS = THISFORM.TXTPOS.VALUE
LOCAL FRMREADDPSW
FRMREADDPSW = CREATEOBJECT('READDPSW_FRM')
FRMREADDPSW.SHOW(1)
RELEASE THISFORM
ENDPROC
*-------------------------------------------------------------------------------------
PROCEDURE init
THIS.CAPTION = 'Them'
THIS.LBLNAME.CAPTION = 'Người dùng :'
THIS.LBLCODE.CAPTION = 'Mật khẩu :'
THIS.LBLPOS.CAPTION = 'Chức danh:'
ENDPROC
ENDDEFINE
*-------------------------------------------------------------------------------------
DEFINE CLASS READDPSW_FRM AS PASS_FRM
CONTROLBOX = .F.
PROCEDURE init
THIS.LBLCODE.CAPTION = 'Lập lại'
THIS.LBLNAME.CAPTION = 'Người dùng :'
THIS.CAPTION = 'Them'
THIS.TXTCODE.TABINDEX = 1
THIS.TXTNAME.TABINDEX = 2
THIS.TXTNAME.VALUE = MUSR_NAME
THIS.TXTPOS.VALUE = MPOS
THIS.TXTNAME.ENABLED = .F.
THIS.TXTPOS.ENABLED = .F.
ENDPROC
PROCEDURE txtCODE.Valid
PSW2 = UPPER(ALLTRIM(THISFORM.TXTCODE.VALUE))
RELEASE THISFORM
ENDPROC
ENDDEFINE
*-------------------------------------------------------------------------------------
DEFINE CLASS DEL_FRM AS EDIT_FRM
PROCEDURE init
THIS.CAPTION = 'Huy'
THIS.LBLTEN.CAPTION = 'Mật khẩu củ :'
ENDPROC
*-------------------------------------------------------------------------------------
PROCEDURE txtmatma.Valid
IF UPPER(ALLTRIM(THISFORM.TXTMATMA.VALUE))==UPPER(ALLTRIM(USER_NAME.PASSWORD))
SELECT USER_NAME
DELETE
GOTO TOP
THISFORM.REFRESH
WAIT WINDOW TIMEOUT 0.5 'Đã hủy !'
ELSE
WAIT WINDOW TIMEOUT 0.5 'Không thể hủy !'
ENDIF
RELEASE THISFORM
ENDPROC
ENDDEFINE
*-------------------------------------------------------------------------------------
DEFINE CLASS pass_frm AS FORM
SCALEMODE = 0
MAXBUTTON = .F.
MINBUTTON = .F.
CONTROLBOX = .F.
CLOSABLE = .F.
HEIGHT = 10
WIDTH = 45
BACKCOLOR = RGB(192, 192, 192)
BORDERSTYLE = 2
WINDOWTYPE = 1
AUTOCENTER = .T.
SHOWTIPS = .T.
*-------------------------------------------------------------------------------------
PROCEDURE init
THIS.CAPTION = 'Access level definition'
THIS.LBLNAME.CAPTION = 'Người dùng :'
THIS.LBLCODE.CAPTION = 'Mật khẩu :'
THIS.LBLPOS.CAPTION = 'Chức danh:'
ENDPROC
ADD OBJECT TXTNAME AS TEXTBOX WITH FONTNAME = 'Arial', TOP = 1.0, LEFT = 18.0, HEIGHT = 1.5, WIDTH = 25.0, INPUTMASK = 'XXXXXXXXXXXXXXXXXXXXXXXXX'
ADD OBJECT TXTCODE AS TEXTBOX WITH FONTNAME = 'Arial', TOP = 3.0, LEFT = 18.0, HEIGHT = 1.5, WIDTH = 25.0, PASSWORDCHAR = '*'
ADD OBJECT TXTPOS AS TEXTBOX WITH FONTNAME = '.VnAvant', TOP = 5.0, LEFT = 18.0, HEIGHT = 1.5, WIDTH = 25.0, INPUTMASK = 'XXXXXXXXXXXXXXX'
ADD OBJECT LBLNAME AS LABEL WITH FONTNAME = '.VnAvant', TOP = 1.25, LEFT = 1, HEIGHT = 1.2, WIDTH = 16.0, BACKCOLOR = RGB(192, 192, 192), FORECOLOR = RGB(0, 0, 160), CAPTION = 'Người dùng :'
ADD OBJECT LBLCODE AS LABEL WITH FONTNAME = '.VnAvant', TOP = 3.25, LEFT = 1, HEIGHT = 1.2, WIDTH = 16, BACKCOLOR = RGB(192, 192, 192), FORECOLOR = RGB(0, 0, 160), CAPTION = 'Mật khẩu :'
ADD OBJECT LBLPOS AS LABEL WITH FONTNAME = '.VnAvant', TOP = 5.25, LEFT = 1, HEIGHT = 1.2, WIDTH = 16, BACKCOLOR = RGB(192, 192, 192), FORECOLOR = RGB(0, 0, 160), CAPTION = 'Chức danh :'
ADD OBJECT CMD1 AS COMMANDBUTTON WITH CAPTION = '\<Ok', TOP = 7.5, LEFT = 13.0, HEIGHT = 1.8, WIDTH = 10.0, FORECOLOR = RGB(0, 0, 160)
ADD OBJECT CMD2 AS COMMANDBUTTON WITH CAPTION = '\<Cancel', TOP = 7.5, LEFT = 24.0, HEIGHT = 1.8, WIDTH = 10.0, FORECOLOR = RGB(0, 0, 160), CANCEL = .T.
*
PROCEDURE cmd1.click
RELEASE THISFORM
ENDPROC
PROCEDURE cmd2.click
RELEASE THISFORM
ENDPROC
ENDDEFINE
*-------------------------------------------------------------------------------------
PROCEDURE read_psw
SELECT PASSWORD
SCAN
INSERT INTO TEMP VALUES (PASSWORD.USER_NAME, DECODE(PASSWORD.PASSWORD), PASSWORD.CHUCDANH)
ENDSCAN
USE IN PASSWORD
USE IN TEMP
ENDPROC
*-------------------------------------------------------------------------------------
FUNCTION decode
PARAMETER S
PRIVATE S1, I, C
S1 = ""
S = ALLTRIM(S)
FOR I = 1 TO LEN(S)
C = ASC(SUBSTR(S, I, 1))
S1 = S1+CHR(IIF(MOD(C, 2)=0, C-128, C-96))
ENDFOR
RETURN S1
ENDFUNC
*-------------------------------------------------------------------------------------
FUNCTION ENCODE
PARAMETER S
PRIVATE S1, I, C
S1 = ""
S = ALLTRIM(S)
FOR I = 1 TO LEN(S)
C = ASC(UPPER(SUBSTR(S, I, 1)))
S1 = S1+CHR(IIF(MOD(C, 2)=0, C+128, C+96))
ENDFOR
RETURN S1
ENDFUNC
*-------------------------------------------------------------------------------------
PROCEDURE UPD_PAS
SELECT 0
USE EXCLUSIVE (PASSWORD) ALIAS PASSWORD
DELE ALL
PACK
SELECT 0
USE (DBF_TEMP) ALIAS TEMP
SCAN FOR .NOT. DELETED() .AND. .NOT. EMPTY(USER_NAME)
INSERT INTO PASSWORD VALUES (TEMP.USER_NAME, ENCODE(TEMP.PASSWORD), TEMP.CHUCDANH)
ENDSCAN
USE IN PASSWORD
USE IN TEMP
ENDPROC
-------------------
File:reset.prg
CLEAR PROG ALL
CLOS DATA ALL
CLOS ALL
RELE ALL
CLEAR ALL
CLEA
ON SHUTDOWN
ON KEY
ON ERROR
= NUMLOCK(.F.)
_RMARGIN = 255
_PEJECT = [NONE]
* SET RESO ON
SET HELP ON
SET CONFIRM OFF
SET DATE FRENCH
SET DELETE ON
SET ESCAPE ON
SET EXACT OFF
SET EXCLUSIVE OFF
SET HOUR TO 24
SET NEAR ON
SET PRINT OFF
SET STAT BAR ON
SET SAFE OFF
SET TALK OFF
SET REFRESH TO 1,1
REST MACRO
SET SYSMENU ON
SET SYSMENU TO DEFA
*!* CANCEL &&De thoat khoi Read Event
------------------------------
File: smlib.PRG
*---------------------
* Nguoi Viet: Hong Tu.
* Dinh nghia cua so Win
PROCEDURE Window
PARA IconName
IF PARA()<1
IconName = 'ICON01.ico'
ENDIF
*!* FLOOR(m_ScrRow) - 2, FLOOR(m_ScrCoL) = 30, 133
*!* DEFINE WINDOW m_WinBrw FROM 2, 0 TO FLOOR(m_ScrRow) - 2, FLOOR(m_ScrCoL) COLOR SCHEME 10 ;
*!* CLOSE FLOAT GROW MINIMIZE ZOOM SYSTEM FONT m_Font_Name, m_Font_Size - 2 ;
*!* ICON FILE LOCFILE(SYS(5)+ SOURCE +'\human\picture\' + IconName)
m_Font_Name = 'Vn-Sans-Serif'
m_Font_Size = 10
DEFINE WINDOW M_WinBrw FROM 02, 0 TO FLOOR(M_ScrRow) - 2, FLOOR(M_ScrCoL) COLOR SCHEME 10 ;
CLOSE FLOAT GROW MINIMIZE ZOOM SYSTEM FONT m_Font_Name, m_Font_Size - 2 ;
ICON FILE LOCFILE(path_human+'Picture\ICON01.ico')
RETURN
*---------------------
* Xoa cua so Win
PROCEDURE Rel_Window
RELEASE WINDOW m_WinBrw
RETURN
*---------------------
* Doi mau cua ban ghi trong man hinh browse
FUNCTION Change_Color_Of_Browse(nRecord,cOldDynamicBackColor)
RETURN oBrowse.SetAll("DynamicBackColor","IIF(RECNO()="+STR(nRecord)+",13172190,"+;
IIF(EMPTY(cOldDynamicBackColor),"''",cOldDynamicBackColor)+")","Column")
* ........................... Procedure: K_TagUn ........................
* Bo danh dau tat ca cac dong
PROCEDURE K_TagUn
PRIVATE _Recno
PUSH KEY CLEAR
_Recno = RECNO()
REPLACE ALL TAG WITH " "
GO _Recno
POP KEY
RETURN
* ........................... Procedure: K_TagAll ........................
* Danh dau tat ca cac dong
PROCEDURE K_TagAll
PRIVATE _Recno
PUSH KEY CLEAR
_Recno = RECNO()
REPLACE ALL TAG WITH "x"
GO _Recno
POP KEY
RETURN
* ........................... Procedure: K_Tag ...........................
* danh dau/Bo danh dau mot dong
PROCEDURE K_Tag
PUSH KEY CLEAR
IF EMPTY(TAG)
REPLACE TAG WITH "x"
ELSE
REPLACE TAG WITH " "
ENDI
POP KEY
RETURN
*......................... Hàm đổi số ............................
* Doi so thanh chu de in chung tu
FUNCTION DOI_SO_CHU
PARAMETER So, DonViTinh, Doc_So_Bon
* SO: So can doi
* DonViTinh: Don vi tinh khi doc thanh chu (VND, USD,...)
* Doc_So_Bon: Doc so 4 la "bon" hay "tu" , neu = [T] - [tu], nguoc lai la [bon]
PRIVATE SoChu
IF PARAMETER() < 3
Doc_So_Bon = []
ENDIF
IF PARAMETER() < 2
DonViTinh = []
ENDIF
Tu_Bon = ' bốn'
IF UPPER(Doc_So_Bon) = 'T'
Tu_Bon = ' tư'
ENDIF
DIMENSION MangChuSo( 10 )
STOR [ không] TO MangChuSo(1)
STOR [ một] TO MangChuSo(2)
STOR [ hai] TO MangChuSo(3)
STOR [ ba] TO MangChuSo(4)
STOR [ bốn] TO MangChuSo(5)
STOR [ năm] TO MangChuSo(6)
STOR [ sáu] TO MangChuSo(7)
STOR [ bảy] TO MangChuSo(8)
STOR [ tám] TO MangChuSo(9)
STOR [ chín] TO MangChuSo(10)
SoChu = []
IF So < 0
So = - So
SoChu = SoChu + " âm"
ENDIF
So_sau_dau_phay = So - INT(So)
****Doc phan nguyen truoc
So = INT(So)
&&Vi ben duoi co doan S = LEFT(ALLT(S), LEN(ALLT(S)) - 1) ;
&& cho nen phai cho so 0 vao de neu doc so 0 thi no khong bi mat chu "g"
IF So = 0
SoChu = SoChu + " " + 'không0'
ELSE
&&Cong them cac so khong vao dang truoc chuoi de duoc chan cac to hop 3 so
So = ALLT(STR(So,16))
IF MOD(LEN(So) , 3 ) = 1
So = '00' + So
ENDIF
IF MOD(LEN (So), 3 ) = 2
So = '0' + So
ENDIF
So_Nhom = LEN(So)/3
Stt_Nhom = So_Nhom
Stt_So = 1
&&Doc theo tung nhom 3 so
DO WHILE Stt_So <= (LEN(So) - 2) &&Cho den vi tri cua chu so dau tien cua nhom cuoi cung
So_Phu = SUBSTR(So, Stt_So, 3)
Stt_Nhom = ROUND((LEN(So) - Stt_So +1) / 3, 0)
IF LEN(DOI_SO_CHU_NHOM(So_Phu, Stt_Nhom, So_Nhom)) > 0
IF Stt_Nhom < 5 &&Nho hon mot ty thi phai cng them dau phay
SoChu = SoChu + DOI_SO_CHU_NHOM(So_Phu, Stt_Nhom, So_Nhom) + [,]
ELSE
SoChu = SoChu + DOI_SO_CHU_NHOM(So_Phu, Stt_Nhom, So_Nhom)
ENDIF
ELSE
SoChu = SoChu + DOI_SO_CHU_NHOM(So_Phu, Stt_Nhom, So_Nhom)
ENDIF
Stt_So = Stt_So + 3
ENDDO
ENDIF
SoChu = LEFT(ALLT(SoChu), LEN(ALLT(SoChu)) - 1)
****Doc phan thap phan
* Neu chu so dau tien sau dau phay khac khong thi doc nhu phan so nguyen
IF So_sau_dau_phay > 0
SoChu = SoChu + " phẩy"
So_sau_dau_phay = ALLTR(STR(So_sau_dau_phay, 8, 6)) &&Chi doc den 6 chu so sau dau phay
So_sau_dau_phay = SUBS(So_sau_dau_phay, 3, LEN(So_sau_dau_phay) - 2) &&Cat lay phan sau dau phay
IF LEFT(So_sau_dau_phay, 1) '0'
&&Cat nhung so 0 o ben phai do STR() di
DO WHILE RIGHT(So_sau_dau_phay, 1) = '0'
So_sau_dau_phay = LEFT(So_sau_dau_phay, LEN(So_sau_dau_phay) - 1)
ENDDO
&&Cong them cac so khong vao dang truoc chuoi de duoc chan cac to hop 3 so
IF MOD(LEN(So_sau_dau_phay) , 3 ) = 1
So_sau_dau_phay = '00' + So_sau_dau_phay
ENDIF
IF MOD(LEN(So_sau_dau_phay), 3 ) = 2
So_sau_dau_phay = '0' + So_sau_dau_phay
ENDIF
So_Nhom = ROUND(LEN(So_sau_dau_phay) / 3,0)
Stt_Nhom = So_Nhom
Stt_So = 1
&&Doc theo tung nhom 3 so
DO WHILE Stt_So <= (LEN(So_sau_dau_phay) - 2)&&Cho den vi tri cua chu so dau tien cua nhom cuoi cung
So_Phu = SUBSTR(So_sau_dau_phay, Stt_So, 3)
Stt_Nhom = ROUND ((LEN (So_sau_dau_phay) - Stt_So +1) / 3,0)
SoChu = SoChu + DOI_SO_CHU_NHOM( So_Phu, Stt_Nhom, So_Nhom)
Stt_So = Stt_So + 3
ENDDO
ELSE
* Neu chu so dau tien sau dau phay = 0 thi doc tung chu so mot
&&Cat nhung so 0 o ben phai do STR() di
DO WHILE RIGHT(So_sau_dau_phay, 1) = '0'
So_sau_dau_phay = LEFT(So_sau_dau_phay, LEN(So_sau_dau_phay) - 1)
ENDDO
&&Doc lan luot tung chu so sau dau phay
FOR i =1 TO LEN(So_sau_dau_phay)
j = SUBS(So_sau_dau_phay, i, 1)
SoChu = SoChu + MangChuSo(VAL(j) +1 )
ENDFOR
ENDIF
ENDIF
SoChu = ALLTR(UPPER(LEFT(SoChu, 1)) + SUBS(SoChu, 2) + [ ] + DonViTinh)
RETURN SoChu
*......................... Function DOI_SO_CHU_NHOM ............................
FUNCTION DOI_SO_CHU_NHOM
PARAMETER Nhom_So, Stt_Nhom, So_Nhom
* Nhom_So: Nhom 3 so can doc
* Stt_Nhom: Stt cua nhom trong tong so cac nhom
* So_Nhom: Tong so nhom cua so can doc
PRIVATE Tram, Chuc, Don_Vi, Tram_Chu, Chuc_Chu, Don_Vi_Chu, Nhom_Chu
Nhom_Chu = ''
Tram = LEFT(Nhom_So,1)
Chuc = SUBSTR(Nhom_So,2,1)
Don_Vi = RIGHT(Nhom_So,1)
Tram_Chu = MangChuSo(VAL(Tram) +1 )
Chuc_Chu = MangChuSo(VAL(Chuc) +1 )
Don_Vi_Chu = MangChuSo(VAL(Don_Vi) +1 )
IF (Tram '0') .OR. ((Stt_Nhom = 1) .AND. (Stt_Nhom < So_Nhom))
Nhom_Chu = Nhom_Chu + Tram_Chu + ' trăm'
ENDIF
IF ALLTR(Chuc_Chu) 'không'
IF ALLTR(Chuc_Chu) 'một'
Nhom_Chu = Nhom_Chu + Chuc_Chu + ' mươi'
IF ALLTR(Don_Vi_Chu) 'năm'
IF ALLTR(Don_Vi_Chu) 'không'
IF ALLTR(Don_Vi_Chu) = 'một'
Nhom_Chu = Nhom_Chu + ' mốt'
ELSE
IF (ALLTR(Don_Vi_Chu) = 'bốn') .AND. (Stt_Nhom > 1)
Nhom_Chu = Nhom_Chu + Tu_Bon
ELSE
Nhom_Chu = Nhom_Chu + Don_Vi_Chu
ENDIF
ENDIF
ENDIF
ELSE
Nhom_Chu = Nhom_Chu + ' lăm'
ENDIF
ELSE
Nhom_Chu = Nhom_Chu + ' mười'
IF ALLTR(Don_Vi_Chu) 'năm'
IF ALLTR(Don_Vi_Chu) 'không'
Nhom_Chu = Nhom_Chu + Don_Vi_Chu
ENDIF
ELSE
Nhom_Chu = Nhom_Chu + ' lăm'
ENDIF
ENDIF
ELSE
IF ALLTR(Don_Vi_Chu) 'không'
Nhom_Chu = Nhom_Chu + ' linh'
IF ALLTR(Don_Vi_Chu) 'bốn'
Nhom_Chu = Nhom_Chu + Don_Vi_Chu
ELSE
Nhom_Chu = Nhom_Chu + Tu_Bon
ENDIF
ENDIF
ENDIF
IF (Tram = '0') .AND. (Chuc = '0') .AND. (Don_Vi '0') .AND. (Stt_Nhom > 1)
Nhom_Chu = Don_Vi_Chu
ENDIF
IF (Tram = '0') .AND. (Chuc = '0') .AND. (Don_Vi '0') .AND. (So_Nhom = 1)
Nhom_Chu = Don_Vi_Chu
ENDIF
DO CASE
CASE Stt_Nhom = 2
Nhom_Chu = Nhom_Chu + ' nghìn'
CASE Stt_Nhom = 3
Nhom_Chu = Nhom_Chu + ' triệu'
CASE Stt_Nhom = 4
Nhom_Chu = Nhom_Chu + ' tỷ'
CASE Stt_Nhom = 5
Nhom_Chu = Nhom_Chu + ' nghìn'
CASE Stt_Nhom = 6
Nhom_Chu = Nhom_Chu + ' triệu'
ENDCASE
IF (Tram = '0') .AND. (Chuc = '0') .AND. (Don_Vi = '0')
Nhom_Chu = ''
ENDIF
RETURN Nhom_Chu
*!* ----------------------------------------
*!* PROCEDURE HookObjectBrowse
*!* ----------------------------------------
PROCEDURE HookObjectBrowse
oBrowse.Tag = ORDER()
oBrowse.Comment = FILTER()
FOR i =1 TO oBrowse.ColumnCount
WITH oBrowse.Columns(i)
cCaption = .Header1.Caption
.RemoveObject("Header1")
.AddObject("Header1", "hdrSort")
.Header1.Tag = .ControlSource
.Header1.Caption = cCaption
ENDWITH
ENDFOR
FOR i =1 TO oBrowse.ColumnCount
WITH oBrowse.Columns(i)
.RemoveObject("Text1")
.AddObject("Text1", "txtSort")
.Text1.Visible = .T.
ENDWITH
ENDFOR
IF oBrowse.Partition > 0
oBrowse.Panellink = .F.
oBrowse.Panel = 0
oBrowse.ScrollBars = 0
oBrowse.Panel = 1
oBrowse.DeleteMark = .F.
oBrowse.RecordMark = .F.
oBrowse.Panellink = .T.
oBrowse.Partition = oBrowse.Partition - 18
ENDIF
ENDPROC
*!* ----------------------------------------
DEFINE CLASS hdrSort AS Header
PROCEDURE Init
THIS.FontName = m_Font_Name
THIS.FontSize = m_Font_Size
THIS.FontBold = .T.
THIS.Alignment = 2
THIS.BackColor = m_Back_color
ENDPROC
PROCEDURE DblClick
IF NOT ISEXCLUSIVE()
RETURN
ENDIF
sIndex = THIS.Tag
IF NOT EMPTY(oBrowse.ToolTipText)
sExecute = "oBrowse." + ALLTRIM(oBrowse.ToolTipText)+ ".Header1.ForeColor = 0"
&sExecute
ENDIF
DO CASE
CASE EMPTY(THIS.Comment)
INDEX ON &sIndex TAG fOrder
THIS.Comment = "1"
THIS.ForeColor = 16711680
CASE THIS.Comment = "1"
INDEX ON &sIndex DESCENDING TAG fOrder
THIS.Comment = "2"
THIS.ForeColor = 16711680
CASE THIS.Comment = "2"
oldOrder = ALLTRIM(oBrowse.Tag)
SET ORDER TO &oldOrder
THIS.Comment = ""
THIS.ForeColor = 0
ENDCASE
oBrowse.Refresh
oBrowse.ToolTipText = THIS.Parent.Name
ENDPROC
ENDDEFINE
*!* ----------------------------------------
DEFINE CLASS txtSort AS TextBox
PROCEDURE Init
THIS.FontName = m_Font_Name
THIS.FontSize = m_Font_Size
THIS.BorderStyle = 0
ENDPROC
PROCEDURE GotFocus
THIS.StatusBarText = ALLTRIM(m_Prompt) + " - " + ALLTRIM(STR(RECNO(), 16)) + "/" + ALLTRIM(STR(RECCOUNT(), 16)) + " " + Cat_dau(ALLTRIM(THIS.Parent.Header1.Caption)) + ": " + Cat_dau(THIS.Text)
ENDPROC
ENDDEFINE
*!* FUNCTION MsgBox(sMessageText,iDialogBoxType,cTitleBarText)
FUNCTION MsgBox
PARAMETER sMessageText,iDialogBoxType,cTitleBarText
PRIVATE OldError
IF VARTYPE(iDialogBoxType) = "C"
cTitleBarText = iDialogBoxType
nDialogBoxType = 0
ELSE
nDialogBoxType = iDialogBoxType
ENDIF
IF EMPTY(m_user_pre)
cMessageText = sMessageText
ELSE
cMessageText = IIF(;
MOD(INT(SECOND()), 2) = 0, ;
m_user_dear + " " + ALLTRIM(m_user_pre), ;
ALLTRIM(m_user_pre) + " ơi") + ", " + sMessageText && , ECode2String('SMLIB0073')))
ENDIF
PRIVATE iReturn
iReturn=0
IF PARAMETER()=1
nDialogBoxType=0
ENDIF
IF PARAMETER()<3
cTitleBarText=_SCREEN.Caption
ENDIF
IF m_Lan "V"
iReturn = MESSAGEBOX(sMessageText,nDialogBoxType,cTitleBarText)
RETURN iReturn
ENDIF
frmSet = CREATEOBJECT('FormSet')
frmSet.WindowType=1
frmSet.AddObject('frmMsg','Form')
frmSet.frmMsg.ControlBox=.F.
frmSet.frmMsg.Height=90
frmSet.frmMsg.BorderStyle=1
frmSet.frmMsg.Caption=cTitleBarText
frmSet.frmMsg.AddObject('mLabel','Label')
frmSet.frmMsg.mLabel.Visible=.T.
frmSet.frmMsg.mLabel.FontName=m_Font_name
frmSet.frmMsg.mLabel.Caption= cMessageText
frmSet.frmMsg.mLabel.Top=15
frmSet.frmMsg.mLabel.Left=50
frmSet.frmMsg.mLabel.Autosize = .T.
frmSet.frmMsg.AddObject('mImage','Image')
frmSet.frmMsg.mImage.Visible=.T.
frmSet.frmMsg.mImage.BackStyle = 0
frmSet.frmMsg.mImage.Top=5
frmSet.frmMsg.mImage.Left=10
frmSet.frmMsg.mImage.Height=20
frmSet.frmMsg.mImage.Width=20
DO CASE
CASE nDialogBoxType<256
iIndex=1
CASE nDialogBoxType<512
iIndex=2
OTHER
iIndex=3
ENDCASE
nDialogBoxType=MOD(nDialogBoxType,256)
DO CASE
CASE MOD(nDialogBoxType,80)<16
frmSet.frmMsg.mImage.Visible=.F.
frmSet.frmMsg.mLabel.Left=20
CASE MOD(nDialogBoxType,80)<32
frmSet.frmMsg.mImage.Picture=k_bmp+"hM04.Bmp"
CASE MOD(nDialogBoxType,80)<48
frmSet.frmMsg.mImage.Picture=k_bmp+"hM01.Bmp"
CASE MOD(nDialogBoxType,80)<64
frmSet.frmMsg.mImage.Picture=k_bmp+"hM02.Bmp"
CASE MOD(nDialogBoxType,80)<80
frmSet.frmMsg.mImage.Picture=k_bmp+"hM03.Bmp"
ENDCASE
frmSet.frmMsg.Width =frmSet.frmMsg.mLabel.Width + 2 * frmSet.frmMsg.mLabel.Left
IF frmSet.frmMsg.Width < 300
frmSet.frmMsg.Width = 300
ENDIF
WITH frmSet.frmMsg.mLabel
.Autosize = .F.
.Height = .Height * (OCCURS(CHR(13), .Caption) + OCCURS(CHR(10), .Caption) + 1)
ENDWITH
frmSet.frmMsg.Height = frmSet.frmMsg.mLabel.Height + 80
Do CASE
CASE MOD(nDialogBoxType,16)=1
frmSet.frmMsg.AddObject('cmdOk','cmdMsg')
frmSet.frmMsg.AddObject('cmdCancel','cmdMsg')
frmSet.frmMsg.cmdOk.Caption="\<Nhận"
frmSet.frmMsg.cmdCancel.Caption=IIF(m_Lan = 'V', "\<Bỏ qua", ECode2String('SMLIB0074'))
frmSet.frmMsg.cmdOk.Left=INT((frmSet.frmMsg.width-2*frmSet.frmMsg.cmdOk.width-10)/2)
frmSet.frmMsg.cmdCancel.Left=frmSet.frmMsg.cmdOk.Left+10+frmSet.frmMsg.cmdOk.Width
frmSet.frmMsg.cmdOk.Visible =.T.
frmSet.frmMsg.cmdCancel.Visible =.T.
IF iIndex=2
frmSet.frmMsg.cmdCancel.TabIndex = 0
ENDIF
CASE MOD(nDialogBoxType,16)=2
frmSet.frmMsg.AddObject('cmdAbort','cmdMsg')
frmSet.frmMsg.AddObject('cmdRetry','cmdMsg')
frmSet.frmMsg.AddObject('cmdIgnore','cmdMsg')
frmSet.frmMsg.cmdAbort.Caption="\<Huỷ"
frmSet.frmMsg.cmdRetry.Caption=IIF(m_Lan = 'V', "\<Làm lại", ECode2String('SMLIB0075'))
frmSet.frmMsg.cmdIgnore.Caption=IIF(m_Lan = 'V', "\<Bỏ qua", ECode2String('SMLIB0076'))
frmSet.frmMsg.cmdAbort.Left=INT((frmSet.frmMsg.width-3*frmSet.frmMsg.cmdAbort.width-20)/2)
frmSet.frmMsg.cmdRetry.Left=INT((frmSet.frmMsg.width-frmSet.frmMsg.cmdAbort.width)/2)
frmSet.frmMsg.cmdIgnore.Left=2*frmSet.frmMsg.cmdRetry.Left-frmSet.frmMsg.cmdAbort.Left
frmSet.frmMsg.cmdAbort.Visible =.T.
frmSet.frmMsg.cmdRetry.Visible =.T.
frmSet.frmMsg.cmdIgnore.Visible =.T.
IF iIndex=2
frmSet.frmMsg.cmdRetry.TabIndex = 0
ENDIF
IF iIndex=3
frmSet.frmMsg.cmdIgnore.TabIndex = 0
ENDIF
CASE MOD(nDialogBoxType,16)=3
frmSet.frmMsg.AddObject('cmdYes','cmdMsg')
frmSet.frmMsg.AddObject('cmdNo','cmdMsg')
frmSet.frmMsg.AddObject('cmdCancel','cmdMsg')
frmSet.frmMsg.cmdYes.Caption="\<Có"
frmSet.frmMsg.cmdNo.Caption="\<Không"
frmSet.frmMsg.cmdCancel.Caption=IIF(m_Lan = 'V', "\<Bỏ qua", ECode2String('SMLIB0077'))
frmSet.frmMsg.cmdYes.Left=INT((frmSet.frmMsg.width-3*frmSet.frmMsg.cmdYes.width-20)/2)
frmSet.frmMsg.cmdNo.Left=INT((frmSet.frmMsg.width-frmSet.frmMsg.cmdYes.width)/2)
frmSet.frmMsg.cmdCancel.Left=2*frmSet.frmMsg.cmdNo.Left-frmSet.frmMsg.cmdYes.Left
frmSet.frmMsg.cmdYes.Visible =.T.
frmSet.frmMsg.cmdNo.Visible =.T.
frmSet.frmMsg.cmdCancel.Visible =.T.
IF iIndex=2
frmSet.frmMsg.cmdNo.TabIndex = 0
ENDIF
IF iIndex=3
frmSet.frmMsg.cmdCancel.TabIndex = 0
ENDIF
CASE MOD(nDialogBoxType,16)=4
frmSet.frmMsg.AddObject('cmdYes','cmdMsg')
frmSet.frmMsg.AddObject('cmdNo','cmdMsg')
frmSet.frmMsg.cmdYes.Caption="\<Có"
frmSet.frmMsg.cmdNo.Caption="\<Không"
frmSet.frmMsg.cmdYes.Left=INT((frmSet.frmMsg.width-2*frmSet.frmMsg.cmdYes.width-10)/2)
frmSet.frmMsg.cmdNo.Left=frmSet.frmMsg.cmdYes.Left+10+frmSet.frmMsg.cmdYes.Width
frmSet.frmMsg.cmdYes.Visible =.T.
frmSet.frmMsg.cmdNo.Visible =.T.
IF iIndex=2
frmSet.frmMsg.cmdNo.TabIndex = 0
ENDIF
CASE MOD(nDialogBoxType,16)=5
frmSet.frmMsg.AddObject('cmdRetry','cmdMsg')
frmSet.frmMsg.AddObject('cmdCancel','cmdMsg')
frmSet.frmMsg.cmdRetry.Caption=IIF(m_Lan = 'V', "\<Thử lại", ECode2String('SMLIB0078'))
frmSet.frmMsg.cmdCancel.Caption=IIF(m_Lan = 'V', "\<Bỏ qua", ECode2String('SMLIB0079'))
frmSet.frmMsg.cmdRetry.Left=INT((frmSet.frmMsg.width-2*frmSet.frmMsg.cmdRetry.width-10)/2)
frmSet.frmMsg.cmdCancel.Left=frmSet.frmMsg.cmdRetry.Left+10+frmSet.frmMsg.cmdRetry.Width
frmSet.frmMsg.cmdRetry.Visible =.T.
frmSet.frmMsg.cmdCancel.Visible =.T.
IF iIndex=2
frmSet.frmMsg.cmdCancel.TabIndex = 0
ENDIF
OTHER
frmSet.frmMsg.AddObject('cmdOk','cmdMsg')
frmSet.frmMsg.cmdOk.Caption="\<Nhận"
frmSet.frmMsg.cmdOk.Left=INT((frmSet.frmMsg.width-frmSet.frmMsg.cmdOk.width)/2)
frmSet.frmMsg.cmdOk.Visible =.T.
ENDCASE
nError = 0
OldError = ON("ERROR")
ON ERROR nError = 1
IF VARTYPE(_FORM) = "O"
IF UPPER(_SCREEN.Activeform.Class) = "FRMTRANS"
IF UPPER(_FORM.ActiveControl.BaseClass) = "GRID"
_isLostfocus = .T.
ENDIF
ENDIF
ENDIF
IF nError = 1
_isLostfocus = .F.
ENDIF
ON ERROR &OldError
frmSet.frmMsg.AutoCenter=.T.
?? CHR(7)
frmSet.frmMsg.Show
RETURN iReturn
DEFINE CLASS cmdMsg AS COMMANDBUTTON
Top = frmSet.frmMsg.mLabel.Top + frmSet.frmMsg.mLabel.Height + 30
Width=80
Height = 25
Left=20
FontName = m_Font_name
PROCEDURE Click
DO CASE
CASE Uppe(This.Name)="CMDOK"
iReturn=1
CASE Uppe(This.Name)="CMDCANCEL"
iReturn=2
CASE Uppe(This.Name)="CMDYES"
iReturn=6
CASE Uppe(This.Name)="CMDNO"
iReturn=7
CASE Uppe(This.Name)="CMDABORT"
iReturn=3
CASE Uppe(This.Name)="CMDIGNORE"
iReturn=5
CASE Uppe(This.Name)="CMDRETRY"
iReturn=4
ENDCASE
THISFORM.Release
ENDPROC
ENDDEFINE
-------------------------
File: Start.prg
CLOSE ALL
SET DEFA TO HOME()
Keyboard 'ABC'
Keyboard '{ENTER}'
Keyboard '{ENTER}'
Do Main
------------------------.
Các file đính kèm theo tài liệu này:
- 33323.doc