public Models.TbOrdemServico ParaTabela(Models.Request.TbOrdemServicoRequest request)
 {
     Models.TbOrdemServico func = new Models.TbOrdemServico();
     func.DsValor           = request.Valor;
     func.DtOrdemServico    = request.DtOrdemServico;
     func.IdCliente         = request.IdCliente;
     func.IdFuncionario     = request.IdFuncionario;
     func.DsStatus          = request.Status;
     func.DsValorManutencao = request.ValorManutencao;
     return(func);
 }
Пример #2
0
        public ActionResult <Models.Response.TbOrdemServicoResponse> Alterar(int id, Models.Request.TbOrdemServicoRequest request)
        {
            try {
                Models.TbOrdemServico ln = util.ParaTabela(request);
                buss.Alterar(id, ln);

                Models.Response.TbOrdemServicoResponse resp = util.ParaResponse(ln);
                return(resp);
            } catch (System.Exception ex) {
                return(BadRequest(
                           new Models.Response.ErroResponse(404, ex.Message)
                           ));
            }
        }
Пример #3
0
        public ActionResult <Models.Response.TbOrdemServicoResponse> Inserir(Models.Request.TbOrdemServicoRequest request)
        {
            try {
                Models.TbOrdemServico func = util.ParaTabela(request);
                buss.Salvar(func);

                Models.Response.TbOrdemServicoResponse resp = util.ParaResponse(func);
                return(resp);
            } catch (System.Exception ex) {
                return(BadRequest(
                           new Models.Response.ErroResponse(404, ex.Message)
                           ));
            }
        }