public override IODATAQueryManager DecorateFinder(IODATAQueryManager odataQuery)
        {
            if (IdDocumentUnit.HasValue && IdDocumentUnit.Value != Guid.Empty)
            {
                string odataExpression = string.Format("UniqueId eq {0}", IdDocumentUnit.Value);
                odataQuery = odataQuery.Filter(odataExpression);
            }

            if (ExpandContainer)
            {
                odataQuery = odataQuery.Expand("Container");
            }

            if (ExpandChains)
            {
                odataQuery = odataQuery.Expand("DocumentUnitChains");
            }

            if (ExpandRoles)
            {
                odataQuery = odataQuery.Expand("DocumentUnitRoles");
            }

            if (ExpandUDSRepository)
            {
                odataQuery = odataQuery.Expand("UDSRepository");
            }

            if (ExpandUsers)
            {
                odataQuery = odataQuery.Expand("DocumentUnitUsers");
            }
            return(odataQuery);
        }
        public override IODATAQueryManager DecorateFinder(IODATAQueryManager odataQuery)
        {
            if (IdUDS.HasValue && IdUDS.Value != Guid.Empty)
            {
                string odataExpression = string.Format("IdUDS eq {0}", IdUDS.Value);
                odataQuery = odataQuery.Filter(odataExpression);
            }

            if (DocumentUnitTypes.Count > 0)
            {
                string odataExpression = string.Join(" or ", DocumentUnitTypes.Select(s => string.Format("RelationType eq VecompSoftware.DocSuiteWeb.Entity.UDS.UDSRelationType'{0}'", (int)s)));
                odataQuery = odataQuery.Filter(string.Concat("(", odataExpression, ")"));
            }

            if (IdDocumentUnit.HasValue)
            {
                odataQuery = odataQuery.Filter(string.Format("Relation/UniqueId eq {0}", IdDocumentUnit));
            }

            if (ExpandRelation)
            {
                odataQuery = odataQuery.Expand("Relation");
            }

            if (ExpandRepository)
            {
                odataQuery = odataQuery.Expand("Repository");
            }

            return(odataQuery);
        }
        /*
         * http://localhost/dsw.webapi/odata/RoleUsers/RoleUserService.GetRoleUsersFromDossier(finder=@p0)?@p0={'IdDossiers':'cd0e6b16-c523-459f-a118-b541288ac3c3'}
         */
        public override IODATAQueryManager DecorateFinder(IODATAQueryManager odataQuery)
        {
            odataQuery = odataQuery.Function(string.Format(CommonDefinition.OData.RoleUserService.FX_AllSecretariesFromDossier,
                                                           JsonConvert.SerializeObject(RoleUserFinderModel)));

            return(base.DecorateFinder(odataQuery));
        }
Example #4
0
        public override IODATAQueryManager DecorateFinder(IODATAQueryManager odataQuery)
        {
            string IdUDSTypologyParameter = IdUDSTypology.HasValue ? IdUDSTypology.Value.ToString() : "null";

            switch (ActionType)
            {
            case UDSRepositoryFinderActionType.Insert:
            {
                odataQuery = odataQuery.Function(string.Format(CommonDefinition.OData.UDSRepositoryService.FX_GetInsertableRepositoriesByTypology, UserName, Domain, IdUDSTypologyParameter, PECAnnexedEnabled.ToString().ToLower()));
                break;
            }

            case UDSRepositoryFinderActionType.Search:
            {
                odataQuery = odataQuery.Function(string.Format(CommonDefinition.OData.UDSRepositoryService.FX_GetViewableRepositoriesByTypology, IdUDSTypologyParameter, PECAnnexedEnabled.ToString().ToLower()));
                break;
            }

            case UDSRepositoryFinderActionType.FindElement:
            {
                odataQuery = UniqueId.HasValue ? odataQuery.Filter(string.Concat("UniqueId eq ", UniqueId.Value.ToString())) : odataQuery;
                break;
            }
            }

            if (ExpandProperties)
            {
                odataQuery = odataQuery.Expand("Container");
            }
            return(odataQuery);
        }
