use of org.compiere.model.MQuery in project adempiere by adempiere.
the class WRequest method onEvent.
// getZoomTargets
public void onEvent(Event e) throws Exception {
if (e.getTarget() instanceof Menuitem) {
MQuery query = null;
if (e.getTarget() == m_active) {
query = new MQuery("");
String where = "(" + m_where + ") AND Processed='N'";
query.addRestriction(where);
query.setRecordCount(0);
} else if (e.getTarget() == m_all) {
query = new MQuery("");
query.addRestriction(m_where.toString());
query.setRecordCount(0);
} else if (e.getTarget() == m_new) {
query = new MQuery("");
query.addRestriction("1=2");
query.setRecordCount(0);
}
// 232=all - 201=my
int AD_Window_ID = 232;
ADWindow frame = SessionManager.getAppDesktop().openWindow(AD_Window_ID, query);
if (frame == null)
return;
// New - set Table/Record
if (e.getTarget() == m_new) {
GridTab tab = frame.getADWindowPanel().getActiveGridTab();
tab.dataNew(false);
tab.setValue("AD_Table_ID", new Integer(m_AD_Table_ID));
tab.setValue("Record_ID", new Integer(m_Record_ID));
//
if (m_C_BPartner_ID != 0)
tab.setValue("C_BPartner_ID", new Integer(m_C_BPartner_ID));
//
if (m_AD_Table_ID == I_C_BPartner.Table_ID)
tab.setValue("C_BPartner_ID", new Integer(m_Record_ID));
else if (m_AD_Table_ID == I_AD_User.Table_ID)
tab.setValue("AD_User_ID", new Integer(m_Record_ID));
else //
if (m_AD_Table_ID == I_C_Project.Table_ID)
tab.setValue("C_Project_ID", new Integer(m_Record_ID));
else if (m_AD_Table_ID == I_A_Asset.Table_ID)
tab.setValue("A_Asset_ID", new Integer(m_Record_ID));
else //
if (m_AD_Table_ID == I_C_Order.Table_ID)
tab.setValue("C_Order_ID", new Integer(m_Record_ID));
else if (m_AD_Table_ID == I_C_Invoice.Table_ID)
tab.setValue("C_Invoice_ID", new Integer(m_Record_ID));
else //
if (m_AD_Table_ID == I_M_Product.Table_ID)
tab.setValue("M_Product_ID", new Integer(m_Record_ID));
else if (m_AD_Table_ID == I_C_Payment.Table_ID)
tab.setValue("C_Payment_ID", new Integer(m_Record_ID));
else //
if (m_AD_Table_ID == I_M_InOut.Table_ID)
tab.setValue("M_InOut_ID", new Integer(m_Record_ID));
else if (m_AD_Table_ID == I_M_RMA.Table_ID)
tab.setValue("M_RMA_ID", new Integer(m_Record_ID));
else //
if (m_AD_Table_ID == I_C_Campaign.Table_ID)
tab.setValue("C_Campaign_ID", new Integer(m_Record_ID));
else //
if (m_AD_Table_ID == I_R_Request.Table_ID)
tab.setValue(I_R_Request.COLUMNNAME_R_RequestRelated_ID, new Integer(m_Record_ID));
else // FR [2842165] - Order Ref link from SO line creating new request
if (m_AD_Table_ID == I_C_OrderLine.Table_ID) {
MOrderLine oLine = new MOrderLine(Env.getCtx(), m_Record_ID, null);
if (oLine != null) {
tab.setValue(I_C_OrderLine.COLUMNNAME_C_Order_ID, new Integer(oLine.getC_Order_ID()));
}
}
}
frame = null;
}
}
use of org.compiere.model.MQuery in project adempiere by adempiere.
the class WZoomAcross method launchZoom.
/**
* Launch Zoom
* @param pp KeyPair
*/
private void launchZoom(final ZoomInfoFactory.ZoomInfo zoomInfo) {
final int AD_Window_ID = zoomInfo.windowId;
final MQuery query = zoomInfo.query;
log.info("AD_Window_ID=" + AD_Window_ID + " - " + query);
AEnv.zoom(AD_Window_ID, query);
}
use of org.compiere.model.MQuery in project adempiere by adempiere.
the class AEnv method startWorkflowProcess.
/**
* Start Workflow Process Window
* @param AD_Table_ID optional table
* @param Record_ID optional record
*/
public static void startWorkflowProcess(int AD_Table_ID, int Record_ID) {
if (s_workflow_Window_ID <= 0) {
int AD_Window_ID = DB.getSQLValue(null, "SELECT AD_Window_ID FROM AD_Window WHERE Name = 'Workflow Process'");
s_workflow_Window_ID = AD_Window_ID;
}
if (s_workflow_Window_ID <= 0)
return;
MQuery query = new MQuery();
query.addRestriction("AD_Table_ID", MQuery.EQUAL, AD_Table_ID);
query.addRestriction("Record_ID", MQuery.EQUAL, Record_ID);
AEnv.zoom(s_workflow_Window_ID, query);
}
use of org.compiere.model.MQuery in project adempiere by adempiere.
the class InfoPaymentPanel method zoom.
// setParameters
// Elaine 2008/12/16
/**
* Zoom
*/
public void zoom() {
log.info("InfoPayment.zoom");
Integer C_Payment_ID = getSelectedRowKey();
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", fCheckReceipt.isSelected());
AEnv.zoom(AD_WindowNo, query);
}
use of org.compiere.model.MQuery in project adempiere by adempiere.
the class InfoProductPanel method zoom.
// hasHistory
// Elaine 2008/12/16
/**
* Zoom
*/
public void zoom() {
log.info("");
Integer M_Product_ID = getSelectedRowKey();
if (M_Product_ID == null)
return;
MQuery query = new MQuery("M_Product");
query.addRestriction("M_Product_ID", MQuery.EQUAL, M_Product_ID);
query.setRecordCount(1);
// SO
int AD_WindowNo = getAD_Window_ID("M_Product", true);
AEnv.zoom(AD_WindowNo, query);
}
Aggregations