* @return boolean value whether add was successful or not
*/
public boolean addSection(SectionInformationObject sio) {
if (!checkSectionExists(sio)) {
Key k = makeParentKey(sio);
Transaction txn = datastore.beginTransaction();
Entity e = new Entity(SECTION_KIND, k);
e.setProperty(DEPARTMENT_ID_PROPERTY, sio.getDepartmentId());
e.setProperty(COURSE_ID_PROPERTY, sio.getCourseId());
e.setProperty(SECTION_ID_PROPERTY, sio.getSectionId());
e.setProperty(ACTIVITY_PROPERTY, sio.getActivity());
e.setProperty(TERM_PROPERTY, sio.getTerm());
e.setProperty(DAY_PROPERTY, sio.getDay());
e.setProperty(LOCATION_PROPERTY, sio.getLocation());
e.setProperty(START_PROPERTY, sio.getStart());
e.setProperty(END_PROPERTY, sio.getEnd());
e.setProperty(INSTRUCTOR_PROPERTY, sio.getInstructor());
e.setProperty(BUILDING_PROPERTY, sio.getBuilding());
e.setProperty(ROOM_PROPERTY, sio.getRoom());
e.setProperty(CDF_PROPERTY, sio.isCdf());
e.setProperty(DROP_NO_W_PROPERTY, sio.getDropNoWDate());
e.setProperty(DROP_W_PROPERTY, sio.getDropWDate());
datastore.put(e);
txn.commit();
System.out.println("Added section: " + sio.getSectionId());
return true;
}
return false;
}