Example #5
0
        public override IODATAQueryManager DecorateFinder(IODATAQueryManager odataQuery)
        {
            if (ExpandProperties.HasValue && ExpandProperties.Value)
            {
                odataQuery = odataQuery.Expand("Manager")
                             .Expand("FasciclePeriod")
                             .Expand("Category");
            }

            if (ParentCategoryFascicle.HasValue && ParentCategoryFascicle.Value)
            {
                odataQuery = odataQuery.Function(string.Format(CommonDefinition.OData.CategoryFascicleService.FX_GetAuthorizedTemplates, IdCategory, Environment));
                return(odataQuery);
            }

            if (Environment.HasValue)
            {
                odataQuery = odataQuery.Filter(string.Concat("DSWEnvironment eq ", Environment.Value));
            }

            if (IdCategory.HasValue)
            {
                odataQuery = odataQuery.Filter(string.Concat("Category/EntityShortId eq ", IdCategory.Value));
            }

            return(odataQuery);
        }
        public override IODATAQueryManager DecorateFinder(IODATAQueryManager odataQuery)
        {
            if (DocumentUnitFinderAction.HasValue)
            {
                switch (DocumentUnitFinderAction.Value)
                {
                case DocumentUnitFinderActionType.FascicolableUD:
                    odataQuery = odataQuery.Function(string.Format(
                                                         CommonDefinition.OData.DocumentUnitService.FX_GetFascicolableDocuments,
                                                         DateFrom.Value.ToString(ODataDateConversion), DateTo.Value.ToString(ODataDateConversion),
                                                         IncludeThreshold.ToString().ToLower(), FascicolableThresholdDate.Value.ToString(ODataDateConversion),
                                                         IdTenantAOO.Value,
                                                         ExcludeLinked.ToString().ToLower()));
                    break;

                case DocumentUnitFinderActionType.AuthorizedUD:
                    odataQuery = odataQuery.Function(string.Format(CommonDefinition.OData.DocumentUnitService.FX_GetAutorizedDocuments,
                                                                   DateFrom.Value.ToString(ODataDateConversion), DateTo.Value.ToString(ODataDateConversion), IdTenantAOO.Value));
                    break;

                case DocumentUnitFinderActionType.CategorizedUD:
                    odataQuery = odataQuery.Filter(string.Format("Category/UniqueId eq {0}", CategoryId));
                    break;
                }
            }

            if (IdDocumentUnit.HasValue && IdDocumentUnit.Value != Guid.Empty)
            {
                string odataExpression = string.Format("UniqueId eq {0}", IdDocumentUnit.Value);
                odataQuery = odataQuery.Filter(odataExpression);
            }
            return(odataQuery);
        }
Example #7
0
 /// <summary>
 /// Decora il Finder. Metodo che deve essere implementato nelle classi figlie.
 /// </summary>
 public virtual IODATAQueryManager DecorateFinder(IODATAQueryManager odataQuery)
 {
     if (UniqueId.HasValue)
     {
         odataQuery = odataQuery.Filter(string.Concat("UniqueId eq ", UniqueId));
     }
     return(odataQuery);
 }
 public override IODATAQueryManager DecorateFinder(IODATAQueryManager odataQuery)
 {
     if (!string.IsNullOrEmpty(MetadataKeyName))
     {
         odataQuery = odataQuery.Filter($"contains(JsonMetadata, '\"KeyName\":\"{MetadataKeyName}\"')");
     }
     return(base.DecorateFinder(odataQuery));
 }
Example #9
0
 public override IODATAQueryManager DecorateFinder(IODATAQueryManager odataQuery)
 {
     if (ExpandRole)
     {
         odataQuery = odataQuery.Expand("Role");
     }
     return(base.DecorateFinder(odataQuery));
 }
        public override IODATAQueryManager DecorateFinder(IODATAQueryManager odataQuery)
        {
            if (!string.IsNullOrEmpty(Path))
            {
                odataQuery = odataQuery.Filter($"MassimarioScartoPath eq '{Path}'");
            }

            return(base.DecorateFinder(odataQuery));
        }
Example #11
0
        public override IODATAQueryManager DecorateFinder(IODATAQueryManager odataQuery)
        {
            if (IdCategory.HasValue)
            {
                odataQuery = odataQuery.Filter(string.Concat("EntityShortId eq ", IdCategory.Value));
            }

            return(odataQuery);
        }
Example #12
0
        public override IODATAQueryManager DecorateFinder(IODATAQueryManager odataQuery)
        {
            if (IdSeries.HasValue)
            {
                odataQuery = odataQuery.Filter(string.Concat("DocumentSeries/EntityId eq ", IdSeries.Value));
            }

            return(base.DecorateFinder(odataQuery));
        }
Example #13
0
        public override IODATAQueryManager DecorateFinder(IODATAQueryManager odataQuery)
        {
            odataQuery = odataQuery.Expand("UDSRepositories");

            if (Status.HasValue && Status != UDSTypologyStatus.Invalid)
            {
                odataQuery = odataQuery.Filter(string.Concat("Status eq VecompSoftware.DocSuiteWeb.Entity.UDS.UDSTypologyStatus'", (short)Status.Value, "'"));
            }
            return(base.DecorateFinder(odataQuery));
        }
