public void DeleteComParametro(TotaisOrcamentoQO totaisOrcamento) { try { if (totaisOrcamento.OrcamentoId != 0) { var where = $"ORCAMENTO_ID = {totaisOrcamento.OrcamentoId}"; if (string.IsNullOrEmpty(MetodosGenericosService.DlookupOrcamentaria("ORCAMENTO_ID", "T_ORCA_ORCAMENTO", where))) { throw new Exception(); } TotaisOrcamentoRepository.DeletePorOrcamentoId(totaisOrcamento.OrcamentoId); } else { var where = $"TOTAIS_ORCAMENTO_ID = {totaisOrcamento.TotaisOrcamentoId}"; if (string.IsNullOrEmpty(MetodosGenericosService.DlookupOrcamentaria("totaisOrcamentoId", "T_ORCA_TOTAIS_ORCAMENTO", where))) { throw new Exception(); } TotaisOrcamentoRepository.DeletePorOrcamentoId(totaisOrcamento.TotaisOrcamentoId); } } catch (Exception) { throw; } }
public TotaisOrcamentoModel GetComParametro(TotaisOrcamentoQO totaisOrcamento) { try { List <TotaisOrcamentoModel> listTotaisOrcamento = new List <TotaisOrcamentoModel>(); if (totaisOrcamento.OrcamentoId != 0) { listTotaisOrcamento.Add(TotaisOrcamentoRepository.FindPorOrcamentoId(totaisOrcamento.OrcamentoId)); } else { listTotaisOrcamento.Add(TotaisOrcamentoRepository.Find(totaisOrcamento.TotaisOrcamentoId)); } return(listTotaisOrcamento[0]); } catch (Exception) { throw; } }