Ejemplo n.º 1
0
 public Models.TbPerguntaResposta PerguntarParaTabela(Models.Request.AnuncioRoupasRequest.Pergunta req)
 {
     Models.TbPerguntaResposta resp = new Models.TbPerguntaResposta();
     resp.BtRespondida  = false;
     resp.DsPergunta    = req.Texto.Trim();
     resp.DtPergunta    = DateTime.Now;
     resp.IdAnuncio     = req.IdAnuncio;
     resp.IdPerguntador = req.IdUsuarioPerguntador;
     resp.IdRespondedor = req.IdUsuarioRespondedor;
     return(resp);
 }
Ejemplo n.º 2
0
 public ActionResult <Models.Response.AnuncioRoupasResponse.PerguntaEResposta> Perguntar(Models.Request.AnuncioRoupasRequest.Pergunta req)
 {
     try
     {
         Models.TbPerguntaResposta a = conversorAnuncio.PerguntarParaTabela(req);
         Models.TbPerguntaResposta b = businessAnuncio.Perguntar(a);
         return(conversorAnuncio.PerguntarParaResponse(b));
     }
     catch (System.Exception ex)
     {
         return(BadRequest(new Models.Response.Erro(400, ex.Message)));
     }
 }