//弹出框的选择
弹出框可以作为测试和在点否的时候return,将不进行下去
IF MessageBox("在线建档提示","是否在线建档?",question!,yesno!,2) <> 1 THEN
return
else
ls_zxjd = nuo_returnsfzlic.nuo_zxjd()
END IF
//获取字段的截取
mid函数截取字符串,POS函数定位字符串
写成函数(as_str,as_key,as_keyover)三个参数
ls_patId=mid(ls_return,pos(ls_return,'<patId>')+len('<patId>'),pos(ls_return,'</patId>')-pos(ls_return,'<patId>')-len('<patId>'))
//手机号不能为空
If IsNull(ls_mobile) Or Len(Trim(ls_mobile)) = 0 Then
MessageBox("提示","必须输入手机号码!",exclamation!)
SetNull(ls_mobile)
dw_2.SetFocus()
dw_2.SetColumn("mobile")
Return
ElseIf Len(Trim(ls_mobile)) <> 11 Then
MessageBox('提示','手机号码应为11位')
SetNull(ls_mobile)
dw_2.SetFocus()
dw_2.SetColumn("mobile")
Return
End If
(拼接SQL语句查询)
(1)记录下原先的SQL语句
long ll_find
dw_1.settransobject(sqlca)
is_old_sql = dw_1.getsqlselect()
ll_find = pos(is_old_sql, 'WHERE')
if ll_find > 0 then
is_old_sql = left(is_old_sql, ll_find - 1)
end if
(2)拼接新的SQL语句
ls_where =""
//有效日期(日期需要引号)
ls_em_1 = em_1.text
ls_ks = ls_em_1 + ' 00:00:00'
if not isnull(ls_ks) and not isnull(ls_js) and ls_ks > ls_js then
messagebox('提示','有效日期其始值必须大于结束值!')
return
end if
if not isnull(ls_ks) then
ls_where += "and (CZRQ>='"+ls_ks
end if
if not isnull(ls_js) then
ls_where += "' and CZRQ<='"+ ls_js +"')"
end if
//卡类别
ls_lbbh = dw_2.object.lbbh[1]
if not isnull(ls_lbbh) and len(trim(ls_lbbh)) > 0 then
ls_where += " and ( TJKLB = '" + ls_lbbh + "')"
end if
ls_new_sql = is_old_sql + ls_where
//messagebox('',ls_new_sql)
//dw_1.settransobject(sqlca)
dw_1.setsqlselect( ls_new_sql)
dw_1.retrieve()