dim newdt=网格部件1.DataTable
'去掉工号为空的
dim rows=newdt.Select("工号 is null or 工号='' or 科室编码 is null or 科室编码=''")
for each dr1 in rows
newdt.Rows.Remove(dr1)
count=count+1
next
'去掉本界面工号重复的
for each dr2 in newdt.Copy().Rows
rows=newdt.Select("工号='"+dr2["工号"]+"'")
if rows.Length>1 then
for i=0 to rows.Length-2
newdt.Rows.Remove(newdt.Select("ID='"+rows[i]["ID"]+"'")[0])
count=count+1
next
end if
next
'去掉与数据库中编码重复的
dim dbdt=ExecuteSelect("select ID,工号 from HR_人员档案")
for each dr3 in dbdt.Rows
rows=newdt.Select("工号='"+dr3["工号"]+"'")
if rows.Length>0 then
for i=0 to rows.Length-1
newdt.Rows.Remove(newdt.Select("ID='"+rows[i]["ID"]+"'")[0])
count=count+1
next
end if
next
'生成拼音码
for each dr4 in newdt.Rows
dr4["拼音码"]=PinYinHead(dr4["姓名"])
next