1 package org.campware.cream.modules.actions; 2 3 42 43 import org.apache.velocity.context.Context; 44 45 import org.apache.turbine.util.RunData; 46 import org.apache.torque.util.Criteria; 47 48 import org.campware.cream.om.CustomerCategory; 49 import org.campware.cream.om.CustomerCategoryPeer; 50 51 55 public class CustomerCategorySQL extends CreamAction 56 { 57 protected void initScreen() 58 { 59 setModuleType(LOOKUP); 60 setModuleName("CUSTOMER_CATEGORY"); 61 } 62 72 public void doInsert(RunData data, Context context) 73 throws Exception 74 { 75 CustomerCategory entry = new CustomerCategory(); 76 data.getParameters().setProperties(entry); 77 entry.save(); 78 } 79 80 88 public void doUpdate(RunData data, Context context) 89 throws Exception 90 { 91 CustomerCategory entry = new CustomerCategory(); 92 data.getParameters().setProperties(entry); 93 entry.setModified(true); 94 entry.setNew(false); 95 entry.save(); 96 } 97 98 102 public void doDelete(RunData data, Context context) 103 throws Exception 104 { 105 Criteria criteria = new Criteria(); 106 criteria.add(CustomerCategoryPeer.CUSTOMER_CAT_ID, data.getParameters().getInt("customercatid")); 107 CustomerCategoryPeer.doDelete(criteria); 108 } 109 110 114 public void doDeleteselected(RunData data, Context context) 115 throws Exception 116 { 117 int[] delIds= data.getParameters().getInts("rowid"); 118 Criteria criteria = new Criteria(); 119 criteria.addIn(CustomerCategoryPeer.CUSTOMER_CAT_ID, delIds); 120 CustomerCategoryPeer.doDelete(criteria); 121 } 122 123 } 124 | Popular Tags |