Example #14
0
 public override IODATAQueryManager DecorateFinder(IODATAQueryManager odataQuery)
 {
     odataQuery = odataQuery.Function(string.Format(
                                          CommonDefinition.OData.DocumentSeriesService.FX_GetMonitoringQualityDetails,
                                          IdDocumentSeries,
                                          IdRole,
                                          DateFrom.Value.ToString(ODataDateConversion),
                                          DateTo.Value.ToString(ODataDateConversion)
                                          ));
     return(odataQuery);
 }
Example #15
0
        public override IODATAQueryManager DecorateFinder(IODATAQueryManager odataQuery)
        {
            string FX_GetUserTenants = CommonDefinition.OData.TenantService.FX_GetUserTenants;

            odataQuery = odataQuery.Function(FX_GetUserTenants);

            if (OnlyInternalTenants)
            {
                odataQuery = odataQuery.Filter("TenantTypology eq 'InternalTenant'");
            }
            return(odataQuery);
        }
Example #16
0
        public override IODATAQueryManager DecorateFinder(IODATAQueryManager odataQuery)
        {
            if (ExpandProperties.HasValue && ExpandProperties.Value)
            {
                odataQuery = odataQuery.Expand("TemplateCollaborationUsers($expand=Role)")
                             .Expand("TemplateCollaborationDocumentRepositories")
                             .Expand("Roles");
            }

            if (Status.HasValue)
            {
                if ((OnlyAuthorized.HasValue && OnlyAuthorized.Value) || (!string.IsNullOrEmpty(UserName) && IdRole != null))
                {
                    odataQuery = odataQuery.Filter(string.Concat("Status eq VecompSoftware.DocSuiteWeb.Model.Entities.Templates.TemplateCollaborationStatus'", (int)Status.Value, "'"));
                }
                else
                {
                    odataQuery = odataQuery.Filter(string.Concat("Status eq VecompSoftware.DocSuiteWeb.Entity.Templates.TemplateCollaborationStatus'", (int)Status.Value, "'"));
                }
            }

            if (OnlyAuthorized.HasValue && OnlyAuthorized.Value)
            {
                odataQuery = odataQuery.Function(string.Format(CommonDefinition.OData.TemplateCollaborationService.FX_GetAuthorizedTemplates, UserName, Domain));
            }

            if (!string.IsNullOrEmpty(UserName) && IdRole != null)
            {
                odataQuery = odataQuery.Function(string.Format(CommonDefinition.OData.TemplateCollaborationService.FX_GetInvalidatingTemplatesByRoleUserAccount, UserName, Domain, IdRole, DocumentType));
            }

            if (Locked.HasValue)
            {
                odataQuery.Filter(string.Concat("IsLocked eq ", Locked.ToString().ToLower()));
            }

            if (!string.IsNullOrEmpty(DocumentType))
            {
                string filter = string.Concat("DocumentType eq '", DocumentType, "'");
                if (DocumentType.Equals("UDS", StringComparison.InvariantCultureIgnoreCase))
                {
                    filter = string.Concat(filter, " or (startswith(DocumentType, '1') and length(DocumentType) gt 2)");
                }
                odataQuery.Filter(filter);
            }

            if (!string.IsNullOrEmpty(Name))
            {
                odataQuery.Filter(string.Concat("Name eq '", Name, "'"));
            }

            return(base.DecorateFinder(odataQuery));
        }
        public override IODATAQueryManager DecorateFinder(IODATAQueryManager odataQuery)
        {
            if (ExpandRepository)
            {
                odataQuery = odataQuery.Expand("WorkflowRepository");
            }

            if (ExpandProperties)
            {
                odataQuery = odataQuery.Expand("WorkflowProperties");
            }
            return(base.DecorateFinder(odataQuery));
        }
        public override IODATAQueryManager DecorateFinder(IODATAQueryManager odataQuery)
        {
            if (IdCollaboration.HasValue)
            {
                odataQuery = odataQuery.Filter(string.Format("Relation/EntityId eq {0}", IdCollaboration));
            }

            if (ExpandRepository)
            {
                odataQuery = odataQuery.Expand("Repository");
            }
            return(base.DecorateFinder(odataQuery));
        }
