예제 #1
0
        private IList <Acatalog> GetCatalogs(Type type, TypeActionInSystem typeActionInSystem, CatalogDto catalog = null)
        {
            var filter = new AcatalogFilter
            {
                UserPrivilege = new UserPrivilegeFilter
                {
                    Role = new RoleFilter
                    {
                        UserRoles = new UserRoleFilter()
                    },
                    UnitFunction = new UnitFunctionFilter
                    {
                        Standard = typeActionInSystem,
                        SectionOfSystemUnitcode = new SectionOfSystemFilter
                        {
                            UnitCode = GetSectionOfSystem(type)
                        }
                    }
                }
            };

            if (catalog != null)
            {
                filter.Rn = catalog.Rn;
            }

            return(GetEntities <AcatalogFilter, Acatalog>(filter));
        }
예제 #2
0
        public IList <CatalogDto> GetAcatalogFilter(IDto editableObject, TypeActionInSystem typeActionInSystem)
        {
            //            var result = new DomainGenerator()
            //                .With<AcatalogDto>(x => x.For(c => c.Name, new StringGenerator(1, 4, 'N', 'A'))).Many<AcatalogDto>(10);
            var result = Builder <CatalogDto> .CreateListOfSize(10).Build();

            return(result);
        }
예제 #3
0
        private IList <UnitFunction> GetFunctions(Type type, TypeActionInSystem typeActionInSystem, CatalogDto catalog = null)
        {
            var filter = new UnitFunctionFilter
            {
                UserPrivilegeFilter = new UserPrivilegeFilter {
                    RnAccessCatalog = catalog != null ? catalog.Rn : 0
                },
                Standard = typeActionInSystem,
                SectionOfSystemUnitcode =
                    new SectionOfSystemFilter {
                    UnitCode = GetSectionOfSystem(type)
                }
            };

            return(GetEntities <UnitFunctionFilter, UnitFunction>(filter));
        }
예제 #4
0
        /// <summary>
        /// The get catalog hierarchical.
        /// </summary>
        /// <param name="type">
        /// The type.
        /// </param>
        /// <param name="typeActionInSystem">
        /// The type action in system.
        /// </param>
        /// <returns>
        /// The <see cref="CatalogHierarchical"/>.
        /// </returns>
        public CatalogHierarchical GetCatalogHierarchical([NotNull] Type type, TypeActionInSystem typeActionInSystem)
        {
            var filter = new AcatalogFilter
            {
                SectionOfSystem =
                    new SectionOfSystemFilter {
                    UnitCode = GetSectionOfSystem(type)
                }
            };

            IList <CatalogHierarchical> catalogfull =
                GetEntities <AcatalogFilter, Acatalog>(filter).ConvertToHierarchical();

            if (catalogfull == null || !catalogfull.Any())
            {
                throw new CatalogNotExistException(GetSectionOfSystem(type));
            }

            var access = GetCatalogs(type, typeActionInSystem).SetIsAccess(catalogfull);

            return(access[0]);
        }
예제 #5
0
        /// <summary>
        /// The get function.
        /// </summary>
        /// <param name="type">
        /// The type.
        /// </param>
        /// <param name="typeActionInSystem">
        /// The type action in system.
        /// </param>
        /// <param name="catalog">
        /// The catalog.
        /// </param>
        /// <returns>
        /// The <see cref="IList"/>.
        /// </returns>
        public IList <UnitFunctionDto> GetFunction(Type type, TypeActionInSystem typeActionInSystem, CatalogDto catalog = null)
        {
            var functions = GetFunctions(type, typeActionInSystem, catalog);

            return(functions.MapTo <UnitFunctionDto>());
        }
예제 #6
0
 public void LoadForEntity(Type typeOfTheEntity, TypeActionInSystem typeActionInSystem)
 {
     _entityType         = typeOfTheEntity;
     _typeActionInSystem = typeActionInSystem;
     Load();
 }
예제 #7
0
 public void LoadForEntity <TEntity>(TypeActionInSystem typeActionInSystem)
 {
     LoadForEntity(typeof(TEntity), typeActionInSystem);
 }
예제 #8
0
 public IList <UnitFunctionDto> GetFunction(Type type, TypeActionInSystem typeActionInSystem, long acatalog)
 {
     throw new NotImplementedException();
 }
예제 #9
0
        public CatalogHierarchical GetCatalogHierarchical(Type type, TypeActionInSystem typeActionInSystem)
        {
            var result = Builder <CatalogHierarchical> .CreateNew().Build();

            return(result);
        }