package in.co.sunrays.proj1.action;
import in.co.sunrays.proj1.dto.MarksheetDTO; import in.co.sunrays.proj1.exception.ApplicationException; import in.co.sunrays.proj1.service.MarksheetServiceInt; import org.apache.log4j.Logger; /** * Get Marksheet functionality Action. Performs operation for Get Marksheet * * @author SUNRAYS Technologies * @version 1.0 * @Copyright (c) SUNRAYS Technologies */ public class GetMarksheetAction extends BaseAction { private static Logger log = Logger.getLogger(GetMarksheetAction.class); private String rollNo; private String name; private Integer physics; private Integer chemistry; private Integer maths; private MarksheetServiceInt service; public void setService(MarksheetServiceInt service) { this.service = service; } public String getName() { return name; } public void setName(String name) { this.name = name; } public Integer getPhysics() { return physics; } public void setPhysics(Integer physics) { this.physics = physics; } public Integer getChemistry() { return chemistry; } public void setChemistry(Integer chemistry) { this.chemistry = chemistry; } public Integer getMaths() { return maths; } public void setMaths(Integer maths) { this.maths = maths; } public String getRollNo() { return rollNo; } public void setRollNo(String rollNo) { this.rollNo = rollNo; } /** * Performs display operations for GetMarksheetAction * * @return type String * @return INPUT */ @Override public String input() { log.debug("GetMarksheetAction.input() Start"); if (rollNo != null && rollNo.length() > 0) { try { MarksheetDTO dto = service.findByRollNo(rollNo); if (dto != null) { id = dto.getId(); rollNo = dto.getRollNo(); name = dto.getName(); physics = dto.getPhysics(); chemistry = dto.getChemistry(); maths = dto.getMaths(); } else { addActionError("Rollno not exist"); } } catch (ApplicationException e) { log.error("Critical Issue", e); return OP_ERROR; } } log.debug("GetMarksheetAction.input() End"); return INPUT; } /** * Performs submit operations for GetMarksheetAction * * @return type String * @return SUCCESS */ @Override public String execute() throws Exception { log.debug("GetMarksheetAction.execute() Start"); log.debug("GetMarksheetAction.execute() End"); return SUCCESS; } } |