Beispiel #1
0
        public ActionResult Create([Bind(Include = "Id,Name,ClassTd")] Students students)
        {
            if (ModelState.IsValid)
            {
                db.Students.Add(students);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(students));
        }
Beispiel #2
0
        public ActionResult Create([Bind(Include = "ID,Name,TeacherID")] Classes classes)
        {
            if (ModelState.IsValid)
            {
                db.Classes.Add(classes);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(classes));
        }
        public ActionResult Create([Bind(Include = "Id,Name")] Teacher teacher)
        {
            if (ModelState.IsValid)
            {
                db.Teacher.Add(teacher);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(teacher));
        }
        public ActionResult Create([Bind(Include = "Id,Name,Controller,Action")] Sidebar sidebar)
        {
            if (ModelState.IsValid)
            {
                db.Sidebar.Add(sidebar);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(sidebar));
        }
Beispiel #5
0
        public ActionResult Create([Bind(Include = "Id,Name")] Course course)
        {
            if (ModelState.IsValid)
            {
                db.Course.Add(course);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(course));
        }
        public ActionResult Create([Bind(Include = "Id,Name,Controller,Action")] ActionLinks actionLinks)
        {
            if (ModelState.IsValid)
            {
                db.ActionLinks.Add(actionLinks);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(actionLinks));
        }
        public ActionResult Create([Bind(Include = "Id,ClassId,TeacherId,CourseId")] CourseManagement courseManagement)
        {
            if (ModelState.IsValid)
            {
                db.CourseManagement.Add(courseManagement);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(courseManagement));
        }
 public int SaveChanges()
 {
     return(_dataContext.SaveChanges());
 }