Ejemplo n.º 1
0
        public IEnumerable <Models.TeacherCourseResourceModel> GetTeachingOfResource(int idResource)
        {
            List <TeacherCourseResourceModel> Tmodel = new List <TeacherCourseResourceModel>();

            foreach (Entities.TEACHING teach in TeacherManager.GetAllTeachings().Where(t => t.ID_Resource == idResource).ToList())
            {
                Tmodel.Add(TeacherCourseResourceModel.MapModel(teach, teach.RESOURCE, teach.COURSE));
            }

            return(Tmodel);
        }
Ejemplo n.º 2
0
        public IEnumerable <Models.TeacherCourseResourceModel> GetAll()
        {
            List <TeacherCourseResourceModel> Tmodel = new List <TeacherCourseResourceModel>();

            foreach (Entities.TEACHING teach in TeacherManager.GetAllTeachings())
            {
                Tmodel.Add(TeacherCourseResourceModel.MapModel(teach, teach.RESOURCE, teach.COURSE));
            }

            return(Tmodel);
        }
Ejemplo n.º 3
0
 public IHttpActionResult GetTeacher(int id)
 {
     Entities.TEACHING teaching = TeacherManager.GetTeaching(id);
     if (teaching != null)
     {
         TeacherCourseResourceModel Tmodel = TeacherCourseResourceModel.MapModel(teaching, teaching.RESOURCE, teaching.COURSE);
         return(Ok(Newtonsoft.Json.JsonConvert.SerializeObject(Tmodel)));
     }
     else
     {
         return(NotFound());
     }
 }