protected override void SetSearchCriteria(ref SearchBuilder sb)
        {
            if (AssetMetadataTextAreaIdList != null && AssetMetadataTextAreaIdList.Count > 0)
            {
                JoinableList list = new JoinableList(AssetMetadataTextAreaIdList);
                sb.Criteria.Add(string.Format("{0} IN (" + list + ")", AssetMetadataTextArea.Columns.AssetMetadataTextAreaId));
            }

            if (AssetMetadataTextAreaId.HasValue)
            {
                sb.Criteria.Add(string.Format("{0}=@assetMetadataTextAreaId", AssetMetadataTextArea.Columns.AssetMetadataTextAreaId));
                sb.AddDataParameter("@assetMetadataTextAreaId", AssetMetadataTextAreaId.Value);
            }

            if (AssetId != 0)
            {
                sb.Criteria.Add(string.Format("{0}=@assetId", AssetMetadataTextArea.Columns.AssetId));
                sb.AddDataParameter("@assetId", AssetId);
            }

            if (GroupNumber != 0)
            {
                sb.Criteria.Add(string.Format("{0}=@groupNumber", AssetMetadataTextArea.Columns.GroupNumber));
                sb.AddDataParameter("@groupNumber", GroupNumber);
            }

            SetCustomSearchCriteria(ref sb);
        }
