Esempio n. 1
0
 public IHttpActionResult GetAllSchools()
 {
     try
     {
         ILandingPageSchool schoolService = new LandingPageSchool();
         return(Json(new Response
         {
             Message = "All school data",
             Data = schoolService.GetAll(),
             Status = true
         }));
     }
     catch (Exception e)
     {
         throw e;
     }
 }
Esempio n. 2
0
 public IHttpActionResult GetSchoolById(int id)
 {
     try
     {
         ILandingPageSchool schoolService = new LandingPageSchool();
         return(Json(new Response
         {
             Message = "School data by id",
             Data = schoolService.GetSchoolById(id),
             Status = true
         }));
     }
     catch (Exception e)
     {
         throw e;
     }
 }
Esempio n. 3
0
 public IHttpActionResult PostSchool([FromBody] School school)
 {
     try
     {
         ILandingPageSchool schoolService = new LandingPageSchool();
         schoolService.CreateEntry(school);
         return(Json(new Response
         {
             Message = "School created",
             Data = null,
             Status = true
         }));
     }
     catch (Exception e) {
         throw e;
     }
 }