HttpSession session = request.getSession(true);
UserObject userobjectd = (UserObject) session.getAttribute("userobject");
int individualID = userobjectd.getIndividualID();
TimeSlipForm dynaForm = (TimeSlipForm) form;
TimeSlipVO timeSlipVO = null;
//AddressVO primaryAdd = null;
ProjectFacadeHome pfh = (ProjectFacadeHome)
CVUtility.getHomeObject("com.centraview.projects.projectfacade.ProjectFacadeHome", "ProjectFacade");
try
{
ProjectFacade remote = (ProjectFacade) pfh.create();
remote.setDataSource(dataSource);
timeSlipVO = remote.getTimeSlip(Integer.parseInt(rowId), individualID);
dynaForm.setTimeSlipID(new Integer(timeSlipVO.getTimeSlipID()).toString());
if (timeSlipVO.getProjectID() != 0)
{
dynaForm.setProjectID(Integer.toString(timeSlipVO.getProjectID()));
}
if (timeSlipVO.getProjectTitle() != null)
{
dynaForm.setProject(timeSlipVO.getProjectTitle());
dynaForm.setReference(timeSlipVO.getProjectTitle());
if(!timeSlipVO.getProjectTitle().equals("")){
dynaForm.setLookupList("1");
}
}
if (timeSlipVO.getTaskTitle() != null)
{
dynaForm.setTask(timeSlipVO.getTaskTitle());
}
if (timeSlipVO.getTaskID() != 0)
{
dynaForm.setActivityID(Integer.toString(timeSlipVO.getTaskID()));
}
if (timeSlipVO.getDescription() != null)
{
dynaForm.setDescription(timeSlipVO.getDescription());
}
if (timeSlipVO.getTicketID() != 0)
{
dynaForm.setTicketID(Integer.toString(timeSlipVO.getTicketID()));
}
else
{
dynaForm.setTicketID("0");
}
if (timeSlipVO.getTicket() != null)
{
dynaForm.setTicket(timeSlipVO.getTicket());
if(!timeSlipVO.getTicket().equals("")){
dynaForm.setReference(timeSlipVO.getTicket());
dynaForm.setLookupList("2");
}
}
if (timeSlipVO.getDate() != null)
{
Calendar calendar = Calendar.getInstance();
calendar.setTime(timeSlipVO.getDate());
dynaForm.setDay(new Integer(calendar.get(Calendar.DAY_OF_MONTH)).toString());
dynaForm.setMonth(new Integer(calendar.get(Calendar.MONTH) + 1).toString());
dynaForm.setYear(new Integer(calendar.get(Calendar.YEAR)).toString());
}
if (timeSlipVO.getStart() != null)
{
tStartTime = (Time) timeSlipVO.getStart();
Calendar calendarStart = Calendar.getInstance();
calendarStart.setTime(tStartTime);
startHrs = calendarStart.get(Calendar.HOUR_OF_DAY);
startMins = calendarStart.get(Calendar.MINUTE);
DateFormat df = new SimpleDateFormat("h:mm a");
dynaForm.setStartTime((df.format(timeSlipVO.getStart())).toString());
}
if (timeSlipVO.getEnd() != null)
{
tEndTime = (Time) timeSlipVO.getEnd();
Calendar calendarEnd = Calendar.getInstance();
calendarEnd.setTime(tEndTime);
endHrs = calendarEnd.get(Calendar.HOUR_OF_DAY);
endMins = calendarEnd.get(Calendar.MINUTE);
DateFormat df = new SimpleDateFormat("h:mm a");
dynaForm.setEndTime((df.format(timeSlipVO.getEnd())).toString());
}
if (timeSlipVO.getBreakTime() != -1)
{
Float BreakTime = new Float(timeSlipVO.getBreakTime());
int iHours = BreakTime.intValue();
float breakTime = (BreakTime.floatValue() - iHours) * 60;
Float Mins = new Float(breakTime);
int iMins = Mins.intValue();
dynaForm.setBreakHours(new Integer(iHours).toString());
dynaForm.setBreakMinutes(new Integer(iMins).toString());
float fBreakTime = timeSlipVO.getBreakTime();
float remMin = 0;
if ((startMins != 0) && (endMins != 0) && (startMins != endMins))
{
if (endMins > startMins)