public ActionResult Create([Bind(Include = "ID,TName")] Teacher teacher)
        {
            if (ModelState.IsValid)
            {
                db.Teachers.Add(teacher);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(teacher));
        }
        public ActionResult Create([Bind(Include = "ID,ClassID")] Grades grades)
        {
            if (ModelState.IsValid)
            {
                db.Grades.Add(grades);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(grades));
        }
示例#3
0
        public ActionResult Create([Bind(Include = "ID,TeacherID,StudentID")] Class @class)
        {
            if (ModelState.IsValid)
            {
                db.Classes.Add(@class);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(@class));
        }
示例#4
0
        public ActionResult Create([Bind(Include = "ID,SName,SLastName,SAge")] Student student)
        {
            if (ModelState.IsValid)
            {
                db.Students.Add(student);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(student));
        }
        public ActionResult Create([Bind(Include = "ID,SemesterName,TeacherID,StudentID")] Semester semester)
        {
            if (ModelState.IsValid)
            {
                db.Semesters.Add(semester);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(semester));
        }