Пример #1
0
 public Models.TbAnuncio AlterarAnuncioParaTabela(Models.Request.AnuncioRoupasRequest.AlterarAnuncio anuncio)
 {
     Models.TbAnuncio resp = new Models.TbAnuncio();
     resp.NmMarca     = anuncio.Marca.Trim();
     resp.TpProduto   = anuncio.TipoDoProduto.Trim();
     resp.VlPreco     = anuncio.Preco;
     resp.DsCep       = anuncio.CEP.Trim();
     resp.DsCidade    = anuncio.Cidade.Trim();
     resp.DsCondicao  = anuncio.Condicao.Trim();
     resp.DsDescricao = anuncio.Descricao.Trim();
     resp.DsEstado    = anuncio.Estado.Trim();
     resp.DsGenero    = anuncio.Genero.Trim();
     resp.DsTamanho   = anuncio.Tamanho.Trim();
     resp.DsTitulo    = anuncio.Titulo.Trim();
     resp.IdUsuario   = anuncio.IdUsuario;
     resp.IdAnuncio   = anuncio.IdAnuncio;
     return(resp);
 }
Пример #2
0
 public ActionResult <Models.Response.AnuncioRoupasResponse.Anuncio> AlterarAnuncio(Models.Request.AnuncioRoupasRequest.AlterarAnuncio a)
 {
     try
     {
         Models.TbAnuncio NovoAnuncio = conversorAnuncio.AlterarAnuncioParaTabela(a);
         Models.TbAnuncio resp        = businessAnuncio.AlterarAnuncio(NovoAnuncio);
         return(conversorAnuncio.ConversorAnuncioResponse(resp));
     }
     catch (System.Exception ex)
     {
         return(BadRequest(new Models.Response.Erro(400, ex.Message)));
     }
 }