string ksname
ksname=profilestring("Sysini.ini","ks","ksname","")
integer li_bed_num,i
string ls_bed_no,ls_room_no
uo_bed u_bed
datastore ds_bed
if upperbound(u_bed_list[])>0 then
for i= 1 to upperbound(u_bed_list[])
closeuserobject(u_bed_list[i])
next
end if
dw_1.settransobject(sqlca)
dw_1.retrieve(ksname)
ds_bed=create datastore
ds_bed.dataobject='d_cwgl'
ds_bed.settransobject(sqlca)
ds_bed.setfilter("deptcode='"+ksname+"'")
li_bed_num=ds_bed.retrieve()
for i=1 to li_bed_num
ls_bed_no=ds_bed.getitemstring(i,'cwcode')
ls_room_no=ds_bed.getitemstring(i,'roomcode')
//MEssageBox("",ls_bed_no)
u_bed=create uo_bed
// u_bed.st_zhu_yuan_hao.text//0
u_bed.uf_init(ls_room_no,ls_bed_no,dw_1)
u_bed_list[i]=u_bed
next
setredraw(false)
long xpos=10,ypos=10
this.setredraw(false)
for i=1 to upperbound(u_bed_list)
if xpos+u_bed_list[i].width >this.width then
xpos=10
ypos=ypos+u_bed_list[i].height+10
else
xpos=10+u_bed_list[i].width
end if
this.openuserobject(u_bed_list[i],xpos,ypos)
u_bed_list[i].visible=true
u_bed_list[i].move(xpos,ypos)
u_bed_list[i].x=xpos
u_bed_list[i].y=ypos
xpos=xpos+u_bed_list[i].width+10
next
this.setredraw(true)