Example #1
0
void AetSession::formatItems
(
    QDomElement         parent,
    QString     const & sessionPath
)
{
    ItemCollection const * items  = session->getItems();

    QDomElement tracks = document->createElement( "Tracks" );

    tracks.setAttribute( "type", "list" );
    tracks.setAttribute( "depth", "1" );
    tracks.setAttribute( "itemtype", "section" );

    for ( int i = 0; i < items->getCount(); i++ )
    {
        if ( !items->getItem( i )->isExcluded() )
        {
            QDomElement item = document->createElement( "Item" );

            formatItem( item, items->getItem( i ), sessionPath );

            tracks.appendChild( item );
        }
    }

    parent.appendChild( tracks );
}
Example #2
0
void kitchenFrame::fillDetails(wxString& prodName)
{
    ListBox4->Clear();
    StaticText9->SetLabel(prodName);
    wxDateTime current = wxDateTime::Now();
    wxString orderBy;
    if(ToggleButton2->GetValue())
    {
        orderBy = _T("`time` ASC");
    }
    else if(ToggleButton1->GetValue())
    {
        orderBy = _T("`qty` DESC");
    }

    mysqlpp::Query query = conn->query();
    query << "SELECT `orders_dishes`.`id`,`orders_dishes`.`qty`,`orders_dishes`.`name`,`orders_dishes`.`comment` FROM \
`orders_dishes` ,`orders` WHERE `orders`.`time` > '"<< wx2std(current.FormatISODate(), wxConvUI) <<"' AND `orders`.`status`=3 \
AND `orders_dishes`.`kitchen`=1 AND `orders_dishes`.`ready`=0 \
AND `orders_dishes`.`order_id`=`orders`.`id` \
 AND `orders_dishes`.`name`='"<< wx2std(prodName, wxConvUI) <<"' ORDER BY "<< wx2std(orderBy, wxConvUI);
    mysqlpp::StoreQueryResult res = query.store();
    if (res)
    {
        if(res.num_rows() == 0)
        {
            StaticText9->SetLabel(_T(""));
            ListBox4->Clear();
//fillMain();
        }
        else
        {
            mysqlpp::Row row;
            mysqlpp::StoreQueryResult::size_type i;
            for (i = 0; i < res.num_rows(); ++i)
            {
                row = res[i];
                ListBox4->Append(formatItem(conn, ListBox4->GetCount(), int(row["id"]), true));
            }

        }
    }

}