Esempio n. 1
0
        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 }));
            }
        }
Esempio n. 2
0
 public ActionResult AddNewClass(ClassWithManagment c)
 {
     ClassesDB.AddClass(c.Class_Name, DateTime.Now);
     ClassesDB.AddClassManagment(ClassesDB.GetClassId(c.Class_Name), c.Teacher_ID);
     return(RedirectToActionPermanent("ViewClasses", "Teacher"));
 }