use of org.compiere.model.MQuery in project adempiere by adempiere.
the class AbstractDocumentSearch method openWindow.
/**
* opens window with the given documents
*
* @param ids
* - document id's
* @param tableName
* @param windowId
*/
private void openWindow(Vector<Integer> ids, String tableName, int windowId) {
if (ids == null || ids.size() == 0) {
return;
}
String whereString = " " + tableName + "_ID";
// create query string
if (ids.size() == 1) {
if (ids.get(0).intValue() == 0) {
whereString = null;
} else {
whereString += "=" + ids.get(0).intValue();
}
} else {
whereString += " IN (";
for (int i = 0; i < ids.size(); i++) {
whereString += ids.get(i).intValue();
if (i < ids.size() - 1) {
whereString += ",";
} else {
whereString += ") ";
}
}
}
log.fine(whereString);
final MQuery query = new MQuery(tableName);
query.addRestriction(whereString);
final boolean ok = openWindow(windowId, query);
if (!ok) {
log.severe("Unable to open window: " + whereString);
}
if (!windowOpened && ok)
windowOpened = true;
}
use of org.compiere.model.MQuery in project adempiere by adempiere.
the class InfoPayment method zoom.
/**
* Zoom
*/
protected void zoom(int record_ID) {
log.info("InfoPayment.zoom");
Integer C_Payment_ID = record_ID;
if (C_Payment_ID == null)
return;
MQuery query = new MQuery("C_Payment");
query.addRestriction("C_Payment_ID", MQuery.EQUAL, C_Payment_ID);
query.setRecordCount(1);
int AD_WindowNo = getAD_Window_ID("C_Payment", (m_isSOTrx && fcheckReceipt.isSelected()) || (!m_isSOTrx && !fcheckReceipt.isSelected()));
zoom(AD_WindowNo, query);
}
use of org.compiere.model.MQuery in project adempiere by adempiere.
the class InfoOrder method zoom.
// setParameters
/**
* Zoom
*/
protected void zoom(int record_ID) {
log.info("");
Integer C_Order_ID = record_ID;
if (C_Order_ID == null)
return;
MQuery query = new MQuery("C_Order");
query.addRestriction("C_Order_ID", MQuery.EQUAL, C_Order_ID);
query.setRecordCount(1);
int AD_WindowNo = getAD_Window_ID("C_Order", fIsSOTrx.isSelected());
zoom(AD_WindowNo, query);
}
use of org.compiere.model.MQuery in project adempiere by adempiere.
the class InfoCashLine method zoom.
// initInfo
/**
* Zoom
*/
protected void zoom(int record_ID) {
log.info("InfoCashLine.zoom");
Integer C_CashLine_ID = record_ID;
if (C_CashLine_ID == null)
return;
MQuery query = new MQuery("C_CashLine");
query.setZoomTableName("C_CashLine");
query.setZoomColumnName("C_CashLine_ID");
query.setZoomValue(C_CashLine_ID);
query.addRestriction("C_CashLine_ID", MQuery.EQUAL, C_CashLine_ID);
query.setRecordCount(1);
// SO
int AD_WindowNo = getAD_Window_ID("C_Cash", true);
zoom(AD_WindowNo, query);
}
use of org.compiere.model.MQuery in project adempiere by adempiere.
the class VPAttributeDialog method cmd_zoom.
// cmd_newEdit
/**
* Zoom M_Lot
*/
private void cmd_zoom() {
int M_Lot_ID = 0;
KeyNamePair pp = (KeyNamePair) fieldLot.getSelectedItem();
if (pp != null)
M_Lot_ID = pp.getKey();
MQuery zoomQuery = new MQuery("M_Lot");
zoomQuery.addRestriction("M_Lot_ID", MQuery.EQUAL, M_Lot_ID);
log.info(zoomQuery.toString());
//
setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
//
// Lot
int AD_Window_ID = MWindow.getWindow_ID("Lot");
AWindow frame = new AWindow();
if (frame.initWindow(AD_Window_ID, zoomQuery)) {
this.setVisible(false);
// otherwise blocked
this.setModal(false);
this.setVisible(true);
AEnv.addToWindowManager(frame);
AEnv.showScreen(frame, SwingConstants.EAST);
}
// async window - not able to get feedback
frame = null;
//
setCursor(Cursor.getDefaultCursor());
}
Aggregations