Пример #1
0
 public void Delete(int orcamentoId)
 {
     try
     {
         MaoObraOrcamentoService.Delete(orcamentoId);
         TotaisOrcamentoService.CalcularTotaisOrcamento(orcamentoId);
     }
     catch (Exception)
     {
         throw;
     }
 }
Пример #2
0
        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;
            }
        }