private bool LoadByPrimaryKeyDynamic(System.Int32 id) { ProductFieldQuery query = new ProductFieldQuery(); query.Where(query.Id == id); return(this.Load(query)); }
protected void InitQuery(ProductFieldQuery query) { query.OnLoadDelegate = this.OnQueryLoaded; if (!query.es2.HasConnection) { query.es2.Connection = ((IEntityCollection)this).Connection; } }
public static bool SlugExistsForProductField(int productId, string slug) { ProductFieldQuery q = new ProductFieldQuery(); q.Select(q.ProductId, q.Slug); q.Where(q.ProductId == productId, q.Slug == slug); ProductField pf = new ProductField(); return(pf.Load(q)); }
public static void SetSortOrderByListPosition(List <int> productFieldIdsInSortOrder) { ProductFieldQuery q = new ProductFieldQuery(); q.Where(q.Id.In(productFieldIdsInSortOrder.ToArray())); ProductFieldCollection collection = new ProductFieldCollection(); if (collection.Load(q)) { for (short i = 0; i < productFieldIdsInSortOrder.Count; i++) { ProductField pf = collection.FindByPrimaryKey(productFieldIdsInSortOrder[i]); if (pf != null) { pf.SortOrder = i; } } collection.Save(); } }
public bool Load(ProductFieldQuery query) { this.query = query; InitQuery(this.query); return(Query.Load()); }