예제 #1
0
        /// <summary>
        /// Creates a copy of the given ProductTemplate
        /// </summary>
        /// <param name="productTemplateId">Id of the ProductTemplate object to create copy of</param>
        /// <param name="deepCopy">if <b>true</b> child collections are also copied</param>
        /// <returns>A copy of the given ProductTemplate</returns>
        public static ProductTemplate Copy(int productTemplateId, bool deepCopy)
        {
            ProductTemplate copy = ProductTemplateDataSource.Load(productTemplateId);

            if (copy != null)
            {
                if (deepCopy)
                {
                    //LOAD THE CHILD COLLECTIONS AND RESET
                    foreach (InputField field in copy.InputFields)
                    {
                        //LOAD THE CHILD COLLECTIONS AND RESET
                        foreach (InputChoice choice in field.InputChoices)
                        {
                            choice.InputChoiceId = 0;
                        }
                        field.InputFieldId = 0;
                    }
                }
                copy.ProductTemplateId = 0;
                return(copy);
            }
            return(null);
        }
예제 #2
0
 public static ProductTemplate Load(Int32 productTemplateId)
 {
     return(ProductTemplateDataSource.Load(productTemplateId, true));
 }
예제 #3
0
 public static ProductTemplateCollection LoadForProduct(Int32 productId, int maximumRows, int startRowIndex)
 {
     return(ProductTemplateDataSource.LoadForProduct(productId, maximumRows, startRowIndex, string.Empty));
 }
예제 #4
0
 public static ProductTemplateCollection LoadForProduct(Int32 productId, string sortExpression)
 {
     return(ProductTemplateDataSource.LoadForProduct(productId, 0, 0, sortExpression));
 }
예제 #5
0
 public static ProductTemplateCollection LoadForProduct(Int32 productId)
 {
     return(ProductTemplateDataSource.LoadForProduct(productId, 0, 0, string.Empty));
 }