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.EducationCategory; 49 import org.campware.cream.om.EducationCategoryPeer; 50 51 55 public class EducationCategorySQL extends CreamAction 56 { 57 protected void initScreen() 58 { 59 setModuleType(LOOKUP); 60 setModuleName("EDUCATION_CATEGORY"); 61 } 62 63 73 public void doInsert(RunData data, Context context) 74 throws Exception 75 { 76 EducationCategory entry = new EducationCategory(); 77 data.getParameters().setProperties(entry); 78 entry.save(); 79 } 80 81 89 public void doUpdate(RunData data, Context context) 90 throws Exception 91 { 92 EducationCategory entry = new EducationCategory(); 93 data.getParameters().setProperties(entry); 94 entry.setModified(true); 95 entry.setNew(false); 96 entry.save(); 97 } 98 99 103 public void doDelete(RunData data, Context context) 104 throws Exception 105 { 106 Criteria criteria = new Criteria(); 107 criteria.add(EducationCategoryPeer.EDUCATION_CAT_ID, data.getParameters().getInt("educationcatid")); 108 EducationCategoryPeer.doDelete(criteria); 109 } 110 111 115 public void doDeleteselected(RunData data, Context context) 116 throws Exception 117 { 118 int[] delIds= data.getParameters().getInts("rowid"); 119 Criteria criteria = new Criteria(); 120 criteria.addIn(EducationCategoryPeer.EDUCATION_CAT_ID, delIds); 121 EducationCategoryPeer.doDelete(criteria); 122 } 123 124 } 125 | Popular Tags |