Exemple #2
0
        protected override void SetSearchCriteria(ref SearchBuilder sb)
        {
            if (AssetTypeIdList != null && AssetTypeIdList.Count > 0)
            {
                JoinableList list = new JoinableList(AssetTypeIdList);
                sb.Criteria.Add(string.Format("{0} IN (" + list + ")", AssetType.Columns.AssetTypeId));
            }

            if (AssetTypeId.HasValue)
            {
                sb.Criteria.Add(string.Format("{0}=@assetTypeId", AssetType.Columns.AssetTypeId));
                sb.AddDataParameter("@assetTypeId", AssetTypeId.Value);
            }

            if (Name != String.Empty)
            {
                sb.Criteria.Add(string.Format("{0}=@name", AssetType.Columns.Name));
                sb.AddDataParameter("@name", Name);
            }

            if (IsVisible.HasValue)
            {
                sb.Criteria.Add(string.Format("{0}=@isVisible", AssetType.Columns.IsVisible));
                sb.AddDataParameter("@isVisible", SqlUtils.BitValue(IsVisible.Value));
            }

            if (IsDeleted.HasValue)
            {
                sb.Criteria.Add(string.Format("{0}=@isDeleted", AssetType.Columns.IsDeleted));
                sb.AddDataParameter("@isDeleted", SqlUtils.BitValue(IsDeleted.Value));
            }

            SetCustomSearchCriteria(ref sb);
        }
        protected override void SetSearchCriteria(ref SearchBuilder sb)
        {
            if (PluginIdList != null && PluginIdList.Count > 0)
            {
                JoinableList list = new JoinableList(PluginIdList);
                sb.Criteria.Add(string.Format("{0} IN (" + list + ")", Plugin.Columns.PluginId));
            }

            if (PluginId.HasValue)
            {
                sb.Criteria.Add(string.Format("{0}=@pluginId", Plugin.Columns.PluginId));
                sb.AddDataParameter("@pluginId", PluginId.Value);
            }

            if (RegistrationKey != Guid.Empty)
            {
                sb.Criteria.Add(string.Format("{0}=@registrationKey", Plugin.Columns.RegistrationKey));
                sb.AddDataParameter("@registrationKey", RegistrationKey);
            }

            if (RelativePath != String.Empty)
            {
                sb.Criteria.Add(string.Format("{0}=@relativePath", Plugin.Columns.RelativePath));
                sb.AddDataParameter("@relativePath", RelativePath);
            }

            if (Filename != String.Empty)
            {
                sb.Criteria.Add(string.Format("{0}=@filename", Plugin.Columns.Filename));
                sb.AddDataParameter("@filename", Filename);
            }

            if (Name != String.Empty)
            {
                sb.Criteria.Add(string.Format("{0}=@name", Plugin.Columns.Name));
                sb.AddDataParameter("@name", Name);
            }

            if (Checksum != null)
            {
                sb.Criteria.Add(string.Format("{0}=@checksum", Plugin.Columns.Checksum));
                sb.AddDataParameter("@checksum", Checksum.Value);
            }

            if (PluginType != null)
            {
                sb.Criteria.Add(string.Format("{0}=@pluginType", Plugin.Columns.PluginType));
                sb.AddDataParameter("@pluginType", PluginType.Value);
            }

            if (IsDefault.HasValue)
            {
                sb.Criteria.Add(string.Format("{0}=@isDefault", Plugin.Columns.IsDefault));
                sb.AddDataParameter("@isDefault", SqlUtils.BitValue(IsDefault.Value));
            }

            SetCustomSearchCriteria(ref sb);
        }
        protected override void SetSearchCriteria(ref SearchBuilder sb)
        {
            if (MetadataIdList != null && MetadataIdList.Count > 0)
            {
                JoinableList list = new JoinableList(MetadataIdList);
                sb.Criteria.Add(string.Format("{0} IN (" + list + ")", Metadata.Columns.MetadataId));
            }

            if (MetadataId.HasValue)
            {
                sb.Criteria.Add(string.Format("{0}=@metadataId", Metadata.Columns.MetadataId));
                sb.AddDataParameter("@metadataId", MetadataId.Value);
            }

            if (BrandId != null)
            {
                sb.Criteria.Add(string.Format("{0}=@brandId", Metadata.Columns.BrandId));
                sb.AddDataParameter("@brandId", BrandId.Value);
            }

            if (ParentMetadataId != null)
            {
                sb.Criteria.Add(string.Format("{0}=@parentMetadataId", Metadata.Columns.ParentMetadataId));
                sb.AddDataParameter("@parentMetadataId", ParentMetadataId.Value);
            }

            if (Name != String.Empty)
            {
                sb.Criteria.Add(string.Format("{0}=@name", Metadata.Columns.Name));
                sb.AddDataParameter("@name", Name);
            }

            if (ExternalRef != String.Empty)
            {
                sb.Criteria.Add(string.Format("{0}=@externalRef", Metadata.Columns.ExternalRef));
                sb.AddDataParameter("@externalRef", ExternalRef);
            }

            if (Synonyms != String.Empty)
            {
                sb.Criteria.Add(string.Format("{0}=@synonyms", Metadata.Columns.Synonyms));
                sb.AddDataParameter("@synonyms", Synonyms);
            }

            if (GroupNumber != 0)
            {
                sb.Criteria.Add(string.Format("{0}=@groupNumber", Metadata.Columns.GroupNumber));
                sb.AddDataParameter("@groupNumber", GroupNumber);
            }

            if (IsDeleted.HasValue)
            {
                sb.Criteria.Add(string.Format("{0}=@isDeleted", Metadata.Columns.IsDeleted));
                sb.AddDataParameter("@isDeleted", SqlUtils.BitValue(IsDeleted.Value));
            }

            SetCustomSearchCriteria(ref sb);
        }
        protected override void SetSearchCriteria(ref SearchBuilder sb)
        {
            if (AssetMetadataIdList != null && AssetMetadataIdList.Count > 0)
            {
                JoinableList list = new JoinableList(AssetMetadataIdList);
                sb.Criteria.Add(string.Format("{0} IN (" + list + ")", AssetMetadata.Columns.AssetMetadataId));
            }

            if (AssetMetadataId.HasValue)
            {
                sb.Criteria.Add(string.Format("{0}=@assetMetadataId", AssetMetadata.Columns.AssetMetadataId));
                sb.AddDataParameter("@assetMetadataId", AssetMetadataId.Value);
            }

            if (AssetId != 0)
            {
                sb.Criteria.Add(string.Format("{0}=@assetId", AssetMetadata.Columns.AssetId));
                sb.AddDataParameter("@assetId", AssetId);
            }

            if (MetadataId != 0)
            {
                sb.Criteria.Add(string.Format("{0}=@metadataId", AssetMetadata.Columns.MetadataId));
                sb.AddDataParameter("@metadataId", MetadataId);
            }

            if (BrandId.HasValue)
            {
                if (BrandId.Value == 0)
                {
                    sb.Criteria.Add("BrandId IS NULL");
                }
                else
                {
                    sb.Criteria.Add("BrandId=@brandId");
                    sb.AddDataParameter("@brandId", BrandId.Value);
                }
            }

            if (GroupNumber.HasValue)
            {
                if (GroupNumber.Value == 0)
                {
                    sb.Criteria.Add("GroupNumber IS NULL");
                }
                else
                {
                    sb.Criteria.Add("GroupNumber=@groupNumber");
                    sb.AddDataParameter("@groupNumber", GroupNumber.Value);
                }
            }

            if (Name != String.Empty)
            {
                sb.Criteria.Add("Name=@name");
                sb.AddDataParameter("@name", Name);
            }

            SetCustomSearchCriteria(ref sb);
        }
        protected override void SetSearchCriteria(ref SearchBuilder sb)
        {
            if (WorkflowIdList != null && WorkflowIdList.Count > 0)
            {
                JoinableList list = new JoinableList(WorkflowIdList);
                sb.Criteria.Add(string.Format("{0} IN (" + list + ")", Workflow.Columns.WorkflowId));
            }

            if (WorkflowId.HasValue)
            {
                sb.Criteria.Add(string.Format("{0}=@workflowId", Workflow.Columns.WorkflowId));
                sb.AddDataParameter("@workflowId", WorkflowId.Value);
            }

            if (Name != String.Empty)
            {
                sb.Criteria.Add(string.Format("{0}=@name", Workflow.Columns.Name));
                sb.AddDataParameter("@name", Name);
            }

            if (BrandId != 0)
            {
                sb.Criteria.Add(string.Format("{0}=@brandId", Workflow.Columns.BrandId));
                sb.AddDataParameter("@brandId", BrandId);
            }

            if (IsDeleted.HasValue)
            {
                sb.Criteria.Add(string.Format("{0}=@isDeleted", Workflow.Columns.IsDeleted));
                sb.AddDataParameter("@isDeleted", SqlUtils.BitValue(IsDeleted.Value));
            }

            if (BrandName != String.Empty)
            {
                sb.Criteria.Add("BrandName=@brandName");
                sb.AddDataParameter("@brandName", BrandName);
            }

            SetCustomSearchCriteria(ref sb);
        }
        protected override void SetSearchCriteria(ref SearchBuilder sb)
        {
            if (BrandMetadataSelectableSettingId.HasValue)
            {
                sb.Criteria.Add(string.Format("{0}=@brandMetadataSelectableSettingId", BrandMetadataSelectableSetting.Columns.BrandMetadataSelectableSettingId));
                sb.AddDataParameter("@brandMetadataSelectableSettingId", BrandMetadataSelectableSettingId.Value);
            }

            if (BrandMetadataSettingId != 0)
            {
                sb.Criteria.Add(string.Format("{0}=@brandMetadataSettingId", BrandMetadataSelectableSetting.Columns.BrandMetadataSettingId)); sb.AddDataParameter("@brandMetadataSettingId", BrandMetadataSettingId);
            }
            if (SelectableType != 0)
            {
                sb.Criteria.Add(string.Format("{0}=@selectableType", BrandMetadataSelectableSetting.Columns.SelectableType)); sb.AddDataParameter("@selectableType", SelectableType);
            }
            if (Depth != 0)
            {
                sb.Criteria.Add(string.Format("{0}=@depth", BrandMetadataSelectableSetting.Columns.Depth)); sb.AddDataParameter("@depth", Depth);
            }
            if (IsLinear.HasValue)
            {
                sb.Criteria.Add(string.Format("{0}=@isLinear", BrandMetadataSelectableSetting.Columns.IsLinear)); sb.AddDataParameter("@isLinear", IsLinear);
            }
            if (SortType != 0)
            {
                sb.Criteria.Add(string.Format("{0}=@sortType", BrandMetadataSelectableSetting.Columns.SortType)); sb.AddDataParameter("@sortType", SortType);
            }
            if (AllowMultiple.HasValue)
            {
                sb.Criteria.Add(string.Format("{0}=@allowMultiple", BrandMetadataSelectableSetting.Columns.AllowMultiple)); sb.AddDataParameter("@allowMultiple", AllowMultiple);
            }
            if (OrderType != 0)
            {
                sb.Criteria.Add(string.Format("{0}=@orderType", BrandMetadataSelectableSetting.Columns.OrderType)); sb.AddDataParameter("@orderType", OrderType);
            }
            if (ColumnCount != 0)
            {
                sb.Criteria.Add(string.Format("{0}=@columnCount", BrandMetadataSelectableSetting.Columns.ColumnCount)); sb.AddDataParameter("@columnCount", ColumnCount);
            }

            SetCustomSearchCriteria(ref sb);
        }
        protected override void SetSearchCriteria(ref SearchBuilder sb)
        {
            if (LightboxLinkedIdList != null && LightboxLinkedIdList.Count > 0)
            {
                JoinableList list = new JoinableList(LightboxLinkedIdList);
                sb.Criteria.Add(string.Format("{0} IN (" + list + ")", LightboxLinked.Columns.LightboxLinkedId));
            }

            if (LightboxLinkedId.HasValue)
            {
                sb.Criteria.Add(string.Format("{0}=@lightboxLinkedId", LightboxLinked.Columns.LightboxLinkedId));
                sb.AddDataParameter("@lightboxLinkedId", LightboxLinkedId.Value);
            }

            if (LightboxId != 0)
            {
                sb.Criteria.Add(string.Format("{0}=@lightboxId", LightboxLinked.Columns.LightboxId));
                sb.AddDataParameter("@lightboxId", LightboxId);
            }

            if (UserId != 0)
            {
                sb.Criteria.Add(string.Format("{0}=@userId", LightboxLinked.Columns.UserId));
                sb.AddDataParameter("@userId", UserId);
            }

            if (IsEditable.HasValue)
            {
                sb.Criteria.Add(string.Format("{0}=@isEditable", LightboxLinked.Columns.IsEditable));
                sb.AddDataParameter("@isEditable", SqlUtils.BitValue(IsEditable.Value));
            }

            if (ExpiryDate != null)
            {
                sb.Criteria.Add(string.Format("{0}=@expiryDate", LightboxLinked.Columns.ExpiryDate));
                sb.AddDataParameter("@expiryDate", ExpiryDate.Value);
            }

            if (Disabled.HasValue)
            {
                sb.Criteria.Add(string.Format("{0}=@disabled", LightboxLinked.Columns.Disabled));
                sb.AddDataParameter("@disabled", SqlUtils.BitValue(Disabled.Value));
            }

            SetCustomSearchCriteria(ref sb);
        }
