public static void delete(Long id) { Institution institution = find.ref(id); if (institution == null) { return; } institution.retired = true; institution.save(); }
public static Scenario edit( Long scenarioId, String newName, Boolean newIsPublic, Date newExpirationDate, Boolean isAccepted) { Scenario scenario = find.ref(scenarioId); if (newName != null && !newName.equals(scenario.name)) { scenario.name = newName; } if (newIsPublic != null && newIsPublic != scenario.isPublic) { scenario.isPublic = newIsPublic; } if (newExpirationDate != null && !newExpirationDate.equals(scenario.expirationDate)) { scenario.expirationDate = newExpirationDate; } scenario.isAccepted = isAccepted; scenario.editedBy = null; scenario.save(); return scenario; }
public static void edit( Long id, SchoolClass schoolClass, String date, String kindOfAssignment, String description) { Assignment assignment = find.ref(id); assignment.schoolClass = schoolClass; String[] array = parseDate(date); String dueDate = array[0]; assignment.dueDate = dueDate; int year = Integer.parseInt(array[1]); assignment.year = year; int month = Integer.parseInt(array[2]); assignment.month = month; int day = Integer.parseInt(array[3]); assignment.day = day; assignment.spanner = kindOfAssignment.substring(0, 1); assignment.description = description; assignment.total = (year * 366) - ((12 - month) * 31) - (31 - day); try { assignment.save(); } catch (PersistenceException e) { System.err.println("Unable to save an assignment after editing. ID: " + id); } }
public static void delete(Long id) { find.ref(id).delete(); }
public static IdentityDocType get(Long id) { return find.ref(id); }
public static Layout get(Long id) { return find.ref(id); }
// Deletes a display with a given id public static void delete(Long id) { find.ref(id).delete(); // createXMLfile(Display.all()); }
public static Doctor get(Long id) { return find.ref(id); }
public static Showreel get(Long id) { return find.ref(id); }