if (hm.get("ProjectID") != null)
projectID = ((Long)hm.get("ProjectID")).intValue();
StringMember description, projectName = null, taskName = null, createdBy = null;
PureDateMember date = null;
PureTimeMember startTime = null, endTime = null;
IntMember creator, taskId;
IntMember intmem = new IntMember("ID", timeSlipID, 10, "URL", 'T', true, 10);
IntMember projectId = new IntMember("ProjectID", projectID, 10, "URL", 'T', true, 10);
Time tStartTime = (Time)hm.get("Start");
Time tEndTime = (Time)hm.get("End");
java.util.Date dt = (java.util.Date)hm.get("Date");
Calendar calendarStart = Calendar.getInstance();
calendarStart.set(dt.getYear(), dt.getMonth(), dt.getDay(), tStartTime.getHours(),
tStartTime.getMinutes());
Calendar calendarEnd = Calendar.getInstance();
calendarEnd.set(dt.getYear(), dt.getMonth(), dt.getDay(), tEndTime.getHours(), tEndTime
.getMinutes());
long startMili = calendarStart.getTimeInMillis();
long endMili = calendarEnd.getTimeInMillis();
long diff = endMili - startMili;
Time difTime = new Time(diff);
int startHrs = calendarStart.get(Calendar.HOUR_OF_DAY);// startHrsmm[0];
int startMins = calendarStart.get(Calendar.MINUTE);// startHrsmm[1];
int endHrs = calendarEnd.get(Calendar.HOUR_OF_DAY);// endHrsmm[0];
int endMins = calendarEnd.get(Calendar.MINUTE);// endHrsmm[1];
float Duration = 0;
Number dBreakTime = (Number)hm.get("BreakTime");
float BreakTime = dBreakTime.floatValue();
float remMin = 0;
if (startMins != 0 && endMins != 0 && (startMins - endMins != 0)) {
if (endMins > startMins)
remMin = 60 / (endMins - startMins);
else
remMin = 60 / (startMins - endMins);
}
Duration = (endHrs - startHrs) + remMin - BreakTime;
if (hm.get("Description") != null)
description = new StringMember("Description", (String)hm.get("Description"), 10, "", 'T',
false);
else
description = new StringMember("Description", "", 10, "", 'T', false);
if (hm.get("ProjectTitle") != null)
projectName = new StringMember("Project", (String)hm.get("ProjectTitle"), mfrmx
.getFieldRight("Time Slip", "project"), "URL", 'T', true);
else
projectName = new StringMember("Project", "",
mfrmx.getFieldRight("Time Slip", "project"), "URL", 'T', true);
if (hm.get("title") != null)
taskName = new StringMember("Task", (String)hm.get("title"), mfrmx.getFieldRight(
"Time Slip", "task"), "URL", 'T', true);
else
taskName = new StringMember("Task", "", mfrmx.getFieldRight("Time Slip", "task"), "URL",
'T', true);
if (hm.get("activityid") != null)
taskId = new IntMember("TaskID", ((Integer)hm.get("activityid")).intValue(), 10, "URL",
'T', true, 10);
else
taskId = new IntMember("TaskID", 0, 10, "URL", 'T', true, 10);
String firstName = (String)hm.get("FirstName");
String lastName = (String)hm.get("LastName");
String created = (firstName != null ? firstName + " " : "")
+ (lastName != null ? lastName : "");
if (!created.equals(""))
createdBy = new StringMember("CreatedBy", created, 10, "", 'T', true);
else
createdBy = new StringMember("CreatedBy", "", 10, "", 'T', true);
if (hm.get("CreatedBy") != null)
creator = new IntMember("Creator", ((Integer)hm.get("CreatedBy")).intValue(), 10, "URL",
'T', false, 10);
else
creator = new IntMember("Creator", 0, 10, "URL", 'T', false, 10);
if (hm.get("Date") != null)
date = new PureDateMember("Date", (java.util.Date)hm.get("Date"), 10, "URL", 'T', false,
100, "EST");
else
date = new PureDateMember("Date", null, 10, "URL", 'T', false, 100, "EST");
if (hm.get("Start") != null)
startTime = new PureTimeMember("StartTime", (java.util.Date)hm.get("Start"), 10, "URL",
'T', false, 100, "EST");
else
startTime = new PureTimeMember("StartTime", null, 10, "URL", 'T', false, 100, "EST");
if (hm.get("End") != null)
endTime = new PureTimeMember("EndTime", (java.util.Date)hm.get("End"), 10, "URL", 'T',
false, 100, "EST");
else
endTime = new PureTimeMember("EndTime", null, 10, "URL", 'T', false, 100, "EST");
TimeSlipListElement ele = new TimeSlipListElement(timeSlipID);
ele.put("ID", intmem);
ele.put("TaskID", taskId);
ele.put("Description", description);