Exemple #9
0
        protected override void SetSearchCriteria(ref SearchBuilder sb)
        {
            if (WorkflowUserIdList != null && WorkflowUserIdList.Count > 0)
            {
                JoinableList list = new JoinableList(WorkflowUserIdList);
                sb.Criteria.Add(string.Format("{0} IN (" + list + ")", WorkflowUser.Columns.WorkflowUserId));
            }

            if (WorkflowUserId.HasValue)
            {
                sb.Criteria.Add(string.Format("{0}=@workflowUserId", WorkflowUser.Columns.WorkflowUserId));
                sb.AddDataParameter("@workflowUserId", WorkflowUserId.Value);
            }

            if (WorkflowId != 0)
            {
                sb.Criteria.Add(string.Format("{0}=@workflowId", WorkflowUser.Columns.WorkflowId));
                sb.AddDataParameter("@workflowId", WorkflowId);
            }

            if (UserId != 0)
            {
                sb.Criteria.Add(string.Format("{0}=@userId", WorkflowUser.Columns.UserId));
                sb.AddDataParameter("@userId", UserId);
            }

            if (Position != 0)
            {
                sb.Criteria.Add(string.Format("{0}=@position", WorkflowUser.Columns.Position));
                sb.AddDataParameter("@position", Position);
            }

            if (DateAdded != DateTime.MinValue)
            {
                sb.Criteria.Add(string.Format("{0}=@dateAdded", WorkflowUser.Columns.DateAdded));
                sb.AddDataParameter("@dateAdded", DateAdded);
            }

            if (UserFullName != String.Empty)
            {
                sb.Criteria.Add("UserFullName=@userFullName");
                sb.AddDataParameter("@userFullName", UserFullName);
            }

            SetCustomSearchCriteria(ref sb);
        }
Exemple #10
0
        protected override void SetSearchCriteria(ref SearchBuilder sb)
        {
            if (LightboxAssetIdList != null && LightboxAssetIdList.Count > 0)
            {
                JoinableList list = new JoinableList(LightboxAssetIdList);
                sb.Criteria.Add(string.Format("{0} IN (" + list + ")", LightboxAsset.Columns.LightboxAssetId));
            }

            if (LightboxAssetId.HasValue)
            {
                sb.Criteria.Add(string.Format("{0}=@lightboxAssetId", LightboxAsset.Columns.LightboxAssetId));
                sb.AddDataParameter("@lightboxAssetId", LightboxAssetId.Value);
            }

            if (LightboxId != 0)
            {
                sb.Criteria.Add(string.Format("{0}=@lightboxId", LightboxAsset.Columns.LightboxId));
                sb.AddDataParameter("@lightboxId", LightboxId);
            }

            if (AssetId != 0)
            {
                sb.Criteria.Add(string.Format("{0}=@assetId", LightboxAsset.Columns.AssetId));
                sb.AddDataParameter("@assetId", AssetId);
            }

            if (Notes != String.Empty)
            {
                sb.Criteria.Add(string.Format("{0}=@notes", LightboxAsset.Columns.Notes));
                sb.AddDataParameter("@notes", Notes);
            }

            if (CreateDate != DateTime.MinValue)
            {
                sb.Criteria.Add(string.Format("{0}=@createDate", LightboxAsset.Columns.CreateDate));
                sb.AddDataParameter("@createDate", CreateDate);
            }

            if (OrderNumber != null)
            {
                sb.Criteria.Add(string.Format("{0}=@orderNumber", LightboxAsset.Columns.OrderNumber));
                sb.AddDataParameter("@orderNumber", OrderNumber.Value);
            }

            SetCustomSearchCriteria(ref sb);
        }
