Search in sources :

Example 56 with MQuery

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;
}
Also used : MQuery(org.compiere.model.MQuery)

Example 57 with MQuery

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);
}
Also used : MQuery(org.compiere.model.MQuery) ALayoutConstraint(org.compiere.apps.ALayoutConstraint)

Example 58 with MQuery

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);
}
Also used : MQuery(org.compiere.model.MQuery) ALayoutConstraint(org.compiere.apps.ALayoutConstraint)

Example 59 with MQuery

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);
}
Also used : MQuery(org.compiere.model.MQuery) ALayoutConstraint(org.compiere.apps.ALayoutConstraint)

Example 60 with MQuery

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());
}
Also used : AWindow(org.compiere.apps.AWindow) MQuery(org.compiere.model.MQuery) KeyNamePair(org.compiere.util.KeyNamePair) ALayoutConstraint(org.compiere.apps.ALayoutConstraint)

Aggregations

MQuery (org.compiere.model.MQuery)109 PrintInfo (org.compiere.model.PrintInfo)19 GridField (org.compiere.model.GridField)15 MPrintFormat (org.compiere.print.MPrintFormat)14 ReportEngine (org.compiere.print.ReportEngine)12 Point (java.awt.Point)11 ALayoutConstraint (org.compiere.apps.ALayoutConstraint)9 GridWindowVO (org.compiere.model.GridWindowVO)9 SQLException (java.sql.SQLException)8 GridTab (org.compiere.model.GridTab)8 GridWindow (org.compiere.model.GridWindow)7 PreparedStatement (java.sql.PreparedStatement)6 ResultSet (java.sql.ResultSet)6 AWindow (org.compiere.apps.AWindow)6 File (java.io.File)5 IOException (java.io.IOException)5 Language (org.compiere.util.Language)4 AdempiereException (org.adempiere.exceptions.AdempiereException)3 MClient (org.compiere.model.MClient)3 MLookup (org.compiere.model.MLookup)3