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)); }
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); }
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)); }
/// <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]); }
/// <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>()); }
public void LoadForEntity(Type typeOfTheEntity, TypeActionInSystem typeActionInSystem) { _entityType = typeOfTheEntity; _typeActionInSystem = typeActionInSystem; Load(); }
public void LoadForEntity <TEntity>(TypeActionInSystem typeActionInSystem) { LoadForEntity(typeof(TEntity), typeActionInSystem); }
public IList <UnitFunctionDto> GetFunction(Type type, TypeActionInSystem typeActionInSystem, long acatalog) { throw new NotImplementedException(); }
public CatalogHierarchical GetCatalogHierarchical(Type type, TypeActionInSystem typeActionInSystem) { var result = Builder <CatalogHierarchical> .CreateNew().Build(); return(result); }