Exemple #11
0
        protected override void SetSearchCriteria(ref SearchBuilder sb)
        {
            if (AssetIdList != null && AssetIdList.Count > 0)
            {
                JoinableList list = new JoinableList(AssetIdList);
                sb.Criteria.Add(string.Format("{0} IN (" + list + ")", Asset.Columns.AssetId));
            }

            if (AssetId.HasValue)
            {
                sb.Criteria.Add(string.Format("{0}=@assetId", Asset.Columns.AssetId));
                sb.AddDataParameter("@assetId", AssetId.Value);
            }

            if (AssetTypeId != 0)
            {
                sb.Criteria.Add(string.Format("{0}=@assetTypeId", Asset.Columns.AssetTypeId));
                sb.AddDataParameter("@assetTypeId", AssetTypeId);
            }

            if (UploadDate != DateTime.MinValue)
            {
                sb.Criteria.Add(string.Format("{0}=@uploadDate", Asset.Columns.UploadDate));
                sb.AddDataParameter("@uploadDate", UploadDate);
            }

            if (Filename != String.Empty)
            {
                sb.Criteria.Add(string.Format("{0}=@filename", Asset.Columns.Filename));
                sb.AddDataParameter("@filename", Filename);
            }

            if (FileSize != 0)
            {
                sb.Criteria.Add(string.Format("{0}=@fileSize", Asset.Columns.FileSize));
                sb.AddDataParameter("@fileSize", FileSize);
            }

            if (FileHash != String.Empty)
            {
                sb.Criteria.Add(string.Format("{0}=@fileHash", Asset.Columns.FileHash));
                sb.AddDataParameter("@fileHash", FileHash);
            }

            if (TemplateAssetId != null)
            {
                sb.Criteria.Add(string.Format("{0}=@templateAssetId", Asset.Columns.TemplateAssetId));
                sb.AddDataParameter("@templateAssetId", TemplateAssetId.Value);
            }

            if (WorkflowId != null)
            {
                sb.Criteria.Add(string.Format("{0}=@workflowId", Asset.Columns.WorkflowId));
                sb.AddDataParameter("@workflowId", WorkflowId.Value);
            }

            if (Title != String.Empty)
            {
                sb.Criteria.Add(string.Format("{0}=@title", Asset.Columns.Title));
                sb.AddDataParameter("@title", Title);
            }

            if (ProjectCode != String.Empty)
            {
                sb.Criteria.Add(string.Format("{0}=@projectCode", Asset.Columns.ProjectCode));
                sb.AddDataParameter("@projectCode", ProjectCode);
            }

            if (Originator != String.Empty)
            {
                sb.Criteria.Add(string.Format("{0}=@originator", Asset.Columns.Originator));
                sb.AddDataParameter("@originator", Originator);
            }

            if (Description != String.Empty)
            {
                sb.Criteria.Add(string.Format("{0}=@description", Asset.Columns.Description));
                sb.AddDataParameter("@description", Description);
            }

            if (Keywords != String.Empty)
            {
                sb.Criteria.Add(string.Format("{0}=@keywords", Asset.Columns.Keywords));
                sb.AddDataParameter("@keywords", Keywords);
            }

            if (ContactEmail != String.Empty)
            {
                sb.Criteria.Add(string.Format("{0}=@contactEmail", Asset.Columns.ContactEmail));
                sb.AddDataParameter("@contactEmail", ContactEmail);
            }

            if (ProductionDay != null)
            {
                sb.Criteria.Add(string.Format("{0}=@productionDay", Asset.Columns.ProductionDay));
                sb.AddDataParameter("@productionDay", ProductionDay.Value);
            }

            if (ProductionMonth != null)
            {
                sb.Criteria.Add(string.Format("{0}=@productionMonth", Asset.Columns.ProductionMonth));
                sb.AddDataParameter("@productionMonth", ProductionMonth.Value);
            }

            if (ProductionYear != null)
            {
                sb.Criteria.Add(string.Format("{0}=@productionYear", Asset.Columns.ProductionYear));
                sb.AddDataParameter("@productionYear", ProductionYear.Value);
            }

            if (BrandId != 0)
            {
                sb.Criteria.Add(string.Format("{0}=@brandId", Asset.Columns.BrandId));
                sb.AddDataParameter("@brandId", BrandId);
            }

            if (CopyrightOwner != String.Empty)
            {
                sb.Criteria.Add(string.Format("{0}=@copyrightOwner", Asset.Columns.CopyrightOwner));
                sb.AddDataParameter("@copyrightOwner", CopyrightOwner);
            }

            if (UsageRestrictions != String.Empty)
            {
                sb.Criteria.Add(string.Format("{0}=@usageRestrictions", Asset.Columns.UsageRestrictions));
                sb.AddDataParameter("@usageRestrictions", UsageRestrictions);
            }

            if (RestrictAttachedFiles.HasValue)
            {
                sb.Criteria.Add(string.Format("{0}=@restrictAttachedFiles", Asset.Columns.RestrictAttachedFiles));
                sb.AddDataParameter("@restrictAttachedFiles", SqlUtils.BitValue(RestrictAttachedFiles.Value));
            }

            if (WatermarkPreview.HasValue)
            {
                sb.Criteria.Add(string.Format("{0}=@watermarkPreview", Asset.Columns.WatermarkPreview));
                sb.AddDataParameter("@watermarkPreview", SqlUtils.BitValue(WatermarkPreview.Value));
            }

            if (InternalUsers_DownloadApprovalRequired.HasValue)
            {
                sb.Criteria.Add(string.Format("{0}=@internalUsers_DownloadApprovalRequired", Asset.Columns.InternalUsers_DownloadApprovalRequired));
                sb.AddDataParameter("@internalUsers_DownloadApprovalRequired", SqlUtils.BitValue(InternalUsers_DownloadApprovalRequired.Value));
            }

            if (InternalUsers_HideFromUsers.HasValue)
            {
                sb.Criteria.Add(string.Format("{0}=@internalUsers_HideFromUsers", Asset.Columns.InternalUsers_HideFromUsers));
                sb.AddDataParameter("@internalUsers_HideFromUsers", SqlUtils.BitValue(InternalUsers_HideFromUsers.Value));
            }

            if (ExternalUsers_DownloadApprovalRequired.HasValue)
            {
                sb.Criteria.Add(string.Format("{0}=@externalUsers_DownloadApprovalRequired", Asset.Columns.ExternalUsers_DownloadApprovalRequired));
                sb.AddDataParameter("@externalUsers_DownloadApprovalRequired", SqlUtils.BitValue(ExternalUsers_DownloadApprovalRequired.Value));
            }

            if (ExternalUsers_HideFromUsers.HasValue)
            {
                sb.Criteria.Add(string.Format("{0}=@externalUsers_HideFromUsers", Asset.Columns.ExternalUsers_HideFromUsers));
                sb.AddDataParameter("@externalUsers_HideFromUsers", SqlUtils.BitValue(ExternalUsers_HideFromUsers.Value));
            }

            if (AssetFilePathId != 0)
            {
                sb.Criteria.Add(string.Format("{0}=@assetFilePathId", Asset.Columns.AssetFilePathId));
                sb.AddDataParameter("@assetFilePathId", AssetFilePathId);
            }

            if (PublishDate != DateTime.MinValue)
            {
                sb.Criteria.Add(string.Format("{0}=@publishDate", Asset.Columns.PublishDate));
                sb.AddDataParameter("@publishDate", PublishDate);
            }

            if (ExpiryDate != DateTime.MinValue)
            {
                sb.Criteria.Add(string.Format("{0}=@expiryDate", Asset.Columns.ExpiryDate));
                sb.AddDataParameter("@expiryDate", ExpiryDate);
            }

            if (IsProcessed.HasValue)
            {
                sb.Criteria.Add(string.Format("{0}=@isProcessed", Asset.Columns.IsProcessed));
                sb.AddDataParameter("@isProcessed", SqlUtils.BitValue(IsProcessed.Value));
            }

            if (AssetPublishStatusId != 0)
            {
                sb.Criteria.Add(string.Format("{0}=@assetPublishStatusId", Asset.Columns.AssetPublishStatusId));
                sb.AddDataParameter("@assetPublishStatusId", AssetPublishStatusId);
            }

            if (UploadedByUserId != 0)
            {
                sb.Criteria.Add(string.Format("{0}=@uploadedByUserId", Asset.Columns.UploadedByUserId));
                sb.AddDataParameter("@uploadedByUserId", UploadedByUserId);
            }

            if (CreateDate != DateTime.MinValue)
            {
                sb.Criteria.Add(string.Format("{0}=@createDate", Asset.Columns.CreateDate));
                sb.AddDataParameter("@createDate", CreateDate);
            }

            if (LastUpdate != DateTime.MinValue)
            {
                sb.Criteria.Add(string.Format("{0}=@lastUpdate", Asset.Columns.LastUpdate));
                sb.AddDataParameter("@lastUpdate", LastUpdate);
            }

            if (DownloadCount != 0)
            {
                sb.Criteria.Add(string.Format("{0}=@downloadCount", Asset.Columns.DownloadCount));
                sb.AddDataParameter("@downloadCount", DownloadCount);
            }

            if (PopularityRank != 0)
            {
                sb.Criteria.Add(string.Format("{0}=@popularityRank", Asset.Columns.PopularityRank));
                sb.AddDataParameter("@popularityRank", PopularityRank);
            }

            if (IsDeleted.HasValue)
            {
                sb.Criteria.Add(string.Format("{0}=@isDeleted", Asset.Columns.IsDeleted));
                sb.AddDataParameter("@isDeleted", SqlUtils.BitValue(IsDeleted.Value));
            }

            if (AssetCategories != String.Empty)
            {
                sb.Criteria.Add(string.Format("{0}=@assetCategories", Asset.Columns.AssetCategories));
                sb.AddDataParameter("@assetCategories", AssetCategories);
            }

            if (AssetMetadataVals != String.Empty)
            {
                sb.Criteria.Add(string.Format("{0}=@assetMetadataVals", Asset.Columns.AssetMetadataVals));
                sb.AddDataParameter("@assetMetadataVals", AssetMetadataVals);
            }

            if (MetadataXml != String.Empty)
            {
                sb.Criteria.Add(string.Format("{0}=@metadataXml", Asset.Columns.MetadataXml));
                sb.AddDataParameter("@metadataXml", MetadataXml);
            }

            if (Height != null)
            {
                sb.Criteria.Add(string.Format("{0}=@height", Asset.Columns.Height));
                sb.AddDataParameter("@height", Height.Value);
            }

            if (Width != null)
            {
                sb.Criteria.Add(string.Format("{0}=@width", Asset.Columns.Width));
                sb.AddDataParameter("@width", Width.Value);
            }

            if (Duration != null)
            {
                sb.Criteria.Add(string.Format("{0}=@duration", Asset.Columns.Duration));
                sb.AddDataParameter("@duration", Duration.Value);
            }

            if (MetadataSearchVals != String.Empty)
            {
                sb.Criteria.Add(string.Format("{0}=@metadataSearchVals", Asset.Columns.MetadataSearchVals));
                sb.AddDataParameter("@metadataSearchVals", MetadataSearchVals);
            }

            if (Plugin != Guid.Empty)
            {
                sb.Criteria.Add(string.Format("{0}=@plugin", Asset.Columns.Plugin));
                sb.AddDataParameter("@plugin", Plugin);
            }

            if (AssetTypeName != String.Empty)
            {
                sb.Criteria.Add("AssetTypeName=@assetTypeName");
                sb.AddDataParameter("@assetTypeName", AssetTypeName);
            }

            if (FileExtension != String.Empty)
            {
                sb.Criteria.Add("FileExtension=@fileExtension");
                sb.AddDataParameter("@fileExtension", FileExtension);
            }

            if (ShadowDate != null)
            {
                sb.Criteria.Add("ShadowDate=@shadowDate");
                sb.AddDataParameter("@shadowDate", ShadowDate.Value);
            }

            if (AssetPublishStatusName != String.Empty)
            {
                sb.Criteria.Add("AssetPublishStatusName=@assetPublishStatusName");
                sb.AddDataParameter("@assetPublishStatusName", AssetPublishStatusName);
            }

            if (UploadedByUserName != String.Empty)
            {
                sb.Criteria.Add("UploadedByUserName=@uploadedByUserName");
                sb.AddDataParameter("@uploadedByUserName", UploadedByUserName);
            }

            if (BrandName != String.Empty)
            {
                sb.Criteria.Add("BrandName=@brandName");
                sb.AddDataParameter("@brandName", BrandName);
            }

            if (SearchableData != String.Empty)
            {
                sb.Criteria.Add("SearchableData=@searchableData");
                sb.AddDataParameter("@searchableData", SearchableData);
            }

            SetCustomSearchCriteria(ref sb);
        }
        protected override void SetSearchCriteria(ref SearchBuilder sb)
        {
            if (AssetTypeFileExtensionIdList != null && AssetTypeFileExtensionIdList.Count > 0)
            {
                JoinableList list = new JoinableList(AssetTypeFileExtensionIdList);
                sb.Criteria.Add(string.Format("{0} IN (" + list + ")", AssetTypeFileExtension.Columns.AssetTypeFileExtensionId));
            }

            if (AssetTypeFileExtensionId.HasValue)
            {
                sb.Criteria.Add(string.Format("{0}=@assetTypeFileExtensionId", AssetTypeFileExtension.Columns.AssetTypeFileExtensionId));
                sb.AddDataParameter("@assetTypeFileExtensionId", AssetTypeFileExtensionId.Value);
            }

            if (Extension != String.Empty)
            {
                sb.Criteria.Add(string.Format("{0}=@extension", AssetTypeFileExtension.Columns.Extension));
                sb.AddDataParameter("@extension", Extension);
            }

            if (Name != String.Empty)
            {
                sb.Criteria.Add(string.Format("{0}=@name", AssetTypeFileExtension.Columns.Name));
                sb.AddDataParameter("@name", Name);
            }

            if (AssetTypeId != 0)
            {
                sb.Criteria.Add(string.Format("{0}=@assetTypeId", AssetTypeFileExtension.Columns.AssetTypeId));
                sb.AddDataParameter("@assetTypeId", AssetTypeId);
            }

            if (IconImage != null)
            {
                sb.Criteria.Add(string.Format("{0}=@iconImage", AssetTypeFileExtension.Columns.IconImage));
                sb.AddDataParameter("@iconImage", IconImage);
            }

            if (IconFilename != String.Empty)
            {
                sb.Criteria.Add(string.Format("{0}=@iconFilename", AssetTypeFileExtension.Columns.IconFilename));
                sb.AddDataParameter("@iconFilename", IconFilename);
            }

            if (IsVisible.HasValue)
            {
                sb.Criteria.Add(string.Format("{0}=@isVisible", AssetTypeFileExtension.Columns.IsVisible));
                sb.AddDataParameter("@isVisible", SqlUtils.BitValue(IsVisible.Value));
            }

            if (Plugin != Guid.Empty)
            {
                sb.Criteria.Add(string.Format("{0}=@plugin", AssetTypeFileExtension.Columns.Plugin));
                sb.AddDataParameter("@plugin", Plugin);
            }

            if (AssetTypeName != String.Empty)
            {
                sb.Criteria.Add("AssetTypeName=@assetTypeName");
                sb.AddDataParameter("@assetTypeName", AssetTypeName);
            }

            SetCustomSearchCriteria(ref sb);
        }
