newtouch框架使用心得----view层

一、view层中:

public class AdvisoryEventView implements View {
/////////////
@SuppressWarnings("unchecked")
public Class<Action>[] allow() {
return new Class[] {
                     Actions1.class,  //Actions1是内部类
                     CRUDAction.class,//CRUDAction默认的增删改查类
                     UtilAction.class //UtilAction用于级联
        };
     

public void init() {
System.out.println("init :" );
}

/** 数据字典 */
@Dictionary("Gender")
private List<DictionaryEntity> gender;
public List<DictionaryEntity> getGender() {
return gender;
}
public void setGender(List<DictionaryEntity> gender) {
this.gender = gender;
}

////////////////////////////////

public static class Actions1 implements Action{
@Service
private GeneralService generalService;

public void setGeneralService(GeneralService generalService) {
this.generalService = generalService;
}

@Binding("name,min_advisoryDate,max_advisoryDate,currentPageIndex,pageSize")
@RenderByCascade("items")
public Page find(String name,String date_from,String date_to,int pageIndex, int pageSize){
Page page = null;

SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");//小写的mm表示的是分钟 
java.util.Date date_from2 = null ;
java.util.Date date_to2 = null ;
try {
date_from2 = sdf.parse(date_from);
date_to2 = sdf.parse(date_to);

page = this.generalService.pagingByAttributes (AdvisoryEvent.class, pageIndex, pageSize, 
new String[]{"name","advisoryDate","advisoryDate"},
new Object[]{name,date_from2,date_to2},
new String[]{Queriable.LIKE,Queriable.GQ,Queriable.LQ});




} catch (ParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}


return page;
}
}
/**/


}

猜你喜欢

转载自xgbjmxn.iteye.com/blog/1558434
今日推荐