12345678910111213141516171819202122232425262728293031323334353637 |
- $PBExportHeader$f_idcard_process.srf
- global type f_idcard_process from function_object
- end type
- forward prototypes
- global subroutine f_idcard_process (string idcardcode, ref s_idcard_change s_idcard, integer mode)
- end prototypes
- global subroutine f_idcard_process (string idcardcode, ref s_idcard_change s_idcard, integer mode);datetime ls_date
- string ls_year,ls_mth,ls_day,ls_sex
- if mode =1 then //15位
- ls_year=mid(idcardcode,7,2)
- if mid(ls_year,1,1)='0' then
- ls_year='20'+ls_year
- else
- ls_year='19'+ls_year
- end if
- ls_date=datetime(date(ls_year+'/'+mid(idcardcode,9,2)+'/'+mid(idcardcode,11,2)),time('00:00:00'))
- if mod(integer(right(idcardcode,1)),2)=1 then
- ls_sex='男'
- else
- ls_sex='女'
- end if
- else
- ls_year=mid(idcardcode,7,4)
- ls_date=datetime(date(ls_year+'/'+mid(idcardcode,11,2)+'/'+mid(idcardcode,13,2)),time('00:00:00'))
- if mod(integer(mid(idcardcode,17,1)),2)=1 then
- ls_sex='男'
- else
- ls_sex='女'
- end if
- end if
- s_idcard.birthday=ls_date
- s_idcard.sex=ls_sex
- end subroutine
|