Иванович Петровский (Автор тем)

Выбрать дату в календареВыбрать дату в календаре

Страницы: 1
Получение списка заявок, getItem("orders", i)
 
Добрый день!
Хочу получить табличку с некоторыми атрибутами моих заявок. Использую getNumberOf("orders"), getItem.
В результате получаю не все, а только последнюю зарегистрированную заявку. Спасите - помогите, пожалуйста!!!
Код
function main( ... )
   t_id=AllocTable()
   AddColumn(t_id,0,"trans_id",true, QTABLE_STRING_TYPE,30)
   AddColumn(t_id,1,"sec_code",true, QTABLE_STRING_TYPE,30)
   AddColumn(t_id,2,"activation_time",true, QTABLE_STRING_TYPE,30)
   AddColumn(t_id,3,"settlecode",true, QTABLE_STRING_TYPE,30)
   AddColumn(t_id,4,"exec_type",true, QTABLE_STRING_TYPE,30)
   AddColumn(t_id,5,"#",true, QTABLE_STRING_TYPE,30)
   if CreateWindow(t_id)<1 then
      message("Error creating Dlg window",1)
   end
   SetWindowCaption(t_id,"Orders data")
   local t=0
   local count = getNumberOf("orders")
   InsertRow(t_id,-1)
   if count then
      for i=0,count-1 do
         InsertRow(t_id,-1)
         if stopped then
            break
         end
         t=getItem("orders", i)
         if t ~= nil then
            SetCell(t_id,i,0,tostring(t.trans_id))
            SetCell(t_id,i,1,tostring(t.sec_code))
            SetCell(t_id,i,2,tostring(t.activation_time))
            SetCell(t_id,i,3,tostring(t.settlecode))
            SetCell(t_id,i,4,tostring(t.exec_type))
         end
         SetCell(t_id,i,5,tostring(i))
      end
   end
end
Страницы: 1
Наверх