(1) 药品档案管理的“查询”按钮代码:
string ls_name
string ls_bianhao,ls_sql
dw_1.settransobject(sqlca)
if isnull(ddlb_1.text) or ddlb_1.text="" then
dw_1.retrieve( )
else
if ddlb_1.text="药品编号" then
if isnull(sle_2.text) or sle_2.text="" then
messagebox("提示!","请输入你要查询的参数!")
else
ls_bianhao = string(sle_2.text)
ls_sql="yaop_id ='"+ls_bianhao+"'"
dw_1.retrieve( )
dw_1.setfilter(ls_sql)
dw_1.filter( )
end if
else
if isnull(sle_2.text) or sle_2.text="" then
messagebox("提示!","请输入你要查询的参数!")
else
ls_name= string(sle_2.text)
ls_sql="yaop_name like '"+"%"+ls_name+"%"+"'"
dw_1.retrieve( )
dw_1.setfilter(ls_sql)
dw_1.filter( )
end if
end if
end if
(2)药品档案“保存”按钮代码:
if dw_1.deletedcount( )+dw_1.modifiedcount( )<1 then
return
else
if dw_1.update()=1 then
commit;
messagebox("提示!","数据修改成功!")
else
rollback;
end if
end if
(3)入库“查询”按钮代码:
String ls_bianhao,ls_sql
dw_1.settransobject(sqlca)
if isnull(sle_1.text) or sle_1.text="" then
messagebox("提示!","请输入你要查询的参数!")
else
ls_bianhao = string(sle_1.text)
ls_sql="ypid ='"+ls_bianhao+"'"
dw_1.retrieve( )
dw_1.setfilter(ls_sql)
dw_1.filter( )
end if
(4)入库“数据入库”的代码:
int li_row
string li_2,li_4,li_5,li_6
string li_data
li_row=dw_1.getrow()
li_2=dw_1.object.data[li_row, 2]
li_4=dw_1.object.data[li_row, 4]
li_5=dw_1.object.data[li_row, 5]
li_data=string(today())
//数据插入库存表
insert
into t_kuc(t_kuc.yaop_id,t_kuc.account,t_kuc.cangk_id,t_kuc.input_data)
values(:li_2,:li_4,:li_5,:li_data) using sqlca;
if sqlca.SQLcode =-1 THEN
messagebox("提示信息:","药品入库失败!")
else
messagebox("提示信息:","药品入库成功!")
end if
(5)出库“查询”按钮代码:
String user_id,yaop_id
string ls_sql
dw_1.settransobject(sqlca)
if isnull(ddplb_1.text) or ddplb_1.text="" then
dw_1.retrieve( )
else
if ddplb_1.text="药品编号" then
if isnull(sle_1.text) or sle_1.text="" then
messagebox("提示!","请输入你要查询的药品号!")
else
yaop_id = string(sle_1.text)
ls_sql="yaop_id ='"+yaop_id+"'"
ls_sql=dw_1.getsqlselect()+"where"+" "+ls_sql
dw_1.setsqlselect( ls_sql)
dw_1.retrieve( )
dw_1.setfilter(ls_sql)
dw_1.filter( )
end if
else
if isnull(sle_1.text) or sle_1.text="" then
messagebox("提示!","请输入你要查询的参数!")
else
user_id= string(sle_1.text)
ls_sql="user_id like '"+"%"+user_id+"%"+"'"
dw_1.retrieve( )
dw_1.setfilter(ls_sql)
dw_1.filter( )
end if
end if
end if
(6)出库界面“数据出库”按钮代码:
long ls_account
int ll_account
sle_3.text=string(today())
sle_4.text=gs_yhm
if sle_1.text=""or isnull(sle_1.text) then
end if
insert //插入到出库信息表中
into t_chuku
values(:sle_1.text,:sle_2.text,:sle_3.text,:sle_4.text);
<< 上一页 [11] [12] [13] [14] [15] [16] [17] [18] [19] 下一页