当前位置: 首页>>代码示例>>C#>>正文


C# ProductType.ToString方法代码示例

本文整理汇总了C#中ProductType.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# ProductType.ToString方法的具体用法?C# ProductType.ToString怎么用?C# ProductType.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ProductType的用法示例。


在下文中一共展示了ProductType.ToString方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetProdCategoriesForDomain

 public List<tbl_ProdCategories> GetProdCategoriesForDomain(int domainID, int parentID, bool includeDeleted, ProductType type = ProductType.AllProducts)
 {
     var query = ProdCategoriesRepository.GetAll().Where(pc => pc.tbl_SiteMap.SM_DomainID == domainID && pc.PC_Live &&
                          pc.tbl_SiteMap.tbl_Content.Any(c => c.C_Approved && !c.C_Deleted));
     if (!includeDeleted)
         query = query.Where(pc => pc.PC_Deleted == false);
     return (type != ProductType.AllProducts) ?
        query.OrderBy(pc => pc.PC_Order).ToList()
            .Where(pc => pc.PC_ParentID.GetValueOrDefault(0) == parentID && pc.tbl_ProductTypes.PT_Name == type.ToString()).ToList() :
        query.OrderBy(pc => pc.PC_Order).ToList()
            .Where(pc => pc.PC_ParentID.GetValueOrDefault(0) == parentID).ToList();
 }
开发者ID:nhtera,项目名称:CrowdCMS,代码行数:12,代码来源:ECommerce.cs

示例2: GetProductsByType

        public PagedResult<Product> GetProductsByType(ProductType type, int page, int itemsPerPage)
        {
            PagedResult<Product> result = new PagedResult<Product>();
            result.PageNumber = page;
            result.ItemsPerPage = itemsPerPage;

            using (SqlConnection connection = new SqlConnection(this._connectionString))
            {
                string sql = @"Select * From VintageRabbit.Products Where [Type] = @Type Order By DateCreated Desc OFFSET @Offset ROWS FETCH NEXT @ResultsPerPage ROWS ONLY;
                               Select Count(*) From VintageRabbit.Products Where [Type] = @Type;";
                int offset = (page - 1) * itemsPerPage;

                using (var multi = connection.QueryMultiple(sql, new { Type = type.ToString(), Offset = offset, ResultsPerPage = itemsPerPage }))
                {
                    var productResults = multi.Read<ProductDb>();

                    foreach (var product in productResults)
                    {
                        result.Add(this.ConvertToProduct(product));
                    }

                    result.TotalResults = multi.Read<int>().First();
                }
            }

            return result;
        }
开发者ID:Brontsy,项目名称:Vintage-Rabbit,代码行数:27,代码来源:ProductRepository.cs

示例3: GetProductsByCategory

        public PagedResult<Product> GetProductsByCategory(ProductType type, Category category, int page, int itemsPerPage)
        {
            PagedResult<Product> result = new PagedResult<Product>();
            result.PageNumber = page;
            result.ItemsPerPage = itemsPerPage;

            IList<int> categoryIds = new List<int>() { category.Id };
            foreach(var child in category.Children)
            {
                categoryIds.Add(child.Id);
            }

            string sql = @"Select * From VintageRabbit.Products
                            Where [Type] = @Type And VintageRabbit.Products.Id In (Select Distinct ProductId From VintageRabbit.ProductCategories Where CategoryId In @CategoryIds)
                            Order By DateCreated Desc
                            OFFSET @Offset ROWS FETCH NEXT @ResultsPerPage ROWS ONLY;
                               Select Count(*) From VintageRabbit.Products Where [Type] = @Type And VintageRabbit.Products.Id In (Select Distinct ProductId From VintageRabbit.ProductCategories Where CategoryId In @CategoryIds);";

            int offset = (page - 1) * itemsPerPage;

            using (SqlConnection connection = new SqlConnection(this._connectionString))
            {
                using (var multi = connection.QueryMultiple(sql, new { CategoryIds = categoryIds, Type = type.ToString(), Offset = offset, ResultsPerPage = itemsPerPage }))
                {
                    var productResults = multi.Read<ProductDb>();

                    foreach (var product in productResults)
                    {
                        result.Add(this.ConvertToProduct(product));
                    }

                    result.TotalResults = multi.Read<int>().First();
                }

            }

            return result;
        }
开发者ID:Brontsy,项目名称:Vintage-Rabbit,代码行数:38,代码来源:ProductRepository.cs

示例4: GetWithContent

 public static IEnumerable<tbl_Products> GetWithContent(this EntityCollection<tbl_Products> table, ProductType type)
 {
     return table.Where(p => !p.P_Deleted && p.P_Live &&
         p.tbl_ProductTypes.PT_Name.Equals(type.ToString()) &&
         p.tbl_SiteMap.tbl_Content.Any(c => c.C_Approved && !c.C_Deleted)).OrderBy(p => p.P_Order);
 }
开发者ID:nhtera,项目名称:CrowdCMS,代码行数:6,代码来源:ExtensionMethodes.cs

示例5: CreateProductEntries

 private void CreateProductEntries(ProductType type)
 {
     var entries = _products.Where(p => p.type == type);
     if (entries.Any())
     {
         EditorGUILayout.Separator();
         EditorGUILayout.LabelField(type.ToString() + "s");
         foreach (var p in entries)
         {
             CreateProductEntry(p);
         }
     }
 }
开发者ID:nickreynolds,项目名称:FirstPersonTowerDefense,代码行数:13,代码来源:ProductsWindow.cs

示例6: CreateNewProduct

 public virtual IProduct CreateNewProduct(ProductType type, String productName, int productPrice)
 {
     if (type == ProductType.Bags)
     {
         return new FactoryVivienneBags(productName, productPrice);
     }
     else if (type == ProductType.Shoes)
     {
         return new FactoryVivienneShoes(productName, productPrice);
     }
     if (type == ProductType.Dresses || type == ProductType.Coats)
     {
         return new BaseWear(productName, productPrice, type.ToString());
     }
     return null;
 }
开发者ID:shuozhao,项目名称:learnoopattern,代码行数:16,代码来源:FactoryVivienneClient.cs


注:本文中的ProductType.ToString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。