}
public TimeSlipDBVO getDBVO(int timeSlipId, int userId)
{
TimeSlipDBVO tdbvo = new TimeSlipDBVO();
int projectId = 0;
int activityId = 0;
try
{
CVDal cvdl = new CVDal(dataSource);
cvdl.setSql( "projecttimeslip.gettimeSlip" );
cvdl.setInt( 1 , timeSlipId );
Collection col = cvdl.executeQuery();
Iterator ite = col.iterator();
if (ite.hasNext())
{
HashMap hm = (HashMap)ite.next();
tdbvo.setTimeSlipID(((Long)hm.get("timeslipid")).intValue());
if(hm.get("projectid")!=null)
tdbvo.setProjectID(((Long)hm.get("projectid")).intValue());
//tvo.setProjectTitle((String)hm.get("projecttitle"));
//tvo.setTaskTitle((String)hm.get("title"));
if(hm.get("activityid")!=null)
tdbvo.setTaskID(((Integer)hm.get("activityid")).intValue());
if(hm.get("ticketid")!=null){
tdbvo.setTicketID(((Long)hm.get("ticketid")).intValue());
}
else{
tdbvo.setTicketID(0);
}
tdbvo.setDescription((String)hm.get("description"));
tdbvo.setDate((java.sql.Date)hm.get("date"));
tdbvo.setStart((java.sql.Time)hm.get("start"));
tdbvo.setEnd((java.sql.Time)hm.get("end"));
tdbvo.setBreakTime(((Double)hm.get("breaktime")).floatValue());
tdbvo.setHours(((Double)hm.get("hours")).floatValue());
}
cvdl.clearParameters();
if (tdbvo.getProjectID() !=0 )
{
cvdl.setSql("projecttimeslip.getprojecttimeSlip");
cvdl.setInt(1, tdbvo.getProjectID());
col = cvdl.executeQuery();
ite = col.iterator();
if(ite.hasNext())
{
HashMap hm = (HashMap)ite.next();
tdbvo.setProjectTitle((String)hm.get("projecttitle"));
}
cvdl.clearParameters();
}
if (tdbvo.getTaskID() !=0 )
{
cvdl.setSql("projecttimeslip.getactivitytimeSlip");
cvdl.setInt(1, tdbvo.getTaskID());
col = cvdl.executeQuery();
ite = col.iterator();
if(ite.hasNext())
{
HashMap hm = (HashMap)ite.next();
tdbvo.setTaskTitle((String)hm.get("title"));
}
cvdl.clearParameters();
}
if (tdbvo.getTicketID() !=0 )
{
cvdl.setSqlQuery("select subject from ticket where ticketid ="+tdbvo.getTicketID());
col = cvdl.executeQuery();
ite = col.iterator();
if(ite.hasNext())
{
HashMap hm = (HashMap)ite.next();
tdbvo.setTicket((String)hm.get("subject"));
}
cvdl.clearParameters();
}
cvdl.destroy();