Exemple #13
0
        protected override void SetSearchCriteria(ref SearchBuilder sb)
        {
            if (UserIdList != null && UserIdList.Count > 0)
            {
                JoinableList list = new JoinableList(UserIdList);
                sb.Criteria.Add(string.Format("{0} IN (" + list + ")", User.Columns.UserId));
            }

            if (UserId.HasValue)
            {
                sb.Criteria.Add(string.Format("{0}=@userId", User.Columns.UserId));
                sb.AddDataParameter("@userId", UserId.Value);
            }

            if (FirstName != String.Empty)
            {
                sb.Criteria.Add(string.Format("{0}=@firstName", User.Columns.FirstName));
                sb.AddDataParameter("@firstName", FirstName);
            }

            if (LastName != String.Empty)
            {
                sb.Criteria.Add(string.Format("{0}=@lastName", User.Columns.LastName));
                sb.AddDataParameter("@lastName", LastName);
            }

            if (Email != String.Empty)
            {
                sb.Criteria.Add(string.Format("{0}=@email", User.Columns.Email));
                sb.AddDataParameter("@email", Email);
            }

            if (Password != String.Empty)
            {
                sb.Criteria.Add(string.Format("{0}=@password", User.Columns.Password));
                sb.AddDataParameter("@password", Password);
            }

            if (PasswordSalt != String.Empty)
            {
                sb.Criteria.Add(string.Format("{0}=@passwordSalt", User.Columns.PasswordSalt));
                sb.AddDataParameter("@passwordSalt", PasswordSalt);
            }

            if (PasswordExpiryDate != null)
            {
                sb.Criteria.Add(string.Format("{0}=@passwordExpiryDate", User.Columns.PasswordExpiryDate));
                sb.AddDataParameter("@passwordExpiryDate", PasswordExpiryDate.Value);
            }

            if (IsPasswordNonExpiring.HasValue)
            {
                sb.Criteria.Add(string.Format("{0}=@isPasswordNonExpiring", User.Columns.IsPasswordNonExpiring));
                sb.AddDataParameter("@isPasswordNonExpiring", SqlUtils.BitValue(IsPasswordNonExpiring.Value));
            }

            if (IsEmployee.HasValue)
            {
                sb.Criteria.Add(string.Format("{0}=@isEmployee", User.Columns.IsEmployee));
                sb.AddDataParameter("@isEmployee", SqlUtils.BitValue(IsEmployee.Value));
            }

            if (IsEngineer.HasValue)
            {
                sb.Criteria.Add(string.Format("{0}=@isEngineer", User.Columns.IsEngineer));
                sb.AddDataParameter("@isEngineer", SqlUtils.BitValue(IsEngineer.Value));
            }

            if (CompanyName != String.Empty)
            {
                sb.Criteria.Add(string.Format("{0}=@companyName", User.Columns.CompanyName));
                sb.AddDataParameter("@companyName", CompanyName);
            }

            if (PrimaryBrandId != 0)
            {
                sb.Criteria.Add(string.Format("{0}=@primaryBrandId", User.Columns.PrimaryBrandId));
                sb.AddDataParameter("@primaryBrandId", PrimaryBrandId);
            }

            if (CountryId != null)
            {
                sb.Criteria.Add(string.Format("{0}=@countryId", User.Columns.CountryId));
                sb.AddDataParameter("@countryId", CountryId.Value);
            }

            if (PhoneNumber != String.Empty)
            {
                sb.Criteria.Add(string.Format("{0}=@phoneNumber", User.Columns.PhoneNumber));
                sb.AddDataParameter("@phoneNumber", PhoneNumber);
            }

            if (MobileNumber != String.Empty)
            {
                sb.Criteria.Add(string.Format("{0}=@mobileNumber", User.Columns.MobileNumber));
                sb.AddDataParameter("@mobileNumber", MobileNumber);
            }

            if (RegisterDate != DateTime.MinValue)
            {
                sb.Criteria.Add(string.Format("{0}=@registerDate", User.Columns.RegisterDate));
                sb.AddDataParameter("@registerDate", RegisterDate);
            }

            if (LastLoginDate != null)
            {
                sb.Criteria.Add(string.Format("{0}=@lastLoginDate", User.Columns.LastLoginDate));
                sb.AddDataParameter("@lastLoginDate", LastLoginDate.Value);
            }

            if (AccountExpiryDate != null)
            {
                sb.Criteria.Add(string.Format("{0}=@accountExpiryDate", User.Columns.AccountExpiryDate));
                sb.AddDataParameter("@accountExpiryDate", AccountExpiryDate.Value);
            }

            if (IsAccountNonExpiring.HasValue)
            {
                sb.Criteria.Add(string.Format("{0}=@isAccountNonExpiring", User.Columns.IsAccountNonExpiring));
                sb.AddDataParameter("@isAccountNonExpiring", SqlUtils.BitValue(IsAccountNonExpiring.Value));
            }

            if (IsSuspended.HasValue)
            {
                sb.Criteria.Add(string.Format("{0}=@isSuspended", User.Columns.IsSuspended));
                sb.AddDataParameter("@isSuspended", SqlUtils.BitValue(IsSuspended.Value));
            }

            if (UserRoleId != 0)
            {
                sb.Criteria.Add(string.Format("{0}=@userRoleId", User.Columns.UserRoleId));
                sb.AddDataParameter("@userRoleId", UserRoleId);
            }

            if (UserStatusId != 0)
            {
                sb.Criteria.Add(string.Format("{0}=@userStatusId", User.Columns.UserStatusId));
                sb.AddDataParameter("@userStatusId", UserStatusId);
            }

            if (UseWorkflow.HasValue)
            {
                sb.Criteria.Add(string.Format("{0}=@useWorkflow", User.Columns.UseWorkflow));
                sb.AddDataParameter("@useWorkflow", SqlUtils.BitValue(UseWorkflow.Value));
            }

            if (WorkflowId != null)
            {
                sb.Criteria.Add(string.Format("{0}=@workflowId", User.Columns.WorkflowId));
                sb.AddDataParameter("@workflowId", WorkflowId.Value);
            }

            if (Notes != String.Empty)
            {
                sb.Criteria.Add(string.Format("{0}=@notes", User.Columns.Notes));
                sb.AddDataParameter("@notes", Notes);
            }

            if (IsAllowedExternalAccess.HasValue)
            {
                sb.Criteria.Add(string.Format("{0}=@isAllowedExternalAccess", User.Columns.IsAllowedExternalAccess));
                sb.AddDataParameter("@isAllowedExternalAccess", SqlUtils.BitValue(IsAllowedExternalAccess.Value));
            }

            if (ApproverUserId != null)
            {
                sb.Criteria.Add(string.Format("{0}=@approverUserId", User.Columns.ApproverUserId));
                sb.AddDataParameter("@approverUserId", ApproverUserId.Value);
            }

            if (CatalogueAssetIdList != String.Empty)
            {
                sb.Criteria.Add(string.Format("{0}=@catalogueAssetIdList", User.Columns.CatalogueAssetIdList));
                sb.AddDataParameter("@catalogueAssetIdList", CatalogueAssetIdList);
            }

            if (IsDeleted.HasValue)
            {
                sb.Criteria.Add(string.Format("{0}=@isDeleted", User.Columns.IsDeleted));
                sb.AddDataParameter("@isDeleted", SqlUtils.BitValue(IsDeleted.Value));
            }

            if (Guid != String.Empty)
            {
                sb.Criteria.Add(string.Format("{0}=@guid", User.Columns.Guid));
                sb.AddDataParameter("@guid", Guid);
            }

            if (EnableFilePathIngestion.HasValue)
            {
                sb.Criteria.Add(string.Format("{0}=@enableFilePathIngestion", User.Columns.EnableFilePathIngestion));
                sb.AddDataParameter("@enableFilePathIngestion", SqlUtils.BitValue(EnableFilePathIngestion.Value));
            }

            if (UserAPIToken != String.Empty)
            {
                sb.Criteria.Add(string.Format("{0}=@userAPIToken", User.Columns.UserAPIToken));
                sb.AddDataParameter("@userAPIToken", UserAPIToken);
            }

            if (SessionAPIToken != String.Empty)
            {
                sb.Criteria.Add(string.Format("{0}=@sessionAPIToken", User.Columns.SessionAPIToken));
                sb.AddDataParameter("@sessionAPIToken", SessionAPIToken);
            }

            if (LastAPIOperation != null)
            {
                sb.Criteria.Add(string.Format("{0}=@lastAPIOperation", User.Columns.LastAPIOperation));
                sb.AddDataParameter("@lastAPIOperation", LastAPIOperation.Value);
            }

            if (FullName != String.Empty)
            {
                sb.Criteria.Add("FullName=@fullName");
                sb.AddDataParameter("@fullName", FullName);
            }

            if (IsPasswordExpired.HasValue)
            {
                sb.Criteria.Add("IsPasswordExpired=@isPasswordExpired");
                sb.AddDataParameter("@isPasswordExpired", SqlUtils.BitValue(IsPasswordExpired.Value));
            }

            if (IsAccountExpired.HasValue)
            {
                sb.Criteria.Add("IsAccountExpired=@isAccountExpired");
                sb.AddDataParameter("@isAccountExpired", SqlUtils.BitValue(IsAccountExpired.Value));
            }

            if (BrandName != String.Empty)
            {
                sb.Criteria.Add("BrandName=@brandName");
                sb.AddDataParameter("@brandName", BrandName);
            }

            if (UserStatusName != String.Empty)
            {
                sb.Criteria.Add("UserStatusName=@userStatusName");
                sb.AddDataParameter("@userStatusName", UserStatusName);
            }

            if (UserRoleName != String.Empty)
            {
                sb.Criteria.Add("UserRoleName=@userRoleName");
                sb.AddDataParameter("@userRoleName", UserRoleName);
            }

            SetCustomSearchCriteria(ref sb);
        }
        protected override void SetSearchCriteria(ref SearchBuilder sb)
        {
            if (BrandMetadataSettingIdList != null && BrandMetadataSettingIdList.Count > 0)
            {
                JoinableList list = new JoinableList(BrandMetadataSettingIdList);
                sb.Criteria.Add(string.Format("{0} IN (" + list + ")", BrandMetadataSetting.Columns.BrandMetadataSettingId));
            }

            if (BrandMetadataSettingId.HasValue)
            {
                sb.Criteria.Add(string.Format("{0}=@brandMetadataSettingId", BrandMetadataSetting.Columns.BrandMetadataSettingId));
                sb.AddDataParameter("@brandMetadataSettingId", BrandMetadataSettingId.Value);
            }

            if (BrandId != 0)
            {
                sb.Criteria.Add(string.Format("{0}=@brandId", BrandMetadataSetting.Columns.BrandId));
                sb.AddDataParameter("@brandId", BrandId);
            }

            if (FieldId != String.Empty)
            {
                sb.Criteria.Add(string.Format("{0}=@fieldId", BrandMetadataSetting.Columns.FieldId));
                sb.AddDataParameter("@fieldId", FieldId);
            }

            if (FieldName != String.Empty)
            {
                sb.Criteria.Add(string.Format("{0}=@fieldName", BrandMetadataSetting.Columns.FieldName));
                sb.AddDataParameter("@fieldName", FieldName);
            }

            if (IsRequired.HasValue)
            {
                sb.Criteria.Add(string.Format("{0}=@isRequired", BrandMetadataSetting.Columns.IsRequired));
                sb.AddDataParameter("@isRequired", SqlUtils.BitValue(IsRequired.Value));
            }

            if (OnAssetForm.HasValue)
            {
                sb.Criteria.Add(string.Format("{0}=@onAssetForm", BrandMetadataSetting.Columns.OnAssetForm));
                sb.AddDataParameter("@onAssetForm", SqlUtils.BitValue(OnAssetForm.Value));
            }

            if (OnAssetDetail.HasValue)
            {
                sb.Criteria.Add(string.Format("{0}=@onAssetDetail", BrandMetadataSetting.Columns.OnAssetDetail));
                sb.AddDataParameter("@onAssetDetail", SqlUtils.BitValue(OnAssetDetail.Value));
            }

            if (AdditionalCopy != String.Empty)
            {
                sb.Criteria.Add(string.Format("{0}=@additionalCopy", BrandMetadataSetting.Columns.AdditionalCopy));
                sb.AddDataParameter("@additionalCopy", AdditionalCopy);
            }

            if (ToolTip != String.Empty)
            {
                sb.Criteria.Add(string.Format("{0}=@toolTip", BrandMetadataSetting.Columns.ToolTip));
                sb.AddDataParameter("@toolTip", ToolTip);
            }

            if (AllowMultiple.HasValue)
            {
                sb.Criteria.Add(string.Format("{0}=@allowMultiple", BrandMetadataSetting.Columns.AllowMultiple));
                sb.AddDataParameter("@allowMultiple", SqlUtils.BitValue(AllowMultiple.Value));
            }

            if (IsCustom.HasValue)
            {
                sb.Criteria.Add(string.Format("{0}=@isCustom", BrandMetadataSetting.Columns.IsCustom));
                sb.AddDataParameter("@isCustom", SqlUtils.BitValue(IsCustom.Value));
            }

            if (UiControlType != 0)
            {
                sb.Criteria.Add(string.Format("{0}=@uiControlType", BrandMetadataSetting.Columns.UiControlType));
                sb.AddDataParameter("@uiControlType", UiControlType);
            }

            SetCustomSearchCriteria(ref sb);
        }
        protected override void SetSearchCriteria(ref SearchBuilder sb)
        {
            if (BrandIdList != null && BrandIdList.Count > 0)
            {
                JoinableList list = new JoinableList(BrandIdList);
                sb.Criteria.Add(string.Format("{0} IN (" + list + ")", Brand.Columns.BrandId));
            }

            if (BrandId.HasValue)
            {
                sb.Criteria.Add(string.Format("{0}=@brandId", Brand.Columns.BrandId));
                sb.AddDataParameter("@brandId", BrandId.Value);
            }

            if (Name != String.Empty)
            {
                sb.Criteria.Add(string.Format("{0}=@name", Brand.Columns.Name));
                sb.AddDataParameter("@name", Name);
            }

            if (ShortName != String.Empty)
            {
                sb.Criteria.Add(string.Format("{0}=@shortName", Brand.Columns.ShortName));
                sb.AddDataParameter("@shortName", ShortName);
            }

            if (ApplicationName != String.Empty)
            {
                sb.Criteria.Add(string.Format("{0}=@applicationName", Brand.Columns.ApplicationName));
                sb.AddDataParameter("@applicationName", ApplicationName);
            }

            if (OrganisationName != String.Empty)
            {
                sb.Criteria.Add(string.Format("{0}=@organisationName", Brand.Columns.OrganisationName));
                sb.AddDataParameter("@organisationName", OrganisationName);
            }

            if (IsMasterBrand.HasValue)
            {
                sb.Criteria.Add(string.Format("{0}=@isMasterBrand", Brand.Columns.IsMasterBrand));
                sb.AddDataParameter("@isMasterBrand", SqlUtils.BitValue(IsMasterBrand.Value));
            }

            if (WebsiteUrl != String.Empty)
            {
                sb.Criteria.Add(string.Format("{0}=@websiteUrl", Brand.Columns.WebsiteUrl));
                sb.AddDataParameter("@websiteUrl", WebsiteUrl);
            }

            if (EmailFrom != String.Empty)
            {
                sb.Criteria.Add(string.Format("{0}=@emailFrom", Brand.Columns.EmailFrom));
                sb.AddDataParameter("@emailFrom", EmailFrom);
            }

            if (IsBrandSelectionAllowed.HasValue)
            {
                sb.Criteria.Add(string.Format("{0}=@isBrandSelectionAllowed", Brand.Columns.IsBrandSelectionAllowed));
                sb.AddDataParameter("@isBrandSelectionAllowed", SqlUtils.BitValue(IsBrandSelectionAllowed.Value));
            }

            if (DisablePoweredByLogo.HasValue)
            {
                sb.Criteria.Add(string.Format("{0}=@disablePoweredByLogo", Brand.Columns.DisablePoweredByLogo));
                sb.AddDataParameter("@disablePoweredByLogo", SqlUtils.BitValue(DisablePoweredByLogo.Value));
            }

            if (LoginPageUpperCopy != String.Empty)
            {
                sb.Criteria.Add(string.Format("{0}=@loginPageUpperCopy", Brand.Columns.LoginPageUpperCopy));
                sb.AddDataParameter("@loginPageUpperCopy", LoginPageUpperCopy);
            }

            if (LoginPageLowerCopy != String.Empty)
            {
                sb.Criteria.Add(string.Format("{0}=@loginPageLowerCopy", Brand.Columns.LoginPageLowerCopy));
                sb.AddDataParameter("@loginPageLowerCopy", LoginPageLowerCopy);
            }

            if (DefaultUsageRestrictionsCopy != String.Empty)
            {
                sb.Criteria.Add(string.Format("{0}=@defaultUsageRestrictionsCopy", Brand.Columns.DefaultUsageRestrictionsCopy));
                sb.AddDataParameter("@defaultUsageRestrictionsCopy", DefaultUsageRestrictionsCopy);
            }

            if (MyAccountCopy != String.Empty)
            {
                sb.Criteria.Add(string.Format("{0}=@myAccountCopy", Brand.Columns.MyAccountCopy));
                sb.AddDataParameter("@myAccountCopy", MyAccountCopy);
            }

            if (AdminCopy != String.Empty)
            {
                sb.Criteria.Add(string.Format("{0}=@adminCopy", Brand.Columns.AdminCopy));
                sb.AddDataParameter("@adminCopy", AdminCopy);
            }

            if (TermsConditionsCopy != String.Empty)
            {
                sb.Criteria.Add(string.Format("{0}=@termsConditionsCopy", Brand.Columns.TermsConditionsCopy));
                sb.AddDataParameter("@termsConditionsCopy", TermsConditionsCopy);
            }

            if (PrivacyPolicyCopy != String.Empty)
            {
                sb.Criteria.Add(string.Format("{0}=@privacyPolicyCopy", Brand.Columns.PrivacyPolicyCopy));
                sb.AddDataParameter("@privacyPolicyCopy", PrivacyPolicyCopy);
            }

            if (HideFilterSearch.HasValue)
            {
                sb.Criteria.Add(string.Format("{0}=@hideFilterSearch", Brand.Columns.HideFilterSearch));
                sb.AddDataParameter("@hideFilterSearch", SqlUtils.BitValue(HideFilterSearch.Value));
            }

            if (HideCategorySearch.HasValue)
            {
                sb.Criteria.Add(string.Format("{0}=@hideCategorySearch", Brand.Columns.HideCategorySearch));
                sb.AddDataParameter("@hideCategorySearch", SqlUtils.BitValue(HideCategorySearch.Value));
            }

            if (DirectDownloadEnabled.HasValue)
            {
                sb.Criteria.Add(string.Format("{0}=@directDownloadEnabled", Brand.Columns.DirectDownloadEnabled));
                sb.AddDataParameter("@directDownloadEnabled", SqlUtils.BitValue(DirectDownloadEnabled.Value));
            }

            if (IsDeleted.HasValue)
            {
                sb.Criteria.Add(string.Format("{0}=@isDeleted", Brand.Columns.IsDeleted));
                sb.AddDataParameter("@isDeleted", SqlUtils.BitValue(IsDeleted.Value));
            }

            if (FilterMarkup != String.Empty)
            {
                sb.Criteria.Add(string.Format("{0}=@filterMarkup", Brand.Columns.FilterMarkup));
                sb.AddDataParameter("@filterMarkup", FilterMarkup);
            }

            SetCustomSearchCriteria(ref sb);
        }