📄 examservice.java
字号:
package edu.yinhe.mis.services;
import java.sql.SQLException;
import java.util.ArrayList;
import javax.sql.DataSource;
import edu.yinhe.mis.dto.DemoDTO;
import edu.yinhe.mis.dto.ExamineeDTO;
import edu.yinhe.mis.dto.IExamDTO;
import edu.yinhe.mis.dto.Reply_cardDTO;
import edu.yinhe.mis.model.DAOFactory;
import edu.yinhe.mis.vo.CheckInfoVO;
import edu.yinhe.mis.vo.DemoVO;
import edu.yinhe.mis.vo.ExamVO;
import edu.yinhe.mis.vo.ExamineeVO;
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 ExamService extends Service {
private IBaseDAO idao=null;
public Object alllist() throws AppException {
return null;
}
public Object alllist(Object arg0) throws AppException {
return null;
}
public Object create(Object obj) throws AppException {
Reply_cardDTO reply_cardDTO=null;
boolean isOK=false;
try {
idao=DAOFactory.getExamDAO(conn);
reply_cardDTO=(Reply_cardDTO)obj;
isOK=(Boolean) idao.insert(reply_cardDTO);
} catch (SQLException e) {
e.printStackTrace();
}finally{
this.closeConnection();
}
return isOK;
}
public Object findAll() throws AppException {
return null;
}
public Object findAll(Object arg0) throws AppException {
return null;
}
public Object findById(Object arg0) throws AppException {
return null;
}
public Object findByObject(Object obj) throws AppException {
IExamDTO idto=null;
ArrayList testList=null;
ArrayList ruleList=null;
ExamVO examVO=null;
Object[] object=null;
try {
idto=(IExamDTO)obj;
idao=DAOFactory.getExamDAO(conn);
testList=(ArrayList) idao.find(idto);
if(testList.size()!=0&&idto!=null){
examVO=(ExamVO) testList.get(0);
idto.setFlag(2);
idto.setTestPaperRuleID(examVO.getTestPaperRule_NO());
ruleList=(ArrayList) idao.find(idto);
}
if(testList.size()!=0&&ruleList.size()!=0){
object=new Object[2];
object[0]=testList;
object[1]=ruleList;
}
} catch (SQLException e) {
e.printStackTrace();
}finally{
idto=null;
this.closeConnection();
}
return object;
}
public int getcount() throws AppException {
return 0;
}
public int getcount(Object arg0) throws AppException {
return 0;
}
public Object list() throws AppException {
return null;
}
public Object list(Object obj) throws AppException {
ExamineeDTO examineeDTO =null;
ExamineeVO examineeVO=null;
try {
examineeDTO=(ExamineeDTO)obj;
idao=DAOFactory.getExamDAO(conn);
examineeVO=(ExamineeVO) idao.findByObject(examineeDTO);
} catch (SQLException e) {
e.printStackTrace();
}finally{
examineeDTO=null;
}
return examineeVO;
}
public Object load(Object obj) throws AppException {
Integer checkID;
CheckInfoVO checkInfoVO=null;
try {
checkID=(Integer)obj;
idao=DAOFactory.getExamDAO(conn);
checkInfoVO=(CheckInfoVO) idao.findById(checkID);
} catch (SQLException e) {
e.printStackTrace();
}finally{
this.closeConnection();
}
return checkInfoVO;
}
public Object modify(Object obj) throws AppException {
boolean isTrue=false;
Reply_cardDTO reply_cardDTO=null;
try {
reply_cardDTO=(Reply_cardDTO)obj;
idao=DAOFactory.getExamDAO(conn);
isTrue=(Boolean) idao.update(reply_cardDTO);
} catch (SQLException e) {
e.printStackTrace();
}finally{
this.closeConnection();
}
return isTrue;
}
public Object remove(Object arg0) throws AppException {
return null;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -