Ejemplo n.º 1
0
        public ActionResult CreateCourses(CourseViewModels model)
        {
            if (ModelState.IsValid)
            {
                Courses courses = new Courses();
                courses.CourseName = model.CourseName;

                db.Courses.Add(courses);
                db.SaveChanges();

                Teachers teachers = new Teachers();
                teachers.FirstName        = model.FirstName;
                teachers.LastName         = model.LastName;
                teachers.ShortDescription = teachers.ShortDescription;
                teachers.ImageUrl         = teachers.ImageUrl;

                teachers.TeacherId = courses.CourseId;

                db.Teachers.Add(teachers);
                db.SaveChanges();

                return(RedirectToAction("Index"));
            }


            return(View());
        }
Ejemplo n.º 2
0
 public int Save()
 {
     return(db.SaveChanges());
 }
Ejemplo n.º 3
0
 public void GetFeedbacks(Feedback newfeedback)
 {
     _FeedbackContext.Add(newfeedback);
     _FeedbackContext.SaveChanges();
 }
Ejemplo n.º 4
0
 public void CreateTeacher(Teachers newteachers)
 {
     _musicSchoolContext.Add(newteachers);
     _musicSchoolContext.SaveChanges();
 }
Ejemplo n.º 5
0
 public void CreateCourse(Courses newcourses)
 {
     _musicSchoolContext.Add(newcourses);
     _musicSchoolContext.SaveChanges();
 }