Example #19
0
        public override IODATAQueryManager DecorateFinder(IODATAQueryManager odataQuery)
        {
            if (IdDocumentUnit.HasValue)
            {
                odataQuery = odataQuery.Filter(string.Format("DocumentUnit/UniqueId eq {0}", IdDocumentUnit.Value));
            }

            if (ExpandProperties)
            {
                odataQuery = odataQuery.Expand("DocumentUnit($expand=UDSRepository)");
            }
            return(odataQuery);
        }
Example #20
0
        public override IODATAQueryManager DecorateFinder(IODATAQueryManager odataQuery)
        {
            if (WorkflowInstanceId.HasValue)
            {
                odataQuery = odataQuery.Filter(string.Format("WorkflowInstance/UniqueId eq {0}", WorkflowInstanceId.Value));
            }

            if (WorkflowInstanceInProgress.HasValue && WorkflowInstanceInProgress.Value)
            {
                odataQuery = odataQuery.Filter("WorkflowInstance/Status eq 'Progress'");
            }

            if (IsAuthorized.HasValue && IsAuthorized.Value && !string.IsNullOrEmpty(Account))
            {
                odataQuery = odataQuery.Filter($"WorkflowAuthorizations/any(wa:wa/Account eq '{Account}')");
            }

            if (DocumentUnitReferenced.HasValue)
            {
                odataQuery = odataQuery.Filter(string.Format("DocumentUnitReferenced/UniqueId eq {0}", DocumentUnitReferenced.Value));
            }

            if (ActivityType.HasValue)
            {
                odataQuery = odataQuery.Filter(string.Format("ActivityType eq VecompSoftware.DocSuiteWeb.Entity.Workflows.WorkflowActivityType'{0}'", (int)ActivityType.Value));
            }

            if (ExpandProperties)
            {
                odataQuery = odataQuery.Expand("WorkflowProperties");
            }

            if (ExpandRepository)
            {
                odataQuery = odataQuery.Expand("WorkflowInstance($expand=WorkflowRepository)");
            }

            if (Statuses.Count > 0)
            {
                ICollection <string> expressions = Statuses.Select(s => string.Format("Status eq VecompSoftware.DocSuiteWeb.Entity.Workflows.WorkflowStatus'{0}'", (int)s)).ToList();
                string odataExpression           = $"({string.Join(" or ", expressions)})";
                odataQuery = odataQuery.Filter(odataExpression);
            }

            if (Top1.HasValue && Top1.Value)
            {
                EnableTopOdata = false;
                odataQuery.Top(1);
            }
            return(base.DecorateFinder(odataQuery));
        }
Example #21
0
        public override IODATAQueryManager DecorateFinder(IODATAQueryManager odataQuery)
        {
            if (ExpandProperties.HasValue && ExpandProperties.Value)
            {
                odataQuery.Expand("Role");
            }

            if (IdFascicle.HasValue)
            {
                odataQuery = odataQuery.Filter(string.Concat("Fascicle/UniqueId eq ", IdFascicle.Value));
            }

            return(odataQuery);
        }
Example #22
0
        public override IODATAQueryManager DecorateFinder(IODATAQueryManager odataQuery)
        {
            if ((CheckUserAuthorization.HasValue && CheckUserAuthorization.Value) && (IdUDS.HasValue && IdUDS.Value != Guid.Empty) && (!string.IsNullOrEmpty(Domain) && !string.IsNullOrEmpty(Username)))
            {
                odataQuery = odataQuery.Function(string.Format(CommonDefinition.OData.UDSRepositoryService.FX_IsUserAuthorized, IdUDS.Value, Domain, Username));
            }

            if ((!CheckUserAuthorization.HasValue || !CheckUserAuthorization.Value) && (IdUDS.HasValue && IdUDS.Value != Guid.Empty))
            {
                odataQuery = odataQuery.Filter(string.Format("IdUDS eq {0}", IdUDS.Value));
            }

            return(odataQuery);
        }
Example #23
0
        public override IODATAQueryManager DecorateFinder(IODATAQueryManager odataQuery)
        {
            if (IdTenant.HasValue)
            {
                odataQuery = odataQuery.Filter($"Tenants/any(a:a/UniqueId eq {IdTenant.Value})");
            }

            if (EnablePaging)
            {
                odataQuery.Skip(PageIndex).Top(PageSize);
            }

            return(odataQuery);
        }
Example #24
0
        public override IODATAQueryManager DecorateFinder(IODATAQueryManager odataQuery)
        {
            if (IdUDS.HasValue && IdUDS.Value != Guid.Empty)
            {
                string odataExpression = string.Format("IdUDS eq {0}", IdUDS.Value);
                odataQuery = odataQuery.Filter(odataExpression);
            }

            if (ExpandRelation)
            {
                odataQuery = odataQuery.Expand("Relation");
            }

            return(odataQuery);
        }
