this.accepttext()
r_row=this.getrow() //取得所选中的行号
r_count=this.rowcount() //当前行数
r_colname=this.getcolumnname() //取当前列名
CHOOSE CASE r_colname
CASE 'km_code'
//1 科目编码不能重复
r_km_code = this.getitemstring(r_row,'km_code')
//1-1 判断在数据窗口中输入的科目编码是否存在重复
for i=1 to r_count
if i<>r_row then
r_km_code1=this.getitemstring(i,'km_code')//取已经输入的行中的字段
if r_km_code=r_km_code1 then
beep(5)
messagebox('提示','数据窗口中输入的科目编码重复,请重新输入!')
this.setitem(r_row,'km_code','')
return 1
end if
end if
next
//1-2 判断科目编码是否已经存在
select count(*) into :r_count from zz_kjkmbmb where zth=:g_zth and km_code=:r_km_code;
if r_count>0 then
messagebox('提示','输入的科目编码在数据库中已经存在,请重新输入!')
this.setitem(r_row,r_colname,'')
return 1
end if
//2 编码格式的控制
//判断输入数据格式的正确性 XXX-XX-XX
//不允许输入除数字以外的字符
r_cd = len(r_km_code)
FOR i=1 TO 3
r_bit=mid(r_km_code,i,1)
IF not ( r_bit >= "0" and r_bit <= "9" ) THEN
messagebox('提示','请输入数字!')
this.setitem(r_row,'km_code','')
return 1
END IF
NEXT
//判断短线的位置是否正确
CHOOSE CASE r_cd
CASE 3
CASE 6
FOR i=5 TO 6
r_bit=mid(r_km_code,i,1)
IF not ( r_bit >= "0" and r_bit <= "9" ) THEN
messagebox('提示','请输入数字!')
this.setitem(r_row,'km_code','')
return 1
END IF
NEXT
IF not mid(r_km_code,4,1)='-' THEN
messagebox('提示','科目编码格式错误,正确格式为:"XXX-XX"')
this.setitem(r_row,'km_code','')
return 1
END IF
CASE 9
FOR i=5 TO 6
r_bit=mid(r_km_code,i,1)
IF not ( r_bit >= "0" and r_bit <= "9" ) THEN
messagebox('提示',
论文范文http://www.chuibin.com/ '请输入数字!')
this.setitem(r_row,'km_code','')
return 1
END IF
NEXT
FOR i=8 TO 9
r_bit=mid(r_km_code,i,1)
IF not ( r_bit >= "0" and r_bit <= "9" ) THEN
messagebox('提示','请输入数字!')
this.setitem(r_row,'km_code','')
return 1
END IF
NEXT
IF not (mid(r_km_code,4,1)='-' and mid(r_km_code,7,1)='-') THEN
messagebox('提示','科目编码格式错误,,正确格式为:"XXX-XX-XX')
this.setitem(r_row,'km_code','')
return 1
END IF
CASE ELSE
messagebox('提示','科目编码格式错误!')
this.setitem(r_row,'km_code','')
return 1
上一页 [1] [2] [3] [4] [5] [6] [7] [8]
账务处理系统会计科目输入模块 第8页下载如图片无法显示或论文不完整,请联系qq752018766