@Override
 @PreAuthorize("checkPermission('StudentSchedulingStatusTypeEdit')")
 public void save(SimpleEditInterface data, SessionContext context, Session hibSession) {
   for (StudentSectioningStatus status : StudentSectioningStatusDAO.getInstance().findAll()) {
     Record r = data.getRecord(status.getUniqueId());
     if (r == null) delete(status, context, hibSession);
     else update(status, r, context, hibSession);
   }
   for (Record r : data.getNewRecords()) save(r, context, hibSession);
 }
 @Override
 @PreAuthorize("checkPermission('StudentSchedulingStatusTypes')")
 public SimpleEditInterface load(SessionContext context, Session hibSession) {
   List<CourseType> courseTypes = CourseTypeDAO.getInstance().findAll(Order.asc("reference"));
   SimpleEditInterface.Field[] fields =
       new SimpleEditInterface.Field
           [courseTypes.isEmpty()
               ? 3 + StatusOption.values().length
               : 4 + StatusOption.values().length + courseTypes.size()];
   int idx = 0;
   fields[idx++] = new Field(MESSAGES.fieldAbbreviation(), FieldType.text, 160, 20, Flag.UNIQUE);
   fields[idx++] = new Field(MESSAGES.fieldName(), FieldType.text, 300, 60, Flag.UNIQUE);
   for (StatusOption t : StatusOption.values())
     fields[idx++] = new Field(t.getLabel(), FieldType.toggle, 40);
   fields[idx++] = new Field(MESSAGES.fieldMessage(), FieldType.text, 400, 200);
   if (!courseTypes.isEmpty()) {
     for (int i = 0; i < courseTypes.size(); i++)
       fields[idx++] = new Field(courseTypes.get(i).getReference(), FieldType.toggle, 40);
     fields[idx++] = new Field(MESSAGES.toggleNoCourseType(), FieldType.toggle, 40);
   }
   SimpleEditInterface data = new SimpleEditInterface(fields);
   data.setSortBy(0, 1);
   for (StudentSectioningStatus status : StudentSectioningStatusDAO.getInstance().findAll()) {
     Record r = data.addRecord(status.getUniqueId());
     idx = 0;
     r.setField(idx++, status.getReference());
     r.setField(idx++, status.getLabel());
     for (StatusOption t : StatusOption.values())
       r.setField(idx++, status.hasOption(t.getOption()) ? "true" : "false");
     r.setField(idx++, status.getMessage());
     if (!courseTypes.isEmpty()) {
       for (int i = 0; i < courseTypes.size(); i++)
         r.setField(idx++, status.getTypes().contains(courseTypes.get(i)) ? "true" : "false");
       r.setField(
           idx++, status.hasOption(StudentSectioningStatus.Option.notype) ? "false" : "true");
     }
   }
   data.setEditable(context.hasPermission(Right.StudentSchedulingStatusTypeEdit));
   return data;
 }