Example #25
0
 public override IODATAQueryManager DecorateFinder(IODATAQueryManager odataQuery)
 {
     if (IncludeContainers)
     {
         odataQuery = odataQuery.Expand("Containers");
     }
     if (IncludeTenantAOO)
     {
         odataQuery = odataQuery.Expand("TenantAOO");
     }
     if (IdTenantAOO.HasValue)
     {
         odataQuery = odataQuery.Filter($"TenantAOO/UniqueId eq {IdTenantAOO}");
     }
     return(base.DecorateFinder(odataQuery));
 }
Example #26
0
 public override IODATAQueryManager DecorateFinder(IODATAQueryManager odataQuery)
 {
     if (MinimumLevel.HasValue)
     {
         odataQuery = odataQuery.Filter(string.Concat("Level ge ", MinimumLevel));
         odataQuery = odataQuery.Sorting("Level");
     }
     if (MaximumLevel.HasValue)
     {
         odataQuery = odataQuery.Filter(string.Concat("Level le ", MaximumLevel));
     }
     if (Level.HasValue)
     {
         odataQuery = odataQuery.Filter(string.Concat("Level eq ", Level));
     }
     return(base.DecorateFinder(odataQuery));
 }
Example #27
0
        public override IODATAQueryManager DecorateFinder(IODATAQueryManager odataQuery)
        {
            if (WorkflowActivityId.HasValue)
            {
                odataQuery = odataQuery.Filter($"WorkflowActivity/UniqueId eq {WorkflowActivityId.Value}");
            }
            if (IsHandler.HasValue)
            {
                odataQuery = odataQuery.Filter($"IsHandler eq {IsHandler.ToString().ToLower()}");
            }
            if (!string.IsNullOrEmpty(Account))
            {
                odataQuery = odataQuery.Filter($"Account eq '{Account}'");
            }

            return(base.DecorateFinder(odataQuery));
        }
Example #28
0
        /// <summary>
        /// Crea la DoSearchHeader con i metodi standard.
        /// Se non implementati, vengono usati quelli standard
        /// </summary>
        public ICollection <WebAPIDto <THeader> > DoSearchHeader()
        {
            ICollection <WebAPIDto <THeader> > searchHeaderList = CurrentTenantExecutionWebAPI <THeader>((tenant, results) =>
            {
                WebApiHttpClient httpClient   = GetWebAPIClient(tenant);
                IODATAQueryManager odataQuery = GetODataQuery();
                odataQuery = DecorateFinder(odataQuery);
                if (EnableTopOdata)
                {
                    odataQuery = odataQuery.Top(DocSuiteContext.Current.DefaultODataTopQuery);
                }
                odataQuery = AttachFilterExpressions(odataQuery);
                SetProjectionsHeaders(httpClient, odataQuery).ToList().ForEach(x => results.Add(_headerMapper.TransformDTO(x, tenant)));
                return(results);
            }, FinalizeDoSearchHeader, "DoSearchHeader");

            return(searchHeaderList);
        }
        public override IODATAQueryManager DecorateFinder(IODATAQueryManager odataQuery)
        {
            if (WorkflowActivityId.HasValue)
            {
                odataQuery = odataQuery.Filter(string.Format("WorkflowActivity/UniqueId eq {0}", WorkflowActivityId.Value));
            }

            if (WorkflowInstanceId.HasValue)
            {
                odataQuery = odataQuery.Filter(string.Format("WorkflowInstance/UniqueId eq {0}", WorkflowInstanceId.Value));
            }

            if (!string.IsNullOrEmpty(Name))
            {
                odataQuery = odataQuery.Filter(string.Format("contains(Name, '{0}')", Name));
            }
            return(base.DecorateFinder(odataQuery));
        }
        public override IODATAQueryManager DecorateFinder(IODATAQueryManager odataQuery)
        {
            if (ExpandProperties)
            {
                odataQuery = odataQuery.Expand("DocumentSeriesConstraint");
            }

            if (IdDocumentSeries.HasValue)
            {
                odataQuery = odataQuery.Filter(string.Concat("DocumentSeries/EntityId eq ", IdDocumentSeries.Value));
            }

            if (IdResolutionKind.HasValue)
            {
                odataQuery = odataQuery.Filter(string.Concat("ResolutionKind/UniqueId eq ", IdResolutionKind.Value));
            }

            return(base.DecorateFinder(odataQuery));
        }