src/main/java/seedu/address/logic/commands/commandAssign/AssignAssignmentToCourseCommand.java
@Override
    protected CommandResult executeUndoableCommand(Model model) throws CommandException {
        // Check whether both IDs even exists
        ID courseID = this.assignDescriptor.getAssignID(PREFIX_COURSEID);
        ID assignmentID = this.assignDescriptor.getAssignID(PREFIX_ASSIGNMENTID);

        Course assignedCourse = (Course) model.get(courseID, Constants.ENTITY_TYPE.COURSE);
        Assignment assigningAssignment = (Assignment) model.get(assignmentID, Constants.ENTITY_TYPE.ASSIGNMENT);

        // Only called after you undo an unassignAssignmentToCourse
        // Ensures that previously completed assignments can be retrieved
        if (this.undoProgresses != null) {
            ProgressManager.addUndoProgress(this.undoProgresses);
        } else {
            ProgressManager.addOneProgressToAllStudents(courseID, assignmentID);
        }

        EdgeManager.assignAssignmentToCourse(assignmentID, courseID);

        return new CommandResult(String.format(MESSAGE_SUCCESS,
                assigningAssignment.getName(), assignmentID.value,
                assignedCourse.getName(), courseID.value));
    }
/**
     * Executes the Assigning of Assignment to Course by calling EdgeManager and Progress Manager
     *
     * @param model
     * @return CommandResult of successful command execution
     * @throws CommandException
     */
Executes the Assigning of Assignment to Course by calling EdgeManager and Progress Manager
@param model
@return CommandResult of successful command execution
@throws CommandException
Executes the Assigning of Assignment to Course by calling EdgeManager and Progress Manager @param model @return CommandResult of successful command execution @throws CommandException
@Override
    protected CommandResult executeUndoableCommand(Model model) throws CommandException {
        ID courseID = this.assignDescriptor.getAssignID(PREFIX_COURSEID);
        ID assignmentID = this.assignDescriptor.getAssignID(PREFIX_ASSIGNMENTID);
        Course assignedCourse = (Course) model.get(courseID, Constants.ENTITY_TYPE.COURSE);
        Assignment assigningAssignment = (Assignment) model.get(assignmentID, Constants.ENTITY_TYPE.ASSIGNMENT);
        if (this.undoProgresses != null) {
            ProgressManager.addUndoProgress(this.undoProgresses);
        } else {
            ProgressManager.addOneProgressToAllStudents(courseID, assignmentID);
        }
        EdgeManager.assignAssignmentToCourse(assignmentID, courseID);
        return new CommandResult(String.format(MESSAGE_SUCCESS,
                assigningAssignment.getName(), assignmentID.value,
                assignedCourse.getName(), courseID.value));
    }
@ Override protected CommandResult executeUndoableCommand ( Model model ) throws CommandException { ID courseID = this . assignDescriptor . getAssignID ( PREFIX_COURSEID ) ; ID assignmentID = this . assignDescriptor . getAssignID ( PREFIX_ASSIGNMENTID ) ; Course assignedCourse = ( Course ) model . get ( courseID , Constants . ENTITY_TYPE . COURSE ) ; Assignment assigningAssignment = ( Assignment ) model . get ( assignmentID , Constants . ENTITY_TYPE . ASSIGNMENT ) ; if ( this . undoProgresses != null ) { ProgressManager . addUndoProgress ( this . undoProgresses ) ; } else { ProgressManager . addOneProgressToAllStudents ( courseID , assignmentID ) ; } EdgeManager . assignAssignmentToCourse ( assignmentID , courseID ) ; return new CommandResult ( String . format ( MESSAGE_SUCCESS , assigningAssignment . getName ( ) , assignmentID . value , assignedCourse . getName ( ) , courseID . value ) ) ; }
Executes the Assigning of Assignment to Course by calling EdgeManager and Progress Manager
 @param model
 @return CommandResult of successful command execution
 @throws CommandException
Executes the Assigning of Assignment to Course by calling EdgeManager and Progress Manager @param model @return CommandResult of successful command execution @throws CommandException
// Check whether both IDs even exists // Only called after you undo an unassignAssignmentToCourse // Ensures that previously completed assignments can be retrieved