Example #1
0
        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;
                    }
                }
            }
        }
Example #2
0
 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;
     }
 }
Example #3
0
        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;
            }
        }
Example #4
0
        private void OnDeleteExecuted(object obj)
        {
            GridViewDeletingEventArgs e = obj as GridViewDeletingEventArgs;

            e.Cancel = true;

            this.itemsToDelete = e.Items;

            RadWindow.Confirm("Are you sure?", this.OnDeleteConfirmation);
        }
Example #5
0
        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);
        }
Example #6
0
        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);
                    }
                }
            }
        }
Example #7
0
        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;
             }
         }
     }
 }
Example #9
0
 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;
             }
         }
     }
 }
Example #10
0
 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;
             }
         }
     }
 }
Example #11
0
 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 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 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 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;
             }
         }
     }
 }
Example #15
0
 private void gridView_Deleting(object sender, GridViewDeletingEventArgs e)
 {
     if (e.Items != null)
     {
     }
 }
Example #16
0
 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;
     }
 }