Exemple #1
0
 /// <summary>
 /// post method to insert a new complex
 /// </summary>
 /// <param name="newHousingComDto"></param>
 /// <returns></returns>
 public async Task <HttpResponseMessage> Post([FromBody] HousingComplexDto newHousingComDto)
 {
     try
     {
         newHousingComDto.ActiveBit = true;
         if (await logicHelper.AddHousingComplex(newHousingComDto))
         {
             var Response1 = Request.CreateResponse(HttpStatusCode.OK, "successfully inserted");
             log.Info("HousingComplex Post Successful");
             return(Response1);
         }
         var Response2 = Request.CreateResponse(HttpStatusCode.BadRequest, "failed to insert");
         log.Info("HousingComplex Post Unsuccessful");
         return(Response2);
     }
     catch (Exception ex)
     {
         LogHelper.SendError(log, ex);
         return(Request.CreateResponse(HttpStatusCode.BadRequest));
     }
 }