public async Task <ActionResult> Details(string id) { MyEvent myEvent = null; MyEventsRepository repo = new MyEventsRepository(); myEvent = await repo.GetEvent(id); return(View(myEvent)); }
public async Task <ActionResult> Index() { List <MyEvent> events = null; MyEventsRepository repo = new MyEventsRepository(); events = await repo.GetEvents(); return(View(events)); }
public async Task <ActionResult> Delete(string id) { MyEventsRepository repo = new MyEventsRepository(); if (id != null) { await repo.DeleteEvent(id); } return(Redirect("/Events")); }
public async Task <ActionResult> Details(string id) { ExchangeClientDemo.Models.MyEvent myEvent = null; try { MyEventsRepository repo = new MyEventsRepository(); myEvent = await repo.GetEvent(id); } catch (RedirectRequiredException x) { return(Redirect(x.RedirectUri.ToString())); } return(View(myEvent)); }
public async Task <ActionResult> Index() { List <ExchangeClientDemo.Models.MyEvent> events = null; try { MyEventsRepository repo = new MyEventsRepository(); events = await repo.GetEvents(); } catch (RedirectRequiredException x) { return(Redirect(x.RedirectUri.ToString())); } return(View(events)); }
public async Task <ActionResult> Create(MyEvent myEvent) { if (Request.HttpMethod == "POST") { MyEventsRepository repo = new MyEventsRepository(); await repo.AddEvent(myEvent); return(Redirect("/Events")); } else { myEvent.Start = DateTimeOffset.Now; myEvent.End = DateTimeOffset.Now.AddDays(1); return(View(myEvent)); } }
private async void cmdGetCalendarEvent_Click(object sender, RoutedEventArgs e) { listEvents.ItemsSource = await MyEventsRepository.GetEvents(); }