public override bool Equals(object obj)
        {
            ElectiveListCourse course = obj as ElectiveListCourse;

            if (course != null)
            {
                if (course.ID == ID)
                {
                    return(true);
                }
                return(false);
            }
            return(base.Equals(obj));
        }
 public void ElectiveListCourseEquality()
 {
     ElectiveListCourse course1 = new ElectiveListCourse()
     {
         ID = 1,
         electiveListID = 1
     };
     ElectiveListCourse course2 = new ElectiveListCourse()
     {
         ID = 1,
         electiveListID = 2
     };
     Assert.AreEqual(course1, course2);
 }
Ejemplo n.º 3
0
 /// <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 ElectiveListCourseRow(int id = 0)
 {
     if (id > 0)
     {
         ElectiveListCourse reqcourse = new ElectiveListCourse()
         {
             electiveListID = id,
             courseID = -1,
         };
         return PartialView("ElectiveListCourseFormPartial", reqcourse);
     }
     else
     {
         return PartialView("ElectiveListCourseFormPartial");
     }
 }