public IHttpActionResult ByUser([FromBody] PaymentUserSearch valPayment) { string vResult = "4"; IPaymentData vPaymentData = new PaymentData(); try { bool vNullField = VerifyNullFiledsUserSearch(valPayment); if (vNullField) { vResult = "2"; return(ResponseMessage(Request.CreateResponse(HttpStatusCode.NotAcceptable, new { Code = HttpStatusCode.NotAcceptable, Message = Messages.vListContainNullValue, Result = vResult }))); } string vResponse = vPaymentData.SelectByUser(valPayment); if (!string.IsNullOrEmpty(vResponse)) { return(ResponseMessage(Request.CreateResponse(HttpStatusCode.OK, new { Code = HttpStatusCode.OK, Message = Messages.vOkListed, Result = vResponse }))); } } catch (Exception vEx) { string vMessage = vEx.Message; return(ResponseMessage(Request.CreateResponse(HttpStatusCode.InternalServerError, new { Code = HttpStatusCode.InternalServerError, Message = Messages.vInternalServerError, Result = vResult }))); } return(ResponseMessage(Request.CreateResponse(HttpStatusCode.OK, new { Code = HttpStatusCode.OK, Message = Messages.vNotInserted, Result = vResult }))); }