private void gridDepartment_Deleting(object sender, GridViewDeletingEventArgs e) { if (MessageBox.Show("Are you sure you want to delete?", "Confirm", MessageBoxButton.YesNo) == MessageBoxResult.No) { e.Cancel = true; return; } else { SunSeven.DataSource.JSDataContext lDataContext = new CommonFunction().JSDataContext(); foreach (HSDepartment l in e.Items) { SunSeven.DataSource.Department items = (lDataContext.Departments.SingleOrDefault(p => p.Id == l.Id)); lDataContext.Departments.DeleteOnSubmit(items); try { lDataContext.SubmitChanges(); } catch (Exception ex) { MessageBox.Show(ex.Message); e.Cancel = true; } } } }
private void gridCategory_Deleting(object sender, GridViewDeletingEventArgs e) { if (MessageBox.Show("Are you sure you want to delete?", "Confirm", MessageBoxButton.YesNo) == MessageBoxResult.No) { e.Cancel = true; return; } }
void gvwRoomService_Deleting(object sender, GridViewDeletingEventArgs e) { MessageBoxResult result = MessageBox.Show(ResourceHelper.GetReourceValue("Common_ConfirmDeleteNoParam"), ResourceHelper.GetReourceValue("Common_ConfirmationRequired"), MessageBoxButton.OKCancel); if (result == MessageBoxResult.Cancel) { e.Cancel = true; } }
private void OnDeleteExecuted(object obj) { GridViewDeletingEventArgs e = obj as GridViewDeletingEventArgs; e.Cancel = true; this.itemsToDelete = e.Items; RadWindow.Confirm("Are you sure?", this.OnDeleteConfirmation); }
private void RadGridView1_Deleting(object sender, GridViewDeletingEventArgs e) { //store the items to be deleted //_viewModel.ItemsToBeDeleted.AddRange(e.Items); ////cancel the event so the item is not deleted ////and wait for the user confirmation //e.Cancel = true; ////open the Confirm dialog //RadWindow.Confirm("Are you sure?", this.OnRadWindowClosed); }
private void gridView_Deleting(object sender, GridViewDeletingEventArgs e) { if (e.Items != null) { List <Pais> paises = e.Items.Cast <Pais>().ToList(); if (paises != null) { if (paises.Count > 0) { this.customViewModel.RemoveEntities <Pais>(paises); } } } }
void gvwSites_Deleting(object sender, GridViewDeletingEventArgs e) { MessageBoxResult result = MessageBox.Show(ResourceHelper.GetReourceValue("Common_ConfirmDeleteNoParam"), ResourceHelper.GetReourceValue("Common_ConfirmationRequired"), MessageBoxButton.OKCancel); if (result == MessageBoxResult.Cancel) { e.Cancel = true; } else { SiteGroup sg = gvwSiteGroup.SelectedItem as SiteGroup; if (sg != null) { sg.IsChanged = true; } } }
void gvwRole_Deleting(object sender, GridViewDeletingEventArgs e) { if (e.Items != null && e.Items.Count() > 0) { AspRole role = e.Items.First() as AspRole; if (role != null) { if (role.CanDelete && !SecurityHelper.IsBuildInRole(role.RoleId)) { MessageBoxResult result = MessageBox.Show(ResourceHelper.GetReourceValue("Common_ConfirmDeleteNoParam"), ResourceHelper.GetReourceValue("Common_ConfirmationRequired"), MessageBoxButton.OKCancel); if (result == MessageBoxResult.Cancel) { e.Cancel = true; } } else { MessageBoxResult result = MessageBox.Show(string.Format(ResourceHelper.GetReourceValue("Common_DeleteFailed"), role.RoleName), ResourceHelper.GetReourceValue("Common_OperationFailed"), MessageBoxButton.OK); e.Cancel = true; } } } }
void gvwBookingService_Deleting(object sender, GridViewDeletingEventArgs e) { if (e.Items != null && e.Items.Count() > 0) { BookingRoomService deleteItem = e.Items.First() as BookingRoomService; if (deleteItem != null) { if (deleteItem.CanDelete) { MessageBoxResult result = MessageBox.Show(ResourceHelper.GetReourceValue("Common_ConfirmDeleteNoParam"), ResourceHelper.GetReourceValue("Common_ConfirmationRequired"), MessageBoxButton.OKCancel); if (result == MessageBoxResult.Cancel) { e.Cancel = true; } } else { MessageBoxResult result = MessageBox.Show(string.Format(ResourceHelper.GetReourceValue("Common_DeleteFailedBeingUsed"), deleteItem.Service), ResourceHelper.GetReourceValue("Common_OperationFailed"), MessageBoxButton.OK); e.Cancel = true; } } } }
void gvwSiteGroup_Deleting(object sender, GridViewDeletingEventArgs e) { if (e.Items != null && e.Items.Count() > 0) { SiteGroup siteGroup = e.Items.First() as SiteGroup; if (siteGroup != null) { if (siteGroup.CanDelete) { MessageBoxResult result = MessageBox.Show(ResourceHelper.GetReourceValue("Common_ConfirmDeleteNoParam"), ResourceHelper.GetReourceValue("Common_ConfirmationRequired"), MessageBoxButton.OKCancel); if (result == MessageBoxResult.Cancel) { e.Cancel = true; } } else { MessageBoxResult result = MessageBox.Show(string.Format(ResourceHelper.GetReourceValue("Common_DeleteFailed"), siteGroup.GroupName), ResourceHelper.GetReourceValue("Common_OperationFailed"), MessageBoxButton.OK); e.Cancel = true; } } } }
private void gridView_Deleting(object sender, GridViewDeletingEventArgs e) { if (e.Items != null) { } }
void gvwRoom_Deleting(object sender, GridViewDeletingEventArgs e) { MessageBoxResult result = MessageBox.Show(ResourceHelper.GetReourceValue("Common_ConfirmDeleteNoParam"), ResourceHelper.GetReourceValue("Common_ConfirmationRequired"), MessageBoxButton.OKCancel); if (result == MessageBoxResult.Cancel) { e.Cancel = true; } }