コード例 #1
0
        static public void Delete(System.Int32 id, esSqlAccessType sqlAccessType)
        {
            var obj = new ProductField();

            obj.Id = id;
            obj.AcceptChanges();
            obj.MarkAsDeleted();
            obj.Save(sqlAccessType);
        }
コード例 #2
0
        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));
        }
コード例 #3
0
        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();
            }
        }