public SingleRsp DeleteCourse(CourseReq crs)
        {
            var    res    = new SingleRsp();
            Course course = new Course();

            course.Id          = crs.Id;
            course.Lession     = crs.Lession;
            course.Description = crs.Description;
            course.Term        = crs.Term;
            course.LevelId     = crs.LevelId;
            course.CategoryId  = crs.CategoryId;
            res = _rep.DeleteCourse(course);
            return(res);
        }
 private void AddPreReq(object parameter)
 {
     if (PreReqToAdd != null)
     {
         if (PreReqToAdd == SelectedCourse)
         {
             MessageBox.Show("You cannot add a course as it's own prereq!", "Training Database", MessageBoxButton.OK, MessageBoxImage.Exclamation);
         }
         else
         {
             CourseReq newreq = new CourseReq();
             newreq.CourseID = SelectedCourse.ID;
             newreq.PreReq   = PreReqToAdd;
             db.CourseReqs.Add(newreq);
             PreReqs        = db.CourseReqs.Local.Where(p => p.CourseID == SelectedCourse.ID).ToList();
             SelectedPreReq = newreq;
             NotifyPropertyChanged("Changed");
         }
     }
 }
示例#3
0
        public IActionResult DeleteCourse([FromBody] CourseReq req)
        {
            var res = _svc.DeleteCourse(req);

            return(Ok(res));
        }