public void Delete(int orcamentoId) { try { MetodosGenericosService.StartTransactionCommitRollbackOrcamentaria(MetodosGenericosEnum.START); var where = $"ORCAMENTO_ID = {orcamentoId}"; if (string.IsNullOrEmpty(MetodosGenericosService.DlookupOrcamentaria("ORCAMENTO_ID", "T_ORCA_ORCAMENTO", where))) { throw new Exception(); } TotaisOrcamentoRepository.DeletePorOrcamentoId(orcamentoId); MaoObraOrcamentoService.Delete(orcamentoId); CustoOrcamentoService.DeleteComParametro(new CustoOrcamentoQO(0, orcamentoId)); EquipamentoOrcamentoService.DeleteComParamenro(new EquipamentoOrcamentoQO(0, orcamentoId)); MaterialOrcamentoService.DeleteComParamenro(new MaterialOrcamentoQO(0, orcamentoId)); ItensOrcamentoGeralService.DeleteComParametro(new ItensOrcamentoQO(0, orcamentoId)); OrcamentoRepository.Delete(orcamentoId); MetodosGenericosService.StartTransactionCommitRollbackOrcamentaria(MetodosGenericosEnum.COMMIT); } catch (Exception) { MetodosGenericosService.StartTransactionCommitRollbackOrcamentaria(MetodosGenericosEnum.ROLLBACK); throw; } }
public void Delete([FromQuery] CustoOrcamentoQO custoOrcamento) { try { TotaisOrcamentoService.CalcularTotaisOrcamento(CustoOrcamentoService.DeleteComParametro(custoOrcamento)); } catch (Exception) { throw; } }