public IEnumerable <OrcamentoIntumescenteModel> Get() { try { var listOrcamentoIntumescente = OrcamentoIntumescenteRepository.List(); foreach (OrcamentoIntumescenteModel orcamentoIntumescente in listOrcamentoIntumescente) { var pessoaId = MetodosGenericosService.DlookupOrcamentaria("PESSOA_ID", "T_ORCA_ORCAMENTO", $"ORCAMENTO_ID = {orcamentoIntumescente.ORCAMENTO_ID}"); orcamentoIntumescente.CLIENTE_ORCAMENTO = PessoaService.GetComParametro(new PessoaQO(int.Parse(pessoaId), "")).FirstOrDefault(); var materialId = MetodosGenericosService.DlookupOrcamentaria("MATERIAL_ID", "T_ORCA_ORCAMENTO_INTUMESCENTE", $"ORCAMENTO_ID = {orcamentoIntumescente.ORCAMENTO_ID}"); if (materialId != "") { orcamentoIntumescente.PRODUTO = MaterialService.GetComParametro(new MaterialQO(int.Parse(materialId), "", "")).FirstOrDefault(); } orcamentoIntumescente.LIST_ITENS_ORCAMENTO_INTUMESCENTE = ItensOrcamentoIntumescenteService.GetComParametro(new ItensOrcamentoQO(0, orcamentoIntumescente.ORCAMENTO_ID)).ToList(); orcamentoIntumescente.LIST_MAO_OBRA_ORCAMENTO = MaoObraOrcamentoService.Get(orcamentoIntumescente.ORCAMENTO_ID).ToList(); orcamentoIntumescente.LIST_CUSTO_ORCAMENTO = CustoOrcamentoService.GetComParametro(new CustoOrcamentoQO(0, orcamentoIntumescente.ORCAMENTO_ID)).ToList(); orcamentoIntumescente.LIST_EQUIPAMENTO_ORCAMENTO = EquipamentoOrcamentoService.GetComParametro(new EquipamentoOrcamentoQO(0, orcamentoIntumescente.ORCAMENTO_ID)).ToList(); orcamentoIntumescente.LIST_MATERIAL_ORCAMENTO = MaterialOrcamentoService.GetComParametro(new MaterialOrcamentoQO(0, orcamentoIntumescente.ORCAMENTO_ID)).ToList(); orcamentoIntumescente.TOTAIS_ORCAMENTO = TotaisOrcamentoRepository.FindPorOrcamentoId(orcamentoIntumescente.ORCAMENTO_ID); } return(listOrcamentoIntumescente); } catch (Exception) { throw; } }
public IEnumerable <ItensOrcamentoIntumescenteModel> Get([FromQuery] ItensOrcamentoQO itensOrcamentoIntumescente) { try { return(ItensOrcamentoIntumescenteService.GetComParametro(itensOrcamentoIntumescente)); } catch (Exception) { throw; } }