private void DeleteEvent(object obj) { int selectedIndex = (int)obj; var usersConfirmation = MessageBox.Show(string.Format("Are you sure you would like to delete all {0} details?", SelectedEvent.Name), "Warning!", MessageBoxButton.OKCancel, MessageBoxImage.Warning); if (usersConfirmation == MessageBoxResult.OK) { _eventDataService.DeleteEvent(SelectedEvent.Name); EventsNames.RemoveAt(selectedIndex); LoadEventNames(); } }
private void button5_Click(object sender, EventArgs e) { EventDataService eventDataService = new EventDataService(); int result = eventDataService.DeleteEvent(Convert.ToInt32(Del_EventID.Text), usingUserId); if (result > 0) { MessageBox.Show("Event Deleted Succesfully!"); eventListView.DataSource = eventDataService.GetEventList(this.usingUserId); } else { MessageBox.Show("Sorry There Was An Error!"); eventListView.DataSource = eventDataService.GetEventList(this.usingUserId); } }
protected async Task DeleteEvent() { var response = await EventDataService.DeleteEvent(SelectedEventId); HandleResponse(response); }