1 package org.campware.cream.modules.screens; 2 3 42 43 import org.apache.torque.util.Criteria; 44 import org.apache.velocity.context.Context; 45 46 import org.campware.cream.om.SorderPeer; 47 48 52 public class CustomerOrders extends CreamUtil 53 { 54 55 protected void initScreen() 56 { 57 setModuleType(UTIL); 58 setModuleName("UTIL"); 59 } 60 61 62 protected boolean getDetail(int myId, Criteria criteria, Context context) 63 { 64 try 65 { 66 Criteria.Criterion a1 = criteria.getNewCriterion(SorderPeer.SORDER_ID, new Integer (1000), Criteria.EQUAL); 67 Criteria.Criterion a2 = criteria.getNewCriterion(SorderPeer.CUSTOMER_ID, new Integer (myId), Criteria.EQUAL); 68 Criteria.Criterion a3 = criteria.getNewCriterion(SorderPeer.STATUS, new Integer (30), Criteria.EQUAL); 69 criteria.add( a1.or( a2.and(a3))); 70 criteria.addAscendingOrderByColumn(SorderPeer.SORDER_CODE); 71 72 context.put("orders", SorderPeer.doSelect(criteria)); 73 74 return true; 75 } 76 catch (Exception e) 77 { 78 return false; 79 } 80 } 81 82 } 83 | Popular Tags |