internal static void SaveUploadedAssetListToCurrentUser() { // Create new list to hold asset ID's List <Int32> list = new List <Int32>(); // Strip out duplicates foreach (int i in SessionInfo.Current.AdminSessionInfo.UploadedAssetsList) { if (!list.Contains(i)) { list.Add(i); } } // Convert into comma-delimited string JoinableList jList = new JoinableList(list, ","); // Update session SessionInfo.Current.User.CatalogueAssetIdList = jList.ToString(); SessionInfo.Current.AdminSessionInfo.UploadedAssetsList.Clear(); SessionInfo.Current.AdminSessionInfo.UploadedAssetsList.AddRange(list); // Save the user User.Update(SessionInfo.Current.User); }
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 (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); }
protected override void SetSearchCriteria(ref SearchBuilder sb) { if (AuditAssetSearchResultIdList != null && AuditAssetSearchResultIdList.Count > 0) { JoinableList list = new JoinableList(AuditAssetSearchResultIdList); sb.Criteria.Add(string.Format("{0} IN (" + list + ")", AuditAssetSearchResult.Columns.AuditAssetSearchResultId)); } if (AuditAssetSearchResultId.HasValue) { sb.Criteria.Add(string.Format("{0}=@auditAssetSearchResultId", AuditAssetSearchResult.Columns.AuditAssetSearchResultId)); sb.AddDataParameter("@auditAssetSearchResultId", AuditAssetSearchResultId.Value); } if (AuditAssetSearchId != 0) { sb.Criteria.Add(string.Format("{0}=@auditAssetSearchId", AuditAssetSearchResult.Columns.AuditAssetSearchId)); sb.AddDataParameter("@auditAssetSearchId", AuditAssetSearchId); } if (AssetId != 0) { sb.Criteria.Add(string.Format("{0}=@assetId", AuditAssetSearchResult.Columns.AssetId)); sb.AddDataParameter("@assetId", AssetId); } if (Date != DateTime.MinValue) { sb.Criteria.Add(string.Format("{0}=@date", AuditAssetSearchResult.Columns.Date)); sb.AddDataParameter("@date", Date); } SetCustomSearchCriteria(ref sb); }
/// <summary> /// Sends the email message /// </summary> public static void SendMessage(Email email) { JoinableList jList = new JoinableList(); foreach (string recipient in email.Recipients) { jList.Add(recipient + " (TO)"); } foreach (string recipient in email.CC) { jList.Add(recipient + " (CC)"); } foreach (string recipient in email.BCC) { jList.Add(recipient + " (BCC)"); } try { email.Send(); m_Logger.DebugFormat("Sent email message with subject '{0}' to '{1}', using template: {2}", email.Subject, jList, email.TemplateFilename); } catch (Exception ex) { m_Logger.Error(string.Format("Error sending email message with subject '{0}' to '{1}', using template: {2}", email.Subject, jList, email.TemplateFilename), ex); throw; } }
protected override void SetSearchCriteria(ref SearchBuilder sb) { if (HomepageTypeIdList != null && HomepageTypeIdList.Count > 0) { JoinableList list = new JoinableList(HomepageTypeIdList); sb.Criteria.Add(string.Format("{0} IN (" + list + ")", HomepageType.Columns.HomepageTypeId)); } if (HomepageTypeId.HasValue) { sb.Criteria.Add(string.Format("{0}=@homepageTypeId", HomepageType.Columns.HomepageTypeId)); sb.AddDataParameter("@homepageTypeId", HomepageTypeId.Value); } if (Description != String.Empty) { sb.Criteria.Add(string.Format("{0}=@description", HomepageType.Columns.Description)); sb.AddDataParameter("@description", Description); } if (ShortName != String.Empty) { sb.Criteria.Add(string.Format("{0}=@shortName", HomepageType.Columns.ShortName)); sb.AddDataParameter("@shortName", ShortName); } SetCustomSearchCriteria(ref sb); }
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 (AssetLinkIdList != null && AssetLinkIdList.Count > 0) { JoinableList list = new JoinableList(AssetLinkIdList); sb.Criteria.Add(string.Format("{0} IN (" + list + ")", AssetLink.Columns.AssetLinkId)); } if (AssetLinkId.HasValue) { sb.Criteria.Add(string.Format("{0}=@assetLinkId", AssetLink.Columns.AssetLinkId)); sb.AddDataParameter("@assetLinkId", AssetLinkId.Value); } if (AssetId != 0) { sb.Criteria.Add(string.Format("{0}=@assetId", AssetLink.Columns.AssetId)); sb.AddDataParameter("@assetId", AssetId); } if (LinkedAssetId != 0) { sb.Criteria.Add(string.Format("{0}=@linkedAssetId", AssetLink.Columns.LinkedAssetId)); sb.AddDataParameter("@linkedAssetId", LinkedAssetId); } if (LinkedAssetTitle != String.Empty) { sb.Criteria.Add("LinkedAssetTitle=@linkedAssetTitle"); sb.AddDataParameter("@linkedAssetTitle", LinkedAssetTitle); } 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); }
public static Company Update(Company company) { if (company.BrandListLoaded) { JoinableList jList = new JoinableList(); company.BrandList.ForEach(b => jList.Add(b.Name)); company.Brands = jList.ToString(); } CompanyMapper.Instance.Update(company); if (company.BrandListLoaded) { CompanyBrandMapper.Instance.DeleteBrands(company.CompanyId); foreach (Brand brand in company.BrandList) { CompanyBrand cb = CompanyBrand.New(); cb.CompanyId = company.CompanyId.GetValueOrDefault(); cb.BrandId = brand.BrandId.GetValueOrDefault(); CompanyBrand.Update(cb); } } return(company); }
protected override void SetSearchCriteria(ref SearchBuilder sb) { if (CountryIdList != null && CountryIdList.Count > 0) { JoinableList list = new JoinableList(CountryIdList); sb.Criteria.Add(string.Format("{0} IN (" + list + ")", Country.Columns.CountryId)); } if (CountryId.HasValue) { sb.Criteria.Add(string.Format("{0}=@countryId", Country.Columns.CountryId)); sb.AddDataParameter("@countryId", CountryId.Value); } if (Code != String.Empty) { sb.Criteria.Add(string.Format("{0}=@code", Country.Columns.Code)); sb.AddDataParameter("@code", Code); } if (Name != String.Empty) { sb.Criteria.Add(string.Format("{0}=@name", Country.Columns.Name)); sb.AddDataParameter("@name", Name); } if (Rank != 0) { sb.Criteria.Add(string.Format("{0}=@rank", Country.Columns.Rank)); sb.AddDataParameter("@rank", Rank); } SetCustomSearchCriteria(ref sb); }
private JoinableList GetStandardSectorSearchSql() { JoinableList jList = new JoinableList(" OR "); string[] keywords = GeneralKeyword.ToLower().Split(' '); foreach (string field in m_StandardFields) { JoinableList jList2 = new JoinableList(" AND "); foreach (string keyword in keywords) { if (!UserQueryParser.NoiseWords.Contains(keyword)) { string text = keyword.Replace("'", "''"); if (text.StartsWith("*")) { text = text.Substring(1); } if (text.EndsWith("*")) { text = text.Substring(0, text.Length - 1); } jList2.Add(string.Format("({0} LIKE '%{1}%')", field, text)); } } jList.Add(jList2); } return(jList); }
protected void SetCustomSearchCriteria(ref SearchBuilder sb) { if (OffSet > 0) { StringBuilder subquery = new StringBuilder(); subquery.AppendFormat("{0} NOT IN (", LightboxAsset.Columns.LightboxAssetId); subquery.AppendFormat("SELECT TOP {0} {1} FROM {2}", OffSet, LightboxAsset.Columns.LightboxAssetId, sb.Table); if (sb.Criteria.Count > 0) { JoinableList jList = new JoinableList(sb.Criteria, " AND "); subquery.AppendFormat(" WHERE {0}", jList); } if (SortExpressions.Count > 0) { JoinableList jList = new JoinableList(SortExpressions); subquery.AppendFormat(" ORDER BY {0}", jList); } subquery.Append(")"); sb.Criteria.Add(subquery.ToString()); } }
protected override void SetSearchCriteria(ref SearchBuilder sb) { if (CompanyBrandIdList != null && CompanyBrandIdList.Count > 0) { JoinableList list = new JoinableList(CompanyBrandIdList); sb.Criteria.Add(string.Format("{0} IN (" + list + ")", CompanyBrand.Columns.CompanyBrandId)); } if (CompanyBrandId.HasValue) { sb.Criteria.Add(string.Format("{0}=@companyBrandId", CompanyBrand.Columns.CompanyBrandId)); sb.AddDataParameter("@companyBrandId", CompanyBrandId.Value); } if (CompanyId != 0) { sb.Criteria.Add(string.Format("{0}=@companyId", CompanyBrand.Columns.CompanyId)); sb.AddDataParameter("@companyId", CompanyId); } if (BrandId != 0) { sb.Criteria.Add(string.Format("{0}=@brandId", CompanyBrand.Columns.BrandId)); sb.AddDataParameter("@brandId", BrandId); } SetCustomSearchCriteria(ref sb); }
protected override void SetSearchCriteria(ref SearchBuilder sb) { if (UserPasswordHistoryIdList != null && UserPasswordHistoryIdList.Count > 0) { JoinableList list = new JoinableList(UserPasswordHistoryIdList); sb.Criteria.Add(string.Format("{0} IN (" + list + ")", UserPasswordHistory.Columns.UserPasswordHistoryId)); } if (UserPasswordHistoryId.HasValue) { sb.Criteria.Add(string.Format("{0}=@userPasswordHistoryId", UserPasswordHistory.Columns.UserPasswordHistoryId)); sb.AddDataParameter("@userPasswordHistoryId", UserPasswordHistoryId.Value); } if (UserId != 0) { sb.Criteria.Add(string.Format("{0}=@userId", UserPasswordHistory.Columns.UserId)); sb.AddDataParameter("@userId", UserId); } if (Password != String.Empty) { sb.Criteria.Add(string.Format("{0}=@password", UserPasswordHistory.Columns.Password)); sb.AddDataParameter("@password", Password); } if (Date != DateTime.MinValue) { sb.Criteria.Add(string.Format("{0}=@date", UserPasswordHistory.Columns.Date)); sb.AddDataParameter("@date", Date); } SetCustomSearchCriteria(ref sb); }
protected void MimeTypesDataGrid_ItemDataBound(object sender, DataGridItemEventArgs e) { switch (e.Item.ItemType) { case (ListItemType.Item): case (ListItemType.AlternatingItem): MimeTypeManager.MimeType mimeType = (MimeTypeManager.MimeType)e.Item.DataItem; Label MimeTypeNameLabel = (Label)e.Item.FindControl("MimeTypeNameLabel"); Label FileExtensionsLabel = (Label)e.Item.FindControl("FileExtensionsLabel"); MimeTypeNameLabel.Text = mimeType.ContentType; JoinableList jList = new JoinableList(", "); foreach (string fileExt in mimeType.FileExtensions) { jList.Add(fileExt); } FileExtensionsLabel.Text = jList.ToString(); break; } }
protected override void SetSearchCriteria(ref SearchBuilder sb) { if (AuditAssetSearchKeywordIdList != null && AuditAssetSearchKeywordIdList.Count > 0) { JoinableList list = new JoinableList(AuditAssetSearchKeywordIdList); sb.Criteria.Add(string.Format("{0} IN (" + list + ")", AuditAssetSearchKeyword.Columns.AuditAssetSearchKeywordId)); } if (AuditAssetSearchKeywordId.HasValue) { sb.Criteria.Add(string.Format("{0}=@auditAssetSearchKeywordId", AuditAssetSearchKeyword.Columns.AuditAssetSearchKeywordId)); sb.AddDataParameter("@auditAssetSearchKeywordId", AuditAssetSearchKeywordId.Value); } if (AuditAssetSearchId != 0) { sb.Criteria.Add(string.Format("{0}=@auditAssetSearchId", AuditAssetSearchKeyword.Columns.AuditAssetSearchId)); sb.AddDataParameter("@auditAssetSearchId", AuditAssetSearchId); } if (SearchKeyword != String.Empty) { sb.Criteria.Add(string.Format("{0}=@searchKeyword", AuditAssetSearchKeyword.Columns.SearchKeyword)); sb.AddDataParameter("@searchKeyword", SearchKeyword); } SetCustomSearchCriteria(ref sb); }
protected override void SetSearchCriteria(ref SearchBuilder sb) { if (HomepageCategoryIdList != null && HomepageCategoryIdList.Count > 0) { JoinableList list = new JoinableList(HomepageCategoryIdList); sb.Criteria.Add(string.Format("{0} IN (" + list + ")", HomepageCategory.Columns.HomepageCategoryId)); } if (HomepageCategoryId.HasValue) { sb.Criteria.Add(string.Format("{0}=@homepageCategoryId", HomepageCategory.Columns.HomepageCategoryId)); sb.AddDataParameter("@homepageCategoryId", HomepageCategoryId.Value); } if (HomepageId != 0) { sb.Criteria.Add(string.Format("{0}=@homepageId", HomepageCategory.Columns.HomepageId)); sb.AddDataParameter("@homepageId", HomepageId); } if (CategoryId != 0) { sb.Criteria.Add(string.Format("{0}=@categoryId", HomepageCategory.Columns.CategoryId)); sb.AddDataParameter("@categoryId", CategoryId); } if (OrderBy != 0) { sb.Criteria.Add(string.Format("{0}=@orderBy", HomepageCategory.Columns.OrderBy)); sb.AddDataParameter("@orderBy", OrderBy); } 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 (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); }
public SearchBuilder() { Table = string.Empty; TableAlias = "BASE"; SortExpressions = new JoinableList(); Criteria = new JoinableList(" AND ", new BracketingTextExtractor()); Parameters = new Dictionary <string, IDbDataParameter>(); Joins = new JoinableList(" "); Fields = new JoinableList(); MaxRecords = 0; }
private static void AddManyToManyCriteria(SearchBuilder sb, string table, string field, IList list) { if (list.Count <= 0) { return; } JoinableList jList = new JoinableList(list); string sql = string.Format("({0}.AssetId IN (SELECT AssetId FROM {1} RT WHERE RT.{2} IN ({3})))", sb.TableAlias, table, field, jList); sb.Criteria.Add(sql); }
protected override void SetSearchCriteria(ref SearchBuilder sb) { if (AssetFileIdList != null && AssetFileIdList.Count > 0) { JoinableList list = new JoinableList(AssetFileIdList); sb.Criteria.Add(string.Format("{0} IN (" + list + ")", AssetFile.Columns.AssetFileId)); } if (AssetFileId.HasValue) { sb.Criteria.Add(string.Format("{0}=@assetFileId", AssetFile.Columns.AssetFileId)); sb.AddDataParameter("@assetFileId", AssetFileId.Value); } if (AssetId != 0) { sb.Criteria.Add(string.Format("{0}=@assetId", AssetFile.Columns.AssetId)); sb.AddDataParameter("@assetId", AssetId); } if (FileContent != null) { sb.Criteria.Add(string.Format("{0}=@fileContent", AssetFile.Columns.FileContent)); sb.AddDataParameter("@fileContent", FileContent); } if (Filename != String.Empty) { sb.Criteria.Add(string.Format("{0}=@filename", AssetFile.Columns.Filename)); sb.AddDataParameter("@filename", Filename); } if (FileExtension != String.Empty) { sb.Criteria.Add(string.Format("{0}=@fileExtension", AssetFile.Columns.FileExtension)); sb.AddDataParameter("@fileExtension", FileExtension); } if (AssetFileTypeId != 0) { sb.Criteria.Add(string.Format("{0}=@assetFileTypeId", AssetFile.Columns.AssetFileTypeId)); sb.AddDataParameter("@assetFileTypeId", AssetFileTypeId); } if (LastUpdate != DateTime.MinValue) { sb.Criteria.Add(string.Format("{0}=@lastUpdate", AssetFile.Columns.LastUpdate)); sb.AddDataParameter("@lastUpdate", LastUpdate); } 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 (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); }
protected override void SetSearchCriteria(ref SearchBuilder sb) { if (AssetImageSizeIdList != null && AssetImageSizeIdList.Count > 0) { JoinableList list = new JoinableList(AssetImageSizeIdList); sb.Criteria.Add(string.Format("{0} IN (" + list + ")", AssetImageSize.Columns.AssetImageSizeId)); } if (AssetImageSizeId.HasValue) { sb.Criteria.Add(string.Format("{0}=@assetImageSizeId", AssetImageSize.Columns.AssetImageSizeId)); sb.AddDataParameter("@assetImageSizeId", AssetImageSizeId.Value); } if (Description != String.Empty) { sb.Criteria.Add(string.Format("{0}=@description", AssetImageSize.Columns.Description)); sb.AddDataParameter("@description", Description); } if (Height != 0) { sb.Criteria.Add(string.Format("{0}=@height", AssetImageSize.Columns.Height)); sb.AddDataParameter("@height", Height); } if (Width != 0) { sb.Criteria.Add(string.Format("{0}=@width", AssetImageSize.Columns.Width)); sb.AddDataParameter("@width", Width); } if (DotsPerInch != 0) { sb.Criteria.Add(string.Format("{0}=@dotsPerInch", AssetImageSize.Columns.DotsPerInch)); sb.AddDataParameter("@dotsPerInch", DotsPerInch); } if (FileSuffix != String.Empty) { sb.Criteria.Add(string.Format("{0}=@fileSuffix", AssetImageSize.Columns.FileSuffix)); sb.AddDataParameter("@fileSuffix", FileSuffix); } SetCustomSearchCriteria(ref sb); }
protected override void SetSearchCriteria(ref SearchBuilder sb) { if (CartIdList != null && CartIdList.Count > 0) { JoinableList list = new JoinableList(CartIdList); sb.Criteria.Add(string.Format("{0} IN (" + list + ")", Cart.Columns.CartId)); } if (CartId.HasValue) { sb.Criteria.Add(string.Format("{0}=@cartId", Cart.Columns.CartId)); sb.AddDataParameter("@cartId", CartId.Value); } if (UserId != 0) { sb.Criteria.Add(string.Format("{0}=@userId", Cart.Columns.UserId)); sb.AddDataParameter("@userId", UserId); } if (AssetId != 0) { sb.Criteria.Add(string.Format("{0}=@assetId", Cart.Columns.AssetId)); sb.AddDataParameter("@assetId", AssetId); } if (Notes != String.Empty) { sb.Criteria.Add(string.Format("{0}=@notes", Cart.Columns.Notes)); sb.AddDataParameter("@notes", Notes); } if (RequiredByDate != null) { sb.Criteria.Add(string.Format("{0}=@requiredByDate", Cart.Columns.RequiredByDate)); sb.AddDataParameter("@requiredByDate", RequiredByDate.Value); } if (DateAdded != DateTime.MinValue) { sb.Criteria.Add(string.Format("{0}=@dateAdded", Cart.Columns.DateAdded)); sb.AddDataParameter("@dateAdded", DateAdded); } 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 (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); }