Ejemplo n.º 1
0
 public IHttpActionResult Post(Credit credit)
 {
     try
     {
         var mng = new CreditManager();
         mng.Create(credit);
         return(Content(HttpStatusCode.OK, "CREDITO REGISTRADO"));
     }
     catch (Exception e)
     {
         Console.WriteLine(e.Message);
         return(Content(HttpStatusCode.BadRequest, "ERROR AL REGISTRAR"));
     }
 }
Ejemplo n.º 2
0
        // POST
        // CREATE
        public IHttpActionResult Post(Credit credit)
        {
            try
            {
                var mng = new CreditManager();
                mng.Create(credit);

                apiResp         = new ApiResponse();
                apiResp.Message = "Action was executed.";

                return(Ok(apiResp));
            }
            catch (BussinessException bex)
            {
                return(InternalServerError(new Exception(bex.ExceptionId + "-"
                                                         + bex.AppMessage.Message)));
            }
        }