public async Task <ActionResult> Delete(string id, FormCollection collection) { _O365ServiceOperationFailed = false; try { await _calenderOperations.DeleteCalendarEventAsync(id); } catch (Exception) { _O365ServiceOperationFailed = true; } return(RedirectToAction("Index")); }
/// <summary> /// Sends event remove request to Exchange service /// </summary> async void ExecuteDeleteCommandAsync() { if (await MessageDialogHelper.ShowYesNoDialogAsync(String.Format("Are you sure you want to delete the event '{0}'?", this._selectedEvent.DisplayString), "Confirm Deletion")) { if (!String.IsNullOrEmpty(this._selectedEvent.Id)) { var success = await _calendarOperations.DeleteCalendarEventAsync(this._selectedEvent.Id); if (success) { //Removes event from bound observable collection Events.Remove((EventViewModel)_selectedEvent); } } } }
/// <summary> /// Sends event remove request to Exchange service /// </summary> async void ExecuteDeleteCommandAsync() { try { if (await MessageDialogHelper.ShowYesNoDialogAsync(String.Format("Are you sure you want to delete the event '{0}'?", this._selectedEvent.DisplayString), "Confirm Deletion")) { if (!String.IsNullOrEmpty(this._selectedEvent.Id)) { await _calendarOperations.DeleteCalendarEventAsync(this._selectedEvent.Id); } //Removes event from bound observable collection TodaysEvents.Remove((EventViewModel)_selectedEvent); } } catch (Exception) { LoggingViewModel.Instance.Information = "We could not delete your calendar event"; } }
public async Task <ActionResult> Delete(string id, FormCollection collection) { IEvent deletedEvent = await _calenderOperations.DeleteCalendarEventAsync(id); return(RedirectToAction("Index")); }