Beispiel #1
0
        public void AddRole(object button)
        {
            var info = GridPopupMenuBase.GetGridMenuInfo((DependencyObject)button) as GridMenuInfo;

            string roleName = string.Empty;
            var    bulkEditStringsViewModel = BulkEditStringsViewModel.Create(roleName);

            if (AddRoleDialogService.ShowDialog(MessageButton.OKCancel, "Add new role", "BulkEditStrings", bulkEditStringsViewModel) == MessageResult.OK)
            {
                if (bulkEditStringsViewModel.EditValue != null)
                {
                    roleName = (string)bulkEditStringsViewModel.EditValue;
                }

                ROLE newROLE = new ROLE()
                {
                    NAME = roleName, SORTORDER = 0, PARENTGUID = Guid.Empty
                };
                string errorMessage = string.Empty;
                if (ROLECollection.IsValidEntity(newROLE, ref errorMessage))
                {
                    ROLECollection.Save(newROLE);
                }
                else
                {
                    MessageBoxService.ShowMessage(errorMessage + " already exists", "Error", MessageButton.OK, MessageIcon.Error);
                }
            }
        }
Beispiel #2
0
 public void dragDropManager_Dropped(object sender, DevExpress.Xpf.Grid.DragDrop.TreeListDroppedEventArgs e)
 {
     if (e.TargetNode != null)
     {
         foreach (TreeListNode obj in e.DraggedRows)
         {
             ROLECollection.Save((ROLE)obj.Content);
         }
     }
 }