wf_check_emp

long ll_emp,ll_1,ll_sum,ll_orno,ll_find,ll_new_row
string ls_emno
string ls_name,ls_find_emno
dw_3.reset()
//select max(t_crep) into :ll_emp from tbl_employee where t_crep not in(1000000,3000000);
//if isnull(ll_emp) or ll_emp=0 then ll_emp=1000
for ll_1=1 to dw_1.rowcount()
 ll_sum=0
 ll_orno=0
 //处理姓名
 ls_name=""
 ls_name=dw_1.getitemstring(ll_1,"t_zrr")
 ls_emno=trim(dw_1.getitemstring(ll_1,"t_emp"))
 do   while   pos(ls_name, ' ')> 0           //空格
  ls_name   =   Replace(ls_name,pos(ls_name, ' '),1, "")
 loop
 ls_name=trim(ls_name)
 dw_1.setitem(ll_1,"t_zrr",ls_name)
 dw_1.accepttext()
 //查找工号是否存在
 ll_find=0
 ls_find_emno=""
 select t_crep into :ls_find_emno from tbl_employee where rtrim(ltrim(t_crep))=:ls_emno;
 if isnull(ls_find_emno) then ls_find_emno=""
   if ls_find_emno="" then
  long ll_find2,ll_2
  string ls_find2
  dw_3.accepttext()
  ll_find2=0
  ls_find2="t_name='"+ls_name+"'"
  ll_find2=dw_3.find(ls_find2,1,dw_3.rowcount())
  if not ll_find2>0 then
   ll_new_row=dw_3.insertrow(0)
   dw_3.setitem(ll_new_row,"t_crep",ls_emno)
   dw_3.setitem(ll_new_row,"t_name",ls_name)
  end if
 else
  dw_1.setitem(ll_1,"t_emp",ls_find_emno)
 end if
// dw_1.setitem(ll_1,"t_emp",ll_emp)
next
if dw_3.rowcount()>0 then
 messagebox("提示","部分营销代表在员工信息表中未定义,请确认其工号!")
 open(w_emp)
 return 0 
end if
return 1

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/75527/viewspace-720775/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/75527/viewspace-720775/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值