示例#1
0
        public IHttpActionResult DeleteTS(int id)
        {
            TeacherSubject ts = teacherSubjectService.GetTeacherSubject(id);

            if (ts == null)
            {
                logger.Warn("This search does not exist");
                return(NotFound());
            }

            return(Ok(teacherSubjectService.DeleteTS(id)));
        }
        public IHttpActionResult PostSTS(string studentUsername, int teacherSubjectId)
        {
            Student student = studentService.GetStudentByUserName(studentUsername);

            if (student == null)
            {
                logger.Warn("This search does not exist");
                return(NotFound());
            }
            TeacherSubject ts = teacherSubjectService.GetTeacherSubject(teacherSubjectId);

            if (ts == null)
            {
                logger.Warn("This search does not exist");
                return(NotFound());
            }

            return(Created("PostSTS", stsService.PostSTS(studentUsername, teacherSubjectId)));
        }