Skip links

Query & Dialog Örnekleri 5

Query & Dialog Örnekleri 5

Merhaba
static void query5(Args _args)
{
CustTable   cust;
Query                   q = new Query();
QueryRun                qr;
QueryBuildDataSource    qbdsCustTable;
QueryBuildRange         qbrCurrency;
QueryBuildRange         qbrRiskAmount;
CurrencyCode            currency;
Amount                  riskAmount;
dialog                  d = new Dialog(“Müşteriler”);
dialogField             dfCurrency;
dialogField             dfRiskAmount;
;
//Dialog
dfCurrency = d.addField(typeId(CurrencyCode));
dfRiskAmount = d.addField(typeId(Amount), “Max risk tutarı :”);
if(d.run())
{
//getFromDialog
currency    = dfCurrency.value();
riskAmount  = dfRiskAmount.value();

//fetch
qbdsCustTable   = q.addDataSource(tableNum(CustTable));
qbrCurrency     = qbdsCustTable.addRange(fieldNum(CustTable, Currency));
qbrRiskAmount   = qbdsCustTable.addRange(fieldNum(CustTable, RiskAmount));
if(currency)
qbrCurrency.value(sysQuery::value(currency));
qbrRiskAmount.value(sysQuery::range(0.01, riskAmount));
//super ben yazmam
qr = new QueryRun(q);
while(qr.next())
{
cust = qr.get(tableNum(CustTable));
info(strFmt(“%1     %2      %3 “,
cust.Name,
cust.Currency,
cust.RiskAmount));
}
}
}

Join the Discussion