Пример #1
0
 public SubscriptionParams(string tableName, string columns, string tableFilter, GlobalFilter globalFilter)
 {
     this.tableName = tableName;
     this.columns = columns;
     this.tableFilter = tableFilter;
     this.globalFilter = globalFilter;
 }
Пример #2
0
 public IHttpActionResult GetFilteredAndPaginated(GlobalFilter filter)
 {
     try
     {
         if (filter != null)
         {
             return(Ok(new { StatusCode = 200, Students = studentService.GetPaginatedStudents(filter.Filter, filter.Pagination) }));
         }
         throw new OperationException(ErrorEnum.InCorrectParams);
     }
     catch (OperationException e)
     {
         var errorURI = $"{Request.RequestUri.Authority}/api/error/Get?id={e.Status}";
         return(Ok(new { e.StatusCode, Info = errorURI }));
     }
 }
Пример #3
0
        /// <summary>
        /// Obtiene la metadata de un modelo
        /// </summary>
        /// <param name="assembly">Assembly donde se encuentra el modelo connect</param>
        /// <param name="version"></param>
        /// <param name="versionStructure"></param>
        /// <returns></returns>
        public static ModelMetaData GetMdm(Assembly assembly, string version, VersionStructure versionStructure)
        {
            // obtenemos global filter para asignar si es globalfilter la entidad.
            var globalFilters = GlobalFilter.GetGlobalFilter(assembly);

            // obtiene la metadata de las entidades
            var entitiesFirstStep = GetFirstStepEntityCollection(assembly, globalFilters);

            // obtiene la documentación de las entidades.
            var mainDocumentation = GetMainDocumentation(assembly, entitiesFirstStep);


            // obtiene la documentación de los filtros.
            var filterProcess = GetFilterProcessDocs(assembly);

            // asigna documentación a las entidades.
            var entitiesWithDocumentation = entitiesFirstStep.Select(s => Docs.GetEntityWithDocumentation(s, mainDocumentation)).ToList();

            // asigna los procesos.
            var entitiesWithProcess = entitiesWithDocumentation.Select(s => GetEntityWithProcess(assembly, globalFilters, s, filterProcess)).ToList();

            // obtiene las descripciones de las enumeraciones en el assembly.
            var enumDescriptions = GetEnumDescriptions(assembly);



            // falta asignar los deletes a entities
            var md = new ModelMetaData
            {
                Version           = version,
                VersionStructure  = versionStructure,
                GlobalFilters     = globalFilters,
                EnumDescriptions  = enumDescriptions,
                DocFilters        = filterProcess,
                MdmEntities       = entitiesWithProcess.ToArray(),
                MainDocumentation = mainDocumentation,
                Menu = new GroupMenuViewer[] { }
            };

            return(md);
        }
Пример #4
0
 public void setGlobalHandler(GlobalFilter globalHandler)
 {
     globalhandler = globalHandler;
 }
Пример #5
0
 public AsyncServer(int port, PacketConverter packetconverter)
 {
     this.port     = port;
     __pc          = packetconverter;
     globalhandler = new GlobalFilter(new PacketPolicy());
 }
Пример #6
0
 public AsyncServer(int port, PacketConverter packetconverter, GlobalFilter globalFilter)
 {
     this.port     = port;
     __pc          = packetconverter;
     globalhandler = globalFilter;
 }
Пример #7
0
 internal Client(Socket _socket, long uid, GlobalFilter globalFilter)
 {
     socket = _socket; this.uid = uid; gf = globalFilter;
 }
Пример #8
0
 internal Context(PacketConverter pc, GlobalFilter gf, Client client)
 {
     this.clnt            = client;
     this.gf              = gf;
     this.packetconverter = pc;
 }
Пример #9
0
 public string[] SplitGlobalFilters()
 {
     return(GlobalFilter != null?GlobalFilter.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries) : new string[0]);
 }
Пример #10
0
 public override void OnAttachToDataGrid(DependencyObject s, DependencyPropertyChangedEventArgs e)
 {
     Filter = new GlobalFilter(DataGridOwner.ModelView.ItemType, DataGridOwner.ModelView.ItemType.GetProperties().Select(x => x.Name));
 }