public bool registrarAgendamento(Agendamento agendamento) { if (agendamento == null) { throw new ArgumentNullException("agendamento"); } var pacientes = agendamento.Paciente; if (pacientes == null) { throw new ArgumentNullException("agendamento.Paciente"); } if (agendamento.DiaDoAgendamento.Date.CompareTo(DateTime.Now.Date) < 0) { return(false); } agendamento.Paciente = repPaciente.obterPaciente(agendamento.Paciente.Protocolo); agendamento.PacienteId = agendamento.Paciente.Id; repAgendamento.incluirAgendamento(agendamento); return(true); }
public List <Paciente> getPacientes(Paciente paciente) { List <Paciente> listPaciente = new List <Paciente>(); if (!string.IsNullOrEmpty(paciente.Nome)) { listPaciente = repPaciente.obterPacientes(paciente.Nome); } else if (!string.IsNullOrEmpty(paciente.Protocolo)) { listPaciente.Add(repPaciente.obterPaciente(paciente.Protocolo)); } return(listPaciente); }