Exemplo n.º 1
0
 /// <summary>
 /// Delete Camp
 /// </summary>
 /// <param name="id"></param>
 /// <returns></returns>
 public HttpResponseMessage DeleteCamp(int id)
 {
     try
     {
         if (id <= 0)
         {
             return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, "Not a valid camp id"));
         }
         else if (Icamp.DeleteCamp(id) == false)
         {
             return(Request.CreateErrorResponse(HttpStatusCode.NotFound, "No camp found with id " + id.ToString()));
         }
         else
         {
             Icamp.DeleteCamp(id);
             return(Request.CreateResponse(HttpStatusCode.OK, "1 row affected"));
         }
     }
     catch (Exception ex)
     {
         return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, ex));
     }
 }
Exemplo n.º 2
0
 public void Delete(int id)
 {
     objCamp.DeleteCamp(id);
 }