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 <OrcamentoGeralModel> Get() { try { var listOrcamento = OrcamentoRepository.List(); foreach (OrcamentoGeralModel orcamento in listOrcamento) { var pessoaId = MetodosGenericosService.DlookupOrcamentaria("PESSOA_ID", "T_ORCA_ORCAMENTO", $"ORCAMENTO_ID = {orcamento.ORCAMENTO_ID}"); orcamento.CLIENTE_ORCAMENTO = PessoaService.GetComParametro(new PessoaQO(int.Parse(pessoaId), "")).ToArray()[0]; orcamento.LIST_ITENS_ORCAMENTO_GERAL = ItensOrcamentoGeralService.GetComParametro(new ItensOrcamentoQO(0, orcamento.ORCAMENTO_ID)).ToList(); orcamento.LIST_MAO_OBRA_ORCAMENTO = MaoObraOrcamentoService.Get(orcamento.ORCAMENTO_ID).ToList(); orcamento.LIST_CUSTO_ORCAMENTO = CustoOrcamentoService.GetComParametro(new CustoOrcamentoQO(0, orcamento.ORCAMENTO_ID)).ToList(); orcamento.LIST_EQUIPAMENTO_ORCAMENTO = EquipamentoOrcamentoService.GetComParametro(new EquipamentoOrcamentoQO(0, orcamento.ORCAMENTO_ID)).ToList(); orcamento.LIST_MATERIAL_ORCAMENTO = MaterialOrcamentoService.GetComParametro(new MaterialOrcamentoQO(0, orcamento.ORCAMENTO_ID)).ToList(); orcamento.TOTAIS_ORCAMENTO = TotaisOrcamentoRepository.FindPorOrcamentoId(orcamento.ORCAMENTO_ID); } return(listOrcamento); } catch (Exception) { throw; } }
public IEnumerable <CustoOrcamentoModel> Get([FromQuery] CustoOrcamentoQO custoOrcamento) { try { return(CustoOrcamentoService.GetComParametro(custoOrcamento)); } catch (Exception) { throw; } }