PB技巧一《在主表中一个编号一个名称,通过输入判断是否编号存在》

string ls_supplier_id
int li_find,li_rtn,i
string ls_bi
DataWindowChild  dwchild_outletid
choose case dwo.name
  
      case 'customer_id' 
      if data ='' or isnull(data) then
       messagebox("提示","客户编号不能为空")
      return 2
      end if 
     this.getchild('customer_id_1',dwchild_outletid)
     dwchild_outletid.settransobject(sqlca)
     dwchild_outletid.retrieve()
      
     li_find=dwchild_outletid.find("customer_id ='"+data+"'",1,dwchild_outletid.rowcount())
     if li_find<=0 then
      messagebox("提示","客户编号不存在")
      this.setitem(row,'customer_id_1','')
      return 1
     end if  
//    if dw_detail.rowcount()>0 then
//     li_rtn= messagebox("提示","对应的分店已改变,是否清空明细数据" , question!,okcancel!,2)
//     if  li_rtn= 1 then
//      for i=dw_detail.rowcount() to 1 step - 1  
//      dw_detail.deleterow(i)
//      next  
//     //w_retpurchase_app_input.postevent('ue_newrec')
//     dw_detail.scrolltorow(dw_detail.insertrow(0))
//     dw_detail.setcolumn('aid')
//    else
//     return 2
//     end if  
//    end if
end choose
posted @ 2007-06-20 09:22  kuailewangzi1212  阅读(451)  评论(0编辑  收藏  举报