public ActionResult Add(Course course)
 {
     db.Courses.Add(course);
     db.SaveChanges();
     BusinessLayer.Mail.SendMail("*****@*****.**", course.Name);
     return(RedirectToAction("MyCourses", "Courses"));
 }
        public ActionResult Add(Lesson lesson)
        {
            db.Lessons.Add(lesson);

            db.SaveChanges();

            return(RedirectToAction("Course", "Courses", new { Id = lesson.CourseId }));
        }
Esempio n. 3
0
        public ActionResult AcceptRezult(int rezId)//подтвердить результат экзамена
        {
            Result r = db.Results.Where(re => re.Id == rezId).FirstOrDefault();

            r.Status = 1;
            db.SaveChanges();

            return(RedirectToAction("ViewLectorCabinet"));
        }
        public ActionResult SubscribeOnCourse(int Course_id)
        {
            Course cour = db.Courses.Find(Course_id);

            ApplicationUser user = db.Users.Find(User.Identity.GetUserId());

            user.Courses.Add(cour);
            db.SaveChanges();


            //return RedirectToAction("Course", "Courses", new { Id = Course_id });
            return(RedirectToAction("ViewSuccessMessage", new { Course_id = Course_id }));
        }
        public ActionResult Add(Test test, bool?IsExam)
        {
            //27 04-режим екзамен



            if (IsExam != null)
            {
                Exam ex = new Exam();
                //ex.Status = 0;

                ex.CourseId = test.CourseId;
                ex.Name     = test.Name;
                ex.Time     = test.Time;

                db.Tests.Add(ex);
                db.SaveChanges();
            }
            else
            {
                db.Tests.Add(test);
                db.SaveChanges();
            }

            return(RedirectToAction("Course", "Courses", new { Id = test.CourseId }));
        }