Пример #1
0
        // public TeacherDTO Teacher { get; set; }

        public static CourseDTO CourseConvertDTO(DAL.Course d)
        {
            return(new CourseDTO()
            {
                CourseId = d.CourseId,
                CourseName = d.CourseName,
                CourseDescribe = d.CourseDescribe,
                Proffestion = d.Proffestion,
                MinUseres = d.MinUseres,
                MaxUseres = d.MaxUseres,
                IdTeacher = d.IdTeacher,
                CoursePrice = d.CoursePrice
                              //  Teacher=TeacherDTO.TeacherConvertDTO(d.Teacher)
            });
        }
Пример #2
0
        public ActionResult Edit(Course course)
        {
            var db = DAL.DbContext.Create();
            if (ModelState.IsValid)
            {
                db.UpdateCourse(course);
                return RedirectToAction("Index");
            }

            return View(course);
        }