コード例 #1
0
 public void Delete(int maoObraOrcamentoId)
 {
     try
     {
         TotaisOrcamentoService.CalcularTotaisOrcamento(CustosMaoObraService.Delete(maoObraOrcamentoId));
     }
     catch (Exception)
     {
         throw;
     }
 }
コード例 #2
0
        public void Delete(int maoObraOrcamentoId, int orcamentoId)
        {
            try
            {
                var where = $"MAO_OBRA_ORCAMENTO_ID = {maoObraOrcamentoId} AND ORCAMENTO_ID = {orcamentoId}";
                if (string.IsNullOrEmpty(MetodosGenericosService.DlookupOrcamentaria("MAO_OBRA_ORCAMENTO_ID", "T_ORCA_OBRA", where)))
                {
                    throw new Exception();
                }

                MetodosGenericosService.StartTransactionCommitRollbackOrcamentaria(MetodosGenericosEnum.START);

                CustosMaoObraService.Delete(maoObraOrcamentoId);

                MaoObraOrcamentoRepository.Delete(maoObraOrcamentoId, orcamentoId);

                MetodosGenericosService.StartTransactionCommitRollbackOrcamentaria(MetodosGenericosEnum.COMMIT);
            }
            catch (Exception)
            {
                MetodosGenericosService.StartTransactionCommitRollbackOrcamentaria(MetodosGenericosEnum.ROLLBACK);
                throw;
            }
        }