Exemplo n.º 1
0
        /// <summary>
        /// Carga información en el combox.
        /// </summary>
        private void loadCombobox()
        {
            List <Module> lLstModules = mObjServicesFactory.GetModuleService().GetList().Where(x => x.Active == true && x.Removed == false).ToList();

            cbModule.ItemsSource       = lLstModules;
            cbModule.DisplayMemberPath = "Name";
            cbModule.SelectedValuePath = "Id";
        }
Exemplo n.º 2
0
        public List <ModuleDTO> GetMenuPermissions(PermissionTypeEnum pEnmPermissionType, long pLonPermissionId)
        {
            IList <Module> lLstObjModules = mObjSystemServiceFactory.GetModuleService().GetList().Where(x => x.Active == true).ToList();

            IList <Permission> lLstObjPermissions = pEnmPermissionType == PermissionTypeEnum.USER_TYPE ?
                                                    mObjSecurityServiceFactory.GetPermissionService().GetUserTypePermissions(pLonPermissionId) :
                                                    mObjSecurityServiceFactory.GetPermissionService().GetUserPermissions(pLonPermissionId);

            foreach (Module lObjModule in lLstObjModules)
            {
                //Is active if exists on permissions list and allow it access
                lObjModule.Active = lLstObjPermissions.Where(x => x.AccessType == AccessTypeEnum.MODULE && x.AccessId == lObjModule.Id && x.AllowAccess).Count() > 0;

                //For each section in the module
                foreach (UGRS.Core.Auctions.Entities.System.Section lObjSection in lObjModule.Sections)
                {
                    //Is active if exists on permissions list and allow it access
                    lObjSection.Active = lLstObjPermissions.Where(x => x.AccessType == AccessTypeEnum.MODULE && x.AccessId == lObjModule.Id && x.AllowAccess).Count() > 0;
                }
            }

            return(lLstObjModules.Select(x => new ModuleDTO(x)).ToList());
        }
Exemplo n.º 3
0
 /// <summary>
 /// Carga los datos en el DataGrid.
 /// </summary>
 public void LoadDataGrid()
 {
     FormLoading();
     try
     {
         this.Dispatcher.Invoke(() => { dgModules.ItemsSource = null; });
         List <Module> lLstModules = mObjServiceFactory.GetModuleService().GetList().Where(x => x.Active == true && x.Removed == false).ToList();
         mLcvListData = new ListCollectionView(lLstModules);
         this.Dispatcher.Invoke(() => { dgModules.ItemsSource = mLcvListData; });
     }
     catch (Exception lObjException)
     {
         FormDefault();
         CustomMessageBox.Show("Error", lObjException.Message, this.GetParent());
     }
     finally
     {
         FormDefault();
     }
 }