Ejemplo n.º 1
0
        public ActionResult Create([Bind(Include = "ID,Department_name,Acronym,Department_description")] Department department)
        {
            if (ModelState.IsValid)
            {
                db.Departments.Add(department);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(department));
        }
Ejemplo n.º 2
0
        public ActionResult Create([Bind(Include = "CourseId,CourseCode,CourseName,CourseCredit,CourseDescription,DepartmentId,SemisterId")] Course course)
        {
            if (ModelState.IsValid)
            {
                db.Courses.Add(course);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(course));
        }