예제 #1
0
        public Task <HttpResponseMessage> EditarCondicaoPagamento(CondicaoPagamentoModel model)
        {
            HttpResponseMessage response;

            try
            {
                var condicaoPagamento        = Mapper.Map <CondicaoPagamento>(model);
                var condicaoPagamentoRetorno = _condicaoPagamentoService.AtualizarCondicaoPagamento(condicaoPagamento);
                response = ReturnSuccess(Mapper.Map <CondicaoPagamentoModel>(condicaoPagamentoRetorno));
            }
            catch (Exception ex)
            {
                response = ReturnError(ex);
            }

            var tsc = new TaskCompletionSource <HttpResponseMessage>();

            tsc.SetResult(response);
            return(tsc.Task);
        }
예제 #2
0
 public JsonResult NovaCondicaoPagamento(CondicaoPagamentoModel model)
 {
     var response = ServiceRequest.Post<CondicaoPagamentoModel>(model, "api/CondicaoPagamento/CriarCondicaoPagamento");
     return ReturnResponse(response);
 }
예제 #3
0
 public JsonResult EditarCondicaoPagamento(CondicaoPagamentoModel model)
 {
     var response = ServiceRequest.Put<object>(model, "api/CondicaoPagamento/EditarCondicaoPagamento");
     return ReturnResponse(response);
 }
예제 #4
0
        // GET: CondicaoPagamento
        public ActionResult Index()
        {
            CondicaoPagamentoModel condicaoPagamento = new CondicaoPagamentoModel();

            return(View(condicaoPagamento.ListarCondicaoPagamento()));
        }