#!ruby -Ks

        ##
        ##  商品一覧のフォーム
        ##

require "phi"
require "rdb"
include Phi
include RDB

DB = Database_ex.new("IBLocal","SYSDBA","masterkey")
##DB = Database_ex.new("APOLLO","apollo","apollo")

        ##
        ##  form
        ##
form = Form.new :form_shohin , "商品一覧"

grid = DBGrid.new form , :grid
grid.align = Phi::AL_CLIENT

        ##
        ##  data access
        ##
dataset = DB.table("ap02shohin")
datasource = DataSource.new dataset
grid.data_source = datasource

dataset["shohin_code"]  .display_label = "商品コード"
dataset["shohin_mei"]   .display_label = "商品名"
dataset["tanka"]        .display_label = "単価"

form.show
Phi.mainloop
DB.close

