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);
         }
     }
 }
Beispiel #3
0
        protected ROLECollectionViewModelWrapper()
        {
            ROLECollection = ROLECollectionViewModel.Create();
            ROLECollection.SetParentViewModel(this);
            ROLECollection.OnSelectedEntityChangedCallBack = this.OnSelectedEntityChangedCallBack;
            ROLECollection.OnEntitiesLoadedCallBack        = this.OnEntitiesLoaded;

            ROLE_PERMISSIONCollection = ROLE_PERMISSIONSProjectionCollectionViewModel.Create(null, query => ROLE_PERMISSIONProjectionQueries.GetAssignedROLE_PERMISSIONByROLE(query, GetROLE_KEYFunc, GetStaticROLE_PERMISSIONS()));
            ROLE_PERMISSIONCollection.ApplyProjectionPropertiesToEntityCallBack = this.ApplyProjectionPropertiesToEntityCallBack;
            ROLE_PERMISSIONCollection.OnEntitiesLoadedCallBack = this.OnEntitiesLoaded;
            ROLE_PERMISSIONCollection.IsPersistentView         = true;
            ROLE_PERMISSIONCollection.SetParentViewModel(this);
            selectFirstRoleDispatcher          = new DispatcherTimer();
            selectFirstRoleDispatcher.Interval = new TimeSpan(0, 0, 0, 0, 1);
            selectFirstRoleDispatcher.Tick    += selectFirstRoleDispatcher_Tick;
        }
Beispiel #4
0
 void IDocumentContent.OnDestroy()
 {
     ROLECollection.OnDestroy();
     ROLE_PERMISSIONCollection.OnDestroy();
 }