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;
}
}
/**/


}
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值