public ActionResult AtualizarAgendamento(CalendarEvent evento) { Agenda agendaAtualizar = agendaRepositorio.SelecionarPorId(evento.id); agendaAtualizar.Paciente.Nome = evento.title; agendaRepositorio.Atualizar(agendaAtualizar); return View("Index", agendaRepositorio.SelecionarTodos()); }
public JsonResult ObterEventos(double start, double end) { IList<CalendarEvent> eventos = new List<CalendarEvent>(); CalendarEvent evento ; foreach (Agenda agenda in agendaRepositorio.SelecionarTodos()) { evento = new CalendarEvent(); evento.id = agenda.Id; evento.title = agenda.Paciente.Nome; evento.description = agenda.Paciente.Nome + " - " + agenda.Especialidade.Nome; evento.start = ToUnixTimespan(agenda.DataInicio).ToString(); evento.end = ToUnixTimespan(agenda.DataFim).ToString() ; evento.allDay = false; evento.resourceId = agenda.Medico.Id; //evento.url = ""; eventos.Add(evento); } return Json(eventos.ToArray(),JsonRequestBehavior.AllowGet); }
public ActionResult InserirAgendamento(CalendarEvent evento) { agendaRepositorio.Inserir(agendaRepositorio.SelecionarPorId(evento.id)); return View("Index", agendaRepositorio.SelecionarTodos()); }