Esempio n. 1
0
        public override bool Equals(object obj)
        {
            PrerequisiteCourse course = obj as PrerequisiteCourse;

            if (course != null)
            {
                if (course.ID == ID)
                {
                    return(true);
                }
                return(false);
            }
            return(base.Equals(obj));
        }
 /// <summary>
 /// @russfeld
 /// This uses AJAX to return the HTML code for a new course row on the form
 /// Mad props to http://ivanz.com/2011/06/16/editing-variable-length-reorderable-collections-in-asp-net-mvc-part-1/
 /// </summary>
 /// <returns></returns>
 public ActionResult PrerequisiteCourseRow(int id = 0)
 {
     if (id > 0)
     {
         PrerequisiteCourse reqcourse = new PrerequisiteCourse()
         {
             prerequisiteForCourseID = id,
             prerequisiteCourseID = -1,
         };
         return PartialView("PrerequisiteCourseFormPartial", reqcourse);
     }
     else
     {
         return PartialView("PrerequisiteCourseFormPartial");
     }
 }