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 (AssetFilePathIdList != null && AssetFilePathIdList.Count > 0) { JoinableList list = new JoinableList(AssetFilePathIdList); sb.Criteria.Add(string.Format("{0} IN (" + list + ")", AssetFilePath.Columns.AssetFilePathId)); } if (AssetFilePathId.HasValue) { sb.Criteria.Add(string.Format("{0}=@assetFilePathId", AssetFilePath.Columns.AssetFilePathId)); sb.AddDataParameter("@assetFilePathId", AssetFilePathId.Value); } if (Path != String.Empty) { sb.Criteria.Add(string.Format("{0}=@path", AssetFilePath.Columns.Path)); sb.AddDataParameter("@path", Path); } if (IsDefault.HasValue) { sb.Criteria.Add(string.Format("{0}=@isDefault", AssetFilePath.Columns.IsDefault)); sb.AddDataParameter("@isDefault", SqlUtils.BitValue(IsDefault.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 (LightboxIdList != null && LightboxIdList.Count > 0) { JoinableList list = new JoinableList(LightboxIdList); sb.Criteria.Add(string.Format("{0} IN (" + list + ")", Lightbox.Columns.LightboxId)); } if (LightboxId.HasValue) { sb.Criteria.Add(string.Format("{0}=@lightboxId", Lightbox.Columns.LightboxId)); sb.AddDataParameter("@lightboxId", LightboxId.Value); } if (UserId != 0) { sb.Criteria.Add(string.Format("{0}=@userId", Lightbox.Columns.UserId)); sb.AddDataParameter("@userId", UserId); } if (Name != String.Empty) { sb.Criteria.Add(string.Format("{0}=@name", Lightbox.Columns.Name)); sb.AddDataParameter("@name", Name); } if (Summary != String.Empty) { sb.Criteria.Add(string.Format("{0}=@summary", Lightbox.Columns.Summary)); sb.AddDataParameter("@summary", Summary); } if (Notes != String.Empty) { sb.Criteria.Add(string.Format("{0}=@notes", Lightbox.Columns.Notes)); sb.AddDataParameter("@notes", Notes); } if (IsPublic.HasValue) { sb.Criteria.Add(string.Format("{0}=@isPublic", Lightbox.Columns.IsPublic)); sb.AddDataParameter("@isPublic", SqlUtils.BitValue(IsPublic.Value)); } if (IsDefault.HasValue) { sb.Criteria.Add(string.Format("{0}=@isDefault", Lightbox.Columns.IsDefault)); sb.AddDataParameter("@isDefault", SqlUtils.BitValue(IsDefault.Value)); } if (CreateDate != DateTime.MinValue) { sb.Criteria.Add(string.Format("{0}=@createDate", Lightbox.Columns.CreateDate)); sb.AddDataParameter("@createDate", CreateDate); } 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 (CompanyIdList != null && CompanyIdList.Count > 0) { JoinableList list = new JoinableList(CompanyIdList); sb.Criteria.Add(string.Format("{0} IN (" + list + ")", Company.Columns.CompanyId)); } if (CompanyId.HasValue) { sb.Criteria.Add(string.Format("{0}=@companyId", Company.Columns.CompanyId)); sb.AddDataParameter("@companyId", CompanyId.Value); } if (Name != String.Empty) { sb.Criteria.Add(string.Format("{0}=@name", Company.Columns.Name)); sb.AddDataParameter("@name", Name); } if (Brands != String.Empty) { sb.Criteria.Add(string.Format("{0}=@brands", Company.Columns.Brands)); sb.AddDataParameter("@brands", Brands); } if (Domain != String.Empty) { sb.Criteria.Add(string.Format("{0}=@domain", Company.Columns.Domain)); sb.AddDataParameter("@domain", Domain); } if (IsInternal.HasValue) { sb.Criteria.Add(string.Format("{0}=@isInternal", Company.Columns.IsInternal)); sb.AddDataParameter("@isInternal", SqlUtils.BitValue(IsInternal.Value)); } if (CreatedByUserId != 0) { sb.Criteria.Add(string.Format("{0}=@createdByUserId", Company.Columns.CreatedByUserId)); sb.AddDataParameter("@createdByUserId", CreatedByUserId); } if (CreateDate != DateTime.MinValue) { sb.Criteria.Add(string.Format("{0}=@createDate", Company.Columns.CreateDate)); sb.AddDataParameter("@createDate", CreateDate); } 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); }
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 (AssetWorkflowIdList != null && AssetWorkflowIdList.Count > 0) { JoinableList list = new JoinableList(AssetWorkflowIdList); sb.Criteria.Add(string.Format("{0} IN (" + list + ")", AssetWorkflow.Columns.AssetWorkflowId)); } if (AssetWorkflowId.HasValue) { sb.Criteria.Add(string.Format("{0}=@assetWorkflowId", AssetWorkflow.Columns.AssetWorkflowId)); sb.AddDataParameter("@assetWorkflowId", AssetWorkflowId.Value); } if (AssetId != 0) { sb.Criteria.Add(string.Format("{0}=@assetId", AssetWorkflow.Columns.AssetId)); sb.AddDataParameter("@assetId", AssetId); } if (SubmittedByUserId != 0) { sb.Criteria.Add(string.Format("{0}=@submittedByUserId", AssetWorkflow.Columns.SubmittedByUserId)); sb.AddDataParameter("@submittedByUserId", SubmittedByUserId); } if (CreateDate != DateTime.MinValue) { sb.Criteria.Add(string.Format("{0}=@createDate", AssetWorkflow.Columns.CreateDate)); sb.AddDataParameter("@createDate", CreateDate); } if (IsComplete.HasValue) { sb.Criteria.Add(string.Format("{0}=@isComplete", AssetWorkflow.Columns.IsComplete)); sb.AddDataParameter("@isComplete", SqlUtils.BitValue(IsComplete.Value)); } 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); }
protected override void SetSearchCriteria(ref SearchBuilder sb) { if (AssetWorkflowUserIdList != null && AssetWorkflowUserIdList.Count > 0) { JoinableList list = new JoinableList(AssetWorkflowUserIdList); sb.Criteria.Add(string.Format("{0} IN (" + list + ")", AssetWorkflowUser.Columns.AssetWorkflowUserId)); } if (AssetWorkflowUserId.HasValue) { sb.Criteria.Add(string.Format("{0}=@assetWorkflowUserId", AssetWorkflowUser.Columns.AssetWorkflowUserId)); sb.AddDataParameter("@assetWorkflowUserId", AssetWorkflowUserId.Value); } if (AssetWorkflowId != 0) { sb.Criteria.Add(string.Format("{0}=@assetWorkflowId", AssetWorkflowUser.Columns.AssetWorkflowId)); sb.AddDataParameter("@assetWorkflowId", AssetWorkflowId); } if (UserId != 0) { sb.Criteria.Add(string.Format("{0}=@userId", AssetWorkflowUser.Columns.UserId)); sb.AddDataParameter("@userId", UserId); } if (Position != 0) { sb.Criteria.Add(string.Format("{0}=@position", AssetWorkflowUser.Columns.Position)); sb.AddDataParameter("@position", Position); } if (Comments != String.Empty) { sb.Criteria.Add(string.Format("{0}=@comments", AssetWorkflowUser.Columns.Comments)); sb.AddDataParameter("@comments", Comments); } if (AssetWorkflowUserStatusId != 0) { sb.Criteria.Add(string.Format("{0}=@assetWorkflowUserStatusId", AssetWorkflowUser.Columns.AssetWorkflowUserStatusId)); sb.AddDataParameter("@assetWorkflowUserStatusId", AssetWorkflowUserStatusId); } if (CreateDate != DateTime.MinValue) { sb.Criteria.Add(string.Format("{0}=@createDate", AssetWorkflowUser.Columns.CreateDate)); sb.AddDataParameter("@createDate", CreateDate); } if (LastUpdate != DateTime.MinValue) { sb.Criteria.Add(string.Format("{0}=@lastUpdate", AssetWorkflowUser.Columns.LastUpdate)); sb.AddDataParameter("@lastUpdate", LastUpdate); } if (IsDeleted.HasValue) { sb.Criteria.Add(string.Format("{0}=@isDeleted", AssetWorkflowUser.Columns.IsDeleted)); sb.AddDataParameter("@isDeleted", SqlUtils.BitValue(IsDeleted.Value)); } SetCustomSearchCriteria(ref sb); }
protected override void SetSearchCriteria(ref SearchBuilder sb) { if (HomepageIdList != null && HomepageIdList.Count > 0) { JoinableList list = new JoinableList(HomepageIdList); sb.Criteria.Add(string.Format("{0} IN (" + list + ")", Homepage.Columns.HomepageId)); } if (HomepageId.HasValue) { sb.Criteria.Add(string.Format("{0}=@homepageId", Homepage.Columns.HomepageId)); sb.AddDataParameter("@homepageId", HomepageId.Value); } if (BrandId != 0) { sb.Criteria.Add(string.Format("{0}=@brandId", Homepage.Columns.BrandId)); sb.AddDataParameter("@brandId", BrandId); } if (IntroText != String.Empty) { sb.Criteria.Add(string.Format("{0}=@introText", Homepage.Columns.IntroText)); sb.AddDataParameter("@introText", IntroText); } if (Url1 != String.Empty) { sb.Criteria.Add(string.Format("{0}=@url1", Homepage.Columns.Url1)); sb.AddDataParameter("@url1", Url1); } if (Url2 != String.Empty) { sb.Criteria.Add(string.Format("{0}=@url2", Homepage.Columns.Url2)); sb.AddDataParameter("@url2", Url2); } if (Url3 != String.Empty) { sb.Criteria.Add(string.Format("{0}=@url3", Homepage.Columns.Url3)); sb.AddDataParameter("@url3", Url3); } if (Url4 != String.Empty) { sb.Criteria.Add(string.Format("{0}=@url4", Homepage.Columns.Url4)); sb.AddDataParameter("@url4", Url4); } if (BumperPageHtml != String.Empty) { sb.Criteria.Add(string.Format("{0}=@bumperPageHtml", Homepage.Columns.BumperPageHtml)); sb.AddDataParameter("@bumperPageHtml", BumperPageHtml); } if (BumperPageSkip.HasValue) { sb.Criteria.Add(string.Format("{0}=@bumperPageSkip", Homepage.Columns.BumperPageSkip)); sb.AddDataParameter("@bumperPageSkip", SqlUtils.BitValue(BumperPageSkip.Value)); } if (CustomHtml != String.Empty) { sb.Criteria.Add(string.Format("{0}=@customHtml", Homepage.Columns.CustomHtml)); sb.AddDataParameter("@customHtml", CustomHtml); } if (HomepageTypeId != 0) { sb.Criteria.Add(string.Format("{0}=@homepageTypeId", Homepage.Columns.HomepageTypeId)); sb.AddDataParameter("@homepageTypeId", HomepageTypeId); } if (IsPublished.HasValue) { sb.Criteria.Add(string.Format("{0}=@isPublished", Homepage.Columns.IsPublished)); sb.AddDataParameter("@isPublished", SqlUtils.BitValue(IsPublished.Value)); } if (LastModifiedByUserId != 0) { sb.Criteria.Add(string.Format("{0}=@lastModifiedByUserId", Homepage.Columns.LastModifiedByUserId)); sb.AddDataParameter("@lastModifiedByUserId", LastModifiedByUserId); } if (LastModifiedDate != DateTime.MinValue) { sb.Criteria.Add(string.Format("{0}=@lastModifiedDate", Homepage.Columns.LastModifiedDate)); sb.AddDataParameter("@lastModifiedDate", LastModifiedDate); } if (BrandName != String.Empty) { sb.Criteria.Add("BrandName=@brandName"); sb.AddDataParameter("@brandName", BrandName); } SetCustomSearchCriteria(ref sb); }
protected override void SetSearchCriteria(ref SearchBuilder sb) { if (LightboxSentIdList != null && LightboxSentIdList.Count > 0) { JoinableList list = new JoinableList(LightboxSentIdList); sb.Criteria.Add(string.Format("{0} IN (" + list + ")", LightboxSent.Columns.LightboxSentId)); } if (LightboxSentId.HasValue) { sb.Criteria.Add(string.Format("{0}=@lightboxSentId", LightboxSent.Columns.LightboxSentId)); sb.AddDataParameter("@lightboxSentId", LightboxSentId.Value); } if (LightboxId != 0) { sb.Criteria.Add(string.Format("{0}=@lightboxId", LightboxSent.Columns.LightboxId)); sb.AddDataParameter("@lightboxId", LightboxId); } if (CreatedLightboxId != null) { sb.Criteria.Add(string.Format("{0}=@createdLightboxId", LightboxSent.Columns.CreatedLightboxId)); sb.AddDataParameter("@createdLightboxId", CreatedLightboxId.Value); } if (SenderId != 0) { sb.Criteria.Add(string.Format("{0}=@senderId", LightboxSent.Columns.SenderId)); sb.AddDataParameter("@senderId", SenderId); } if (RecipientEmail != String.Empty) { sb.Criteria.Add(string.Format("{0}=@recipientEmail", LightboxSent.Columns.RecipientEmail)); sb.AddDataParameter("@recipientEmail", RecipientEmail); } if (Subject != String.Empty) { sb.Criteria.Add(string.Format("{0}=@subject", LightboxSent.Columns.Subject)); sb.AddDataParameter("@subject", Subject); } if (Message != String.Empty) { sb.Criteria.Add(string.Format("{0}=@message", LightboxSent.Columns.Message)); sb.AddDataParameter("@message", Message); } if (DateSent != DateTime.MinValue) { sb.Criteria.Add(string.Format("{0}=@dateSent", LightboxSent.Columns.DateSent)); sb.AddDataParameter("@dateSent", DateSent); } if (ExpiryDate != null) { sb.Criteria.Add(string.Format("{0}=@expiryDate", LightboxSent.Columns.ExpiryDate)); sb.AddDataParameter("@expiryDate", ExpiryDate.Value); } if (DownloadLinks.HasValue) { sb.Criteria.Add(string.Format("{0}=@downloadLinks", LightboxSent.Columns.DownloadLinks)); sb.AddDataParameter("@downloadLinks", SqlUtils.BitValue(DownloadLinks.Value)); } if (LightboxLinkedId != null) { sb.Criteria.Add(string.Format("{0}=@lightboxLinkedId", LightboxSent.Columns.LightboxLinkedId)); sb.AddDataParameter("@lightboxLinkedId", LightboxLinkedId.Value); } SetCustomSearchCriteria(ref sb); }
private void SetCustomSearchCriteria(ref SearchBuilder sb) { sb.Table = "[v_Asset]"; if (AuditAssetHistoryFinder != null) { AuditAssetHistoryFinder.OnlyDistinctAssetIds = true; sb.Criteria.Add(sb.TableAlias + ".AssetId IN (" + AuditAssetHistoryFinder.FindQuery + ")"); } if (Orientation != Orientation.All) { string sql = string.Empty; switch (Orientation) { case (Orientation.Portrait): sql = string.Format("[Height] > [Width]"); break; case (Orientation.Landscape): sql = string.Format("[Height] < [Width]"); break; case (Orientation.Square): sql = string.Format("[Height] = [Width]"); break; } if (sql != string.Empty) { sb.Criteria.Add(string.Format("({0})", sql)); } } if (GeneralKeyword != string.Empty) { if (FullTextSearchedEnabled) { UserQueryParser uq = new UserQueryParser(); bool isValid = uq.ParseTokens(GeneralKeyword); if (isValid) { string query = uq.GetSqlQuery(); SetFullTextSearchCriteria(sb, query); } else { string error = string.Format("Error parsing user query: \"{0}\" - {1}", GeneralKeyword, uq.Error); Debug.WriteLine(error); } } else { JoinableList jList = GetStandardSectorSearchSql(); sb.Criteria.Add(string.Format("({0})", jList)); } } if (IsBeforePublicationDate) { sb.Criteria.Add(string.Format("({0} > getdate())", Asset.Columns.PublishDate)); } if (IsExpired.HasValue) { sb.Criteria.Add("dbo.IsExpired(" + sb.TableAlias + ".ExpiryDate) = @isExpired"); sb.AddDataParameter("@isExpired", SqlUtils.BitValue(IsExpired.GetValueOrDefault())); } if (!ExpiryDateRange.IsNull) { const string dateFormat = "dd MMMM yyyy HH:mm:ss"; if (ExpiryDateRange.StartDate.HasValue && ExpiryDateRange.EndDate.HasValue) { sb.Criteria.Add(string.Format("({0} BETWEEN '{1}' AND '{2}')", Asset.Columns.ExpiryDate, ExpiryDateRange.StartDate.Value.ToString(dateFormat), ExpiryDateRange.EndDate.Value.ToString(dateFormat))); } else { if (ExpiryDateRange.StartDate.HasValue) { sb.Criteria.Add(string.Format("({0} >= '{1}')", Asset.Columns.ExpiryDate, ExpiryDateRange.StartDate.Value.ToString(dateFormat))); } if (ExpiryDateRange.EndDate.HasValue) { sb.Criteria.Add(string.Format("({0} <= '{1}')", Asset.Columns.ExpiryDate, ExpiryDateRange.EndDate.Value.ToString(dateFormat))); } } } foreach (ComplexCriteria cc in m_ComplexCriteria) { string operand; switch (cc.CompareType) { case (CompareType.LessThan): operand = "<"; break; case (CompareType.MoreThan): operand = ">"; break; default: operand = "="; break; } sb.Criteria.Add(string.Format("({0} {1} {2})", cc.Field, operand, cc.Value)); } if (IsCompletelyPublished) { // Entire clause JoinableList jList1 = new JoinableList(" OR "); // Currently published JoinableList jList2 = new JoinableList(" AND "); jList2.Add(string.Format("{0} = {1}", Asset.Columns.AssetPublishStatusId, Convert.ToInt32(AssetPublishStatus.Published))); jList2.Add(string.Format("{0} < getdate()", Asset.Columns.PublishDate)); jList2.Add(string.Format("{0} > getdate()", Asset.Columns.ExpiryDate)); // Add to entire clause jList1.Add(jList2); // If unpublished and expired assets need to be displayed too, we need to expand this criteria as follows: // 1. All admin users should see their own assets // 2. Brand admins should see assets in their primary brand // 3. Super admins should see all assets if (IncludeUnpublishedExpiredAssets) { JoinableList jList3 = new JoinableList(" OR "); if (IncludeUnpublishedExpiredAssets_UserId > 0) { jList3.Add(string.Format("({0}={1})", Asset.Columns.UploadedByUserId, IncludeUnpublishedExpiredAssets_UserId)); } if (IncludeUnpublishedExpiredAssets_BrandId > 0) { jList3.Add(string.Format("({0}={1})", Asset.Columns.BrandId, IncludeUnpublishedExpiredAssets_BrandId)); } if (jList3.Count > 0) { jList1.Add(jList3); } } string criteria = jList1.ToString(); if (!StringUtils.IsBlank(criteria)) { sb.Criteria.Add(string.Format("({0})", criteria)); } } if (IsPublished.HasValue) { string op = (IsPublished.Value) ? " = " : " <> "; sb.Criteria.Add(string.Concat(Asset.Columns.AssetPublishStatusId, op, Convert.ToInt32(AssetPublishStatus.Published))); } if (BrandIdList.Count > 0) { JoinableList jList = new JoinableList(BrandIdList); sb.Criteria.Add(string.Format("BrandId IN ({0})", jList)); } // Production date filter SetProductionMonthDayCriteria(sb); // Metadata filters AddMetadataCriteria(sb); // Category filters AddManyToManyCriteria(sb, "AssetCategory", "CategoryId", CategoryIdList); // Setup results ordering AddOrderByClause(); Debug.WriteLine(string.Format("AssetFinder: {0}", sb.GetFullQuery())); }
protected override void SetSearchCriteria(ref SearchBuilder sb) { if (AssetCategoryIdList != null && AssetCategoryIdList.Count > 0) { JoinableList list = new JoinableList(AssetCategoryIdList); sb.Criteria.Add(string.Format("{0} IN (" + list + ")", AssetCategory.Columns.AssetCategoryId)); } if (AssetCategoryId.HasValue) { sb.Criteria.Add(string.Format("{0}=@assetCategoryId", AssetCategory.Columns.AssetCategoryId)); sb.AddDataParameter("@assetCategoryId", AssetCategoryId.Value); } if (AssetId != 0) { sb.Criteria.Add(string.Format("{0}=@assetId", AssetCategory.Columns.AssetId)); sb.AddDataParameter("@assetId", AssetId); } if (CategoryId != 0) { sb.Criteria.Add(string.Format("{0}=@categoryId", AssetCategory.Columns.CategoryId)); sb.AddDataParameter("@categoryId", CategoryId); } if (IsPrimary.HasValue) { sb.Criteria.Add(string.Format("{0}=@isPrimary", AssetCategory.Columns.IsPrimary)); sb.AddDataParameter("@isPrimary", SqlUtils.BitValue(IsPrimary.Value)); } if (Name != String.Empty) { sb.Criteria.Add("Name=@name"); sb.AddDataParameter("@name", Name); } if (ParentCategoryId.HasValue) { if (ParentCategoryId.Value == 0) { sb.Criteria.Add("ParentCategoryId IS NULL"); } else { sb.Criteria.Add("ParentCategoryId=@parentCategoryId"); sb.AddDataParameter("@parentCategoryId", ParentCategoryId.Value); } } if (Synonyms != String.Empty) { sb.Criteria.Add("Synonyms=@synonyms"); sb.AddDataParameter("@synonyms", Synonyms); } if (CategoryOrder.HasValue) { if (CategoryOrder.Value == 0) { sb.Criteria.Add("CategoryOrder IS NULL"); } else { sb.Criteria.Add("CategoryOrder=@categoryOrder"); sb.AddDataParameter("@categoryOrder", CategoryOrder.Value); } } if (NameAndSynonyms != String.Empty) { sb.Criteria.Add("NameAndSynonyms=@nameAndSynonyms"); sb.AddDataParameter("@nameAndSynonyms", NameAndSynonyms); } SetCustomSearchCriteria(ref sb); }
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 (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 (OrderIdList != null && OrderIdList.Count > 0) { JoinableList list = new JoinableList(OrderIdList); sb.Criteria.Add(string.Format("{0} IN (" + list + ")", Order.Columns.OrderId)); } if (OrderId.HasValue) { sb.Criteria.Add(string.Format("{0}=@orderId", Order.Columns.OrderId)); sb.AddDataParameter("@orderId", OrderId.Value); } if (UserId != 0) { sb.Criteria.Add(string.Format("{0}=@userId", Order.Columns.UserId)); sb.AddDataParameter("@userId", UserId); } if (OrderDate != DateTime.MinValue) { sb.Criteria.Add(string.Format("{0}=@orderDate", Order.Columns.OrderDate)); sb.AddDataParameter("@orderDate", OrderDate); } if (CompletionDate != null) { sb.Criteria.Add(string.Format("{0}=@completionDate", Order.Columns.CompletionDate)); sb.AddDataParameter("@completionDate", CompletionDate.Value); } if (UserName != String.Empty) { sb.Criteria.Add("UserName=@userName"); sb.AddDataParameter("@userName", UserName); } if (UserEmail != String.Empty) { sb.Criteria.Add("UserEmail=@userEmail"); sb.AddDataParameter("@userEmail", UserEmail); } if (UserPrimaryBrandId.HasValue) { if (UserPrimaryBrandId.Value == 0) { sb.Criteria.Add("UserPrimaryBrandId IS NULL"); } else { sb.Criteria.Add("UserPrimaryBrandId=@userPrimaryBrandId"); sb.AddDataParameter("@userPrimaryBrandId", UserPrimaryBrandId.Value); } } if (UserPrimaryBrandName != String.Empty) { sb.Criteria.Add("UserPrimaryBrandName=@userPrimaryBrandName"); sb.AddDataParameter("@userPrimaryBrandName", UserPrimaryBrandName); } if (AssetCount.HasValue) { if (AssetCount.Value == 0) { sb.Criteria.Add("AssetCount IS NULL"); } else { sb.Criteria.Add("AssetCount=@assetCount"); sb.AddDataParameter("@assetCount", AssetCount.Value); } } if (IsPending.HasValue) { sb.Criteria.Add("IsPending=@isPending"); sb.AddDataParameter("@isPending", SqlUtils.BitValue(IsPending.Value)); } if (DeadlineDate != null) { sb.Criteria.Add("DeadlineDate=@deadlineDate"); sb.AddDataParameter("@deadlineDate", DeadlineDate.Value); } 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); }