private bool PodeCriarMaisUmaVersaoDeOrcamento(Departamento setor, int centroDeCustoId, List<Orcamento.Domain.Orcamento> orcamentosGerenciamento)
        {
            var gerenciamento = new GerenciadorDeOrcamentos();

            return gerenciamento.PodeCriarOrcamento(orcamentosGerenciamento, setor,
                                                    setor.ObterCentroDeCustoPor(
                                                        centroDeCustoId),
                                                    TipoOrcamentoEnum.
                                                        DespesaOperacional);
        }
 private bool PodeCriarOrcamento(Departamento setor, int centroDeCustoId, List<Domain.Orcamento> orcamentosDoCentroDeCustoEDepartamentoLogado)
 {
     return new GerenciadorDeOrcamentos().PodeCriarOrcamento(orcamentosDoCentroDeCustoEDepartamentoLogado, setor, setor.ObterCentroDeCustoPor(centroDeCustoId), TipoOrcamentoEnum.Viagem);
 }
        public void CriarNovoOrcamentoOperacional(Departamento setor, int centroDeCustoId)
        {
            var orcamentosDoCentroDeCustoEDepartamentoLogado = ObterOrcamentosDoCentroDeCustoEDepartamentoLogado(setor, centroDeCustoId);

            bool podeCriarOrcamento = PodeCriarOrcamento(setor, centroDeCustoId, orcamentosDoCentroDeCustoEDepartamentoLogado);

            if (podeCriarOrcamento)
            {
                this.View.OrcamentoViagem = this.ServicoOrcamentoDeViagens.CriarOrcamentoDeViagem(orcamentosDoCentroDeCustoEDepartamentoLogado, setor, setor.ObterCentroDeCustoPor(centroDeCustoId), 2014);

                CarregarOrcamentoDesnormalizado();
            }

            CarregarInformacoesDosOrcamentos();
        }
        private List<Domain.Orcamento> ObterOrcamentosDoCentroDeCustoEDepartamentoLogado(Departamento setor, int centroDeCustoId)
        {
            var centroDeCusto = setor.ObterCentroDeCustoPor(centroDeCustoId);

            return Orcamentos.TodosOrcamentosDeViagemPor(centroDeCusto, setor);
        }
        public void CriarNovoOrcamentoOperacional(Departamento setor, int centroDeCustoId)
        {
            try
            {
                var orcamentosGerenciamento = Orcamentos.TodosOrcamentosOperacionaisPor(setor.ObterCentroDeCustoPor(centroDeCustoId), setor);

                bool podeCriarMaisUmaVersaoDeOrcamento = PodeCriarMaisUmaVersaoDeOrcamento(setor, centroDeCustoId, orcamentosGerenciamento);

                if (podeCriarMaisUmaVersaoDeOrcamento)
                {
                    this.View.OrcamentoOperacional = this.ServicoOrcamento.CriarOrcamentoOperacional(orcamentosGerenciamento, setor, setor.ObterCentroDeCustoPor(centroDeCustoId), 2014);

                    this.View.InformarVersao();

                    InformarDespesas();
                }

                CarregarGrids();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }