📄 revertservice.java
字号:
package edu.yinhe.mis.services;
import java.sql.Connection;
import java.sql.SQLException;
import java.util.ArrayList;
import javax.sql.DataSource;
import edu.yinhe.mis.dto.CardDTO;
import edu.yinhe.mis.dto.RevertDTO;
import edu.yinhe.mis.model.DAOFactory;
import edu.yinhe.mis.model.RevertDAO;
import edu.yinhe.mis.vo.CardVO;
import edu.yinhe.mis.vo.RevertVO;
import edu.yinhe.system.common.AppException;
import edu.yinhe.system.model.IBaseDAO;
import edu.yinhe.system.services.IService;
import edu.yinhe.system.services.Service;
/**
*
* @author 小齐
*
*/
public class RevertService extends Service {
private IBaseDAO dao=null;
private IBaseDAO rdao=null;
public Object alllist() throws AppException {
// TODO Auto-generated method stub
return null;
}
public Object alllist(Object arg0) throws AppException {
// TODO Auto-generated method stub
return null;
}
public Object create(Object obj) throws AppException {
dao = DAOFactory.getRevertDAO(conn);
RevertDTO dto = (RevertDTO) obj;
boolean j = false;
Object[] objs = new Object[2];
try {
j = (Boolean) dao.insert(dto);
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} finally{
closeConnection();
}
return j;
}
private IBaseDAO getRevertDAO(Connection conn) {
// TODO Auto-generated method stub
return null;
}
public Object findAll() throws AppException {
// TODO Auto-generated method stub
return null;
}
public Object findAll(Object obj) throws AppException {
ArrayList list = new ArrayList();
dao = DAOFactory.getRevertDAO(conn);
try {
list = (ArrayList)dao.findAll(obj);
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}finally
{
closeConnection();
}
return list;
}
public Object findById(Object obj) throws AppException {
Integer id = (Integer) obj;
CardDTO cdto = new CardDTO();
cdto.setID(id);
RevertDTO rdto = new RevertDTO();
rdto.setCARD_ID(id);
Object[] objs = new Object[2];
try {
dao =DAOFactory.getCardDAO(conn);
rdao =DAOFactory.getRevertDAO(conn);
CardVO cardvo = (CardVO) dao.findById(cdto);
objs[0] = cardvo;
objs[1] = rdao.findAll(rdto);
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}finally{
closeConnection();
}
return objs;
}
public Object findByObject(Object arg0) throws AppException {
// TODO Auto-generated method stub
return null;
}
public int getcount() throws AppException {
// TODO Auto-generated method stub
return 0;
}
public int getcount(Object arg0) throws AppException {
// TODO Auto-generated method stub
return 0;
}
public Object list() throws AppException {
// TODO Auto-generated method stub
return null;
}
public Object list(Object arg0) throws AppException {
// TODO Auto-generated method stub
return null;
}
public Object load(Object arg0) throws AppException {
// TODO Auto-generated method stub
return null;
}
public Object modify(Object obj) throws AppException {
dao = DAOFactory.getRevertDAO(conn);
boolean falg = false;
Integer id = (Integer) obj;
try {
falg = (Boolean) dao.update(id);
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} finally{
closeConnection();
}
return falg;
}
public Object remove(Object obj) throws AppException {
RevertVO vo =(RevertVO) obj;
dao = DAOFactory.getRevertDAO(conn);
try {
vo = (RevertVO)dao.delete(obj);
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}finally{
closeConnection();
}
return vo;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -