示例#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());
 }