Пример #1
0
 public IHttpActionResult Delete(int id)
 {
     try
     {
         bool ret = CoursesDAO.Delete(id);
         return(Ok(ret));
     }
     catch (Exception e)
     {
         throw new Exception("", e);
     }
 }
Пример #2
0
 public IHttpActionResult Get(string title = "")
 {
     try
     {
         List <Courses> ret = CoursesDAO.GetAll(title);
         return(Ok(ret));
     }
     catch (Exception e)
     {
         return(InternalServerError(new Exception("ooooops", e)));
     }
 }
Пример #3
0
 public IHttpActionResult Put(Courses bean)
 {
     if (ModelState.IsValid)
     {
         try
         {
             int ret = CoursesDAO.Insert(bean);
             return(Ok(ret));
         }
         catch (Exception e)
         {
             throw new Exception("", e);
             // return NotFound();
         }
     }
     else
     {
         return(NotFound());
     }
 }
Пример #4
0
 public static int SupprimerCourse(int id)
 {
     return(CoursesDAO.DeleteCourse(id));
 }
Пример #5
0
        public static int ModifierCourse(int id, string nom, string lieu, int nbrMax, int unPrice, int unFirst, int unSecond, int unThird, int unFourth, int unFifth, int unHip, int ageMin, int ageMax, string sexe, string uneDate)
        {
            Course crs = new Course(id, nom, lieu, nbrMax, unPrice, unFirst, unSecond, unThird, unFourth, unFifth, unHip, ageMin, ageMax, sexe, uneDate);

            return(CoursesDAO.UpdateCourse(crs));
        }
Пример #6
0
 public static List <Course> GetCourseDunHip(int id)
 {
     return(CoursesDAO.GetCourseDunHip(id));
 }
Пример #7
0
 public static Course GetUneCourse(int id)
 {
     return(CoursesDAO.GetUneCourse(id));
 }
Пример #8
0
 public static List <Course> GetCourses()
 {
     return(CoursesDAO.GetCourses());
 }