Esempio n. 1
0
        private bool LoadByPrimaryKeyDynamic(System.Int32 id)
        {
            ProductPhotoQuery query = new ProductPhotoQuery();

            query.Where(query.Id == id);
            return(this.Load(query));
        }
Esempio n. 2
0
        protected void InitQuery(ProductPhotoQuery query)
        {
            query.OnLoadDelegate = this.OnQueryLoaded;

            if (!query.es2.HasConnection)
            {
                query.es2.Connection = ((IEntityCollection)this).Connection;
            }
        }
Esempio n. 3
0
        public static List <ProductPhoto> GetAllPhotosInSortOrder(int productId)
        {
            ProductPhotoQuery q = new ProductPhotoQuery();

            q.Where(q.ProductId == productId);
            q.OrderBy(q.SortOrder.Ascending, q.DisplayName.Ascending);

            ProductPhotoCollection collection = new ProductPhotoCollection();

            if (collection.Load(q))
            {
                return(collection.ToList());
            }
            return(new List <ProductPhoto>());
        }
Esempio n. 4
0
        public ProductPhoto GetMainPhoto()
        {
            ProductPhotoQuery q = new ProductPhotoQuery();

            q.es.Top = 1;
            q.Where(q.ProductId == this.Id.Value);
            q.OrderBy(q.SortOrder.Ascending, q.DisplayName.Ascending);

            ProductPhoto mainPhoto = new ProductPhoto();

            if (mainPhoto.Load(q))
            {
                return(mainPhoto);
            }
            return(new ProductPhoto());
        }
Esempio n. 5
0
 public bool Load(ProductPhotoQuery query)
 {
     this.query = query;
     InitQuery(this.query);
     return(Query.Load());
 }