Ejemplo n.º 1
0
 private void AddModule(CurriculumModule module)
 {
     if (Db.CurriculumModules.Any(m => m.ModuleId.Equals(module.ModuleId)))
     {
         return;
     }
     Db.CurriculumModules.Add(module);
     Db.SaveChanges();
 }
Ejemplo n.º 2
0
        public ActionResult Create(CurriculumModule model)
        {
            var member = GetMyMembership();

            model.MV = member;
            Db.CurriculumModules.Add(model);
            Db.SaveChanges();

            return(RedirectToAction("Details", new { id = model.Id }));
        }
Ejemplo n.º 3
0
 public ActionResult EditModule(CurriculumModule module)
 {
     return(RedirectToAction("Index"));
 }
Ejemplo n.º 4
0
        public ActionResult Create(CurriculumModuleCreateModel model)
        {
            var member = GetMyMembership();

            // TODO: eine Art "Auto-Akkreditierung???
            var curriculum = Db.Curricula.SingleOrDefault(x => x.Id == model.CurriculumId);

            var module = new CurriculumModule
            {
                Name      = model.Name,
                ShortName = model.ShortName,
                ModuleId  = model.ModuleId,
                MV        = member
            };


            var primaryTechingUnit = "";

            switch (model.LectureType)
            {
            case 1:
                primaryTechingUnit = "Seminaristischer Unterricht";
                break;

            case 2:
                primaryTechingUnit = "Seminar";
                break;

            case 3:
                primaryTechingUnit = "Vorlesung";
                break;
            }


            var primaryCourse = new ModuleCourse
            {
                Name   = primaryTechingUnit,
                Module = module
            };

            Db.ModuleCourses.Add(primaryCourse);


            if (model.HasPractice)
            {
                var secCourse = new ModuleCourse
                {
                    Name   = "Übung",
                    Module = module
                };
                Db.ModuleCourses.Add(secCourse);
            }

            if (model.HasTutorium)
            {
                var secCourse = new ModuleCourse
                {
                    Name   = "Tutorium",
                    Module = module
                };
                Db.ModuleCourses.Add(secCourse);
            }


            if (model.HasLaboratory)
            {
                var secCourse = new ModuleCourse
                {
                    Name   = "Laborpraktikum",
                    Module = module
                };
                Db.ModuleCourses.Add(secCourse);
            }


            Db.CurriculumModules.Add(module);
            Db.SaveChanges();


            return(RedirectToAction("Details", new { id = module.Id }));
        }