页面添加数据方法

/*
* 添加一条数据方法
*/
public void AddEtlExtractPositionInfo() {
int code = Integer.parseInt(get("code").toString());
this.getmenu(code, this.getRequest());
Etlextractposition ep = new Etlextractposition();
// this.copyPropertiesToBean(ep);
// String id = entity.getId().toString();
// System.out.println("id---->"+ id);
// String versionString = entity.getVersionNum().toString();
// System.out.println("versionString---->"+ versionString);

// entity.setId()
// entity.setPositionNum(get("positionNum")!=
// null?get("positionNum").toString():null);
// entity.setClasstype(get("classtype")!=
// null?Integer.parseInt(get("classtype").toString()):null);
// entity.setVersionNum(get("versionNum")!=
// null?Integer.parseInt(get("versionNum").toString()):null);
// entity.setOrderNum(get("orderNum")!=
// null?Integer.parseInt(get("orderNum").toString()):null);
// entity.setType(get("type")!=null?Integer.parseInt(get("type").toString()):null);
// entity.setMeth(get("meth")!=null?Integer.parseInt(get("meth").toString()):null);

// StringBuffer sBuffer = new StringBuffer("");
// 获得页面版本和抽取位置和顺序号
Integer versionNum = Integer.parseInt(get("versionNum").toString());
String positionNum = get("positionNum").toString();
String orderNum = get("orderNum").toString();

// 通过页面版本和抽取位置 做是否重复判断 true
if (this.etlService.checkVersion2(versionNum, positionNum)) {
out
.print("<script>alert('添加失败,位置信息不可重复!');window.history.go(-1);</script>");
} else {
// 通过页面版本和抽取位置 做是否重复判断 false
if (this.etlService.checkorderNum(orderNum, versionNum)) {
out
.print("<script>alert('添加失败,顺序号不可重复!');window.history.go(-1);</script>");
} else {
ep.setPositionNum(get("positionNum").toString());
ep.setClasstype(get("classtype") != "" ? Integer.parseInt(get(
"classtype").toString()) : null);
ep.setVersionNum(get("versionNum") != "" ? Integer
.parseInt(get("versionNum").toString()) : null);
ep.setOrderNum(get("orderNum") != "" ? Integer.parseInt(get(
"orderNum").toString()) : null);
ep.setType(get("type") != "" ? Integer.parseInt(get("type")
.toString()) : null);
ep.setMeth(get("meth") != "" ? Integer.parseInt(get("meth")
.toString()) : null);
if (ep != null || !("".equals(ep))) {
this.EtlextractpositionDao.insert(ep);
out
.print("<script>alert('添加成功!');if(window!=parent){parent.document.getElementById('popCloseBox').click();"
+ "parent.frames['ovfirame'].location='../CheckAction/ListEtlExtractPositionOfAll.action?code="
+ code + "'}; </script>");
} else {
out
.print("<script>alert('添加失败!');window.history.go(-1);</script>");
}
}
}
}

posted @ 2013-08-22 14:07  meimao5211  阅读(234)  评论(0编辑  收藏  举报