public ActionResult SaveClassInformation(ClassWithManagment c, int action = 0, int cancel = 0) { if (action == 0) { return(RedirectToActionPermanent("ClassFullInf", "Teacher", new { id = c.Class_ID })); } else { ClassesDB.UpdateClass(c.Class_ID, c.Formation_Date, c.Class_Name); ClassWithManagment cl = ClassesDB.GetClassFullInf(c.Class_ID); if (cl.Teacher_ID != c.Teacher_ID) { ClassesDB.FinishClassManagment(c.ClassManagment_ID); ClassesDB.AddClassManagment(c.Class_ID, c.Teacher_ID); } return(RedirectToActionPermanent("ClassFullInf", "Teacher", new { id = c.Class_ID })); } }