Example #1
0
        public bool CadastrarAgendamento(Agendamento agendamento)
        {
            EventosDoDominio.Disparar(new AgendamentoCriado(agendamento));

            //persistir na base o agendamento
            _agendamentos.Gravar(agendamento);

            return(true);
        }
        public bool CriarAgendamento(AgendamentoViewModel agendamentoViewModel)
        {
            FabricaDeAgendamento fabricaDeAgendamento = new FabricaDeAgendamento();
            Agendamento          agendamento          = fabricaDeAgendamento.InformarCID(agendamentoViewModel.numeroCID)
                                                        .InformarMedico(agendamentoViewModel.crm)
                                                        .InformarPaciente(agendamentoViewModel.cpf)
                                                        .Criar();

            _agendamentos.Gravar(agendamento);

            EventosDoDominio.Disparar(new AgendamentoCriado(agendamentoViewModel));

            return(true);
        }