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


C# ProductType类代码示例

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


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

示例1: FindProduct

        public static Product FindProduct(ProductType type, string product, string version, string revision)
        {
            var products = type == ProductType.Standalone ? ProductManager.StandaloneProducts : ProductManager.Modules;
              if (!string.IsNullOrEmpty(product))
              {
            products = products.Where(x => x.Name.Equals(product, StringComparison.OrdinalIgnoreCase));
              }

              if (!string.IsNullOrEmpty(version))
              {
            products = products.Where(x => x.Version == version);
              }
              else
              {
            products = products.OrderByDescending(x => x.Version);
              }

              if (!string.IsNullOrEmpty(revision))
              {
            products = products.Where(x => x.Revision == revision);
              }
              else
              {
            products = products.OrderByDescending(x => x.Revision);
              }

              var distributive = products.FirstOrDefault();
              return distributive;
        }
开发者ID:Sitecore,项目名称:Sitecore-Instance-Manager,代码行数:29,代码来源:ProductManager.cs

示例2: CreateUpdateProductTypeServices

        public int CreateUpdateProductTypeServices(ProductType ud)
        {
            int ProductTypeID = 0;
            using (FDBEntities db = new FDBEntities())
            {
                if (ud.ProductTypeID > 0)
                {
                    ProductType temp = db.ProductTypes.Where(u => u.ProductTypeID == ud.ProductTypeID).FirstOrDefault();

                    if (temp != null)
                    {
                        temp.Description = ud.Description;
                    }
                }
                else
                {
                    db.ProductTypes.Add(ud);
                }

                int x = db.SaveChanges();
                if (x > 0)
                {
                    ProductTypeID = ud.ProductTypeID;
                }
            }

            return ProductTypeID;
        }
开发者ID:shivam01990,项目名称:FDBWebSite,代码行数:28,代码来源:ProductTypeServices.cs

示例3: createProductType

    private ProductType createProductType() {
        ProductType p = new ProductType();

        p.Name = txtName.Text;

        return p;
    }
开发者ID:Rita124,项目名称:Rita124.github.io,代码行数:7,代码来源:ManageProductTypes.aspx.cs

示例4: InappProductStrings

 public InappProductStrings(string pdtId, ProductType pdtType, string shortName)
 {
     DefaultProductId = pdtId;
     DefaultProductType = pdtType;
     DefaultProductShortName = shortName;
     //OverrideIdsByStore = new Dictionary<string, List<string>>();
 }
开发者ID:rsumathijs,项目名称:Coloring-Book-WIP,代码行数:7,代码来源:InappProductConstants.cs

示例5: LoadCB

 private void LoadCB()
 {
     ProductType product = new ProductType();
     typeCB.DataSource = product.GetAllProductTypeQuery();
     typeCB.DisplayMember = "Name";
     typeCB.ValueMember = "ID";
 }
开发者ID:jeremy-conadera,项目名称:WMS,代码行数:7,代码来源:AddProductForm.cs

示例6: Product

 // Dependency to ensure product have necessary values.
 public Product(string code, string name, ProductType type, float price)
 {
     Code = code;
     Name = name;
     Type = type;
     Price = price;
 }
开发者ID:gbshukla,项目名称:MDL.Billing,代码行数:8,代码来源:Product.cs

示例7: LineItem

        /// <summary>
        /// Creates a new LineItem
        /// </summary>
        /// <param name="title">A title describing the product </param>
        /// <param name="price">The product price in the currency matching the one used in the whole order and set in the "Currency" field</param>
        /// <param name="quantityPurchased">Quantity purchased of the item</param>
        /// <param name="productId">The Product ID number (optional)</param>
        /// <param name="sku">The stock keeping unit of the product (optional)</param>
        public LineItem(string title,
            double price,
            int quantityPurchased,
            //optional
            string productId = null,
            string sku = null,
            string condition = null,
            bool? requiresShipping = null,
            Seller seller = null,
            DeliveredToType? deliveredTo = null,
            DateTime? delivered_at = null,
            ProductType? productType = null,
            string brand = null,
            string category = null,
            string subCategory = null)
        {
            Title = title;
            Price = price;
            QuantityPurchased = quantityPurchased;

            // optional
            ProductId = productId;
            Sku = sku;
            Condition = condition;
            RequiresShipping = requiresShipping;
            Seller = seller;
            DeliveredTo = deliveredTo;
            ProductType = productType;
            Category = category;
            SubCategory = subCategory;
            DeliveredAt = delivered_at;
            Brand = brand;
        }
开发者ID:Riskified,项目名称:sdk_net,代码行数:41,代码来源:LineItem.cs

示例8: ProductTypeRowModel

 public ProductTypeRowModel(ProductType type)
 {
     this.Id = type.Id;
     this.Name = type.Name;
     this.SkuAlias = type.SkuAlias;
     this.IsEnabled = type.IsEnabled;
 }
开发者ID:Wipcore,项目名称:Ecommerce,代码行数:7,代码来源:ProductTypeRowModel.cs

示例9: Create

        public static Product Create(ProductType productType)
        {
            Product product = null;

            switch (productType)
            {
                case ProductType.Apple:
                    {
                        product = new AppleProduct();
                        break;
                    }
                case ProductType.Berry:
                    {
                        product = new BerryProduct();
                        break;
                    }
                case ProductType.Cherry:
                    {
                        product = new CherryProduct();
                        break;
                    }
            }

            return product;
        }
开发者ID:joenjuki,项目名称:design-patterns,代码行数:25,代码来源:ProductFactory.cs

示例10: createProductType

 private ProductType createProductType()
 {
     //access productType db
     ProductType p = new ProductType();
     p.TypeDescreption = TextBoxProductDesc.Text;
     return p;
 }
开发者ID:lester88a,项目名称:COMP229-Final-Example,代码行数:7,代码来源:ManageProductType.aspx.cs

示例11: CreateProductType

        private ProductType CreateProductType()
        {
            ProductType p = new ProductType();
            p.TName = txtbox_TName.Text;

            return p;
        }
开发者ID:Slyfly28,项目名称:BakeryManager,代码行数:7,代码来源:ManagePType.aspx.cs

示例12: btnSubmit_Click

    /// <summary>
    /// Submit button click event
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        ProductTypeAdmin prodTypeAdmin = new ProductTypeAdmin();
        ProductType prodType = new ProductType();
        prodType.ProductTypeId = ItemId;
        prodType.PortalId  = ZNodeConfigManager.SiteConfig.PortalID ;
        prodType.Name = Name.Text;
        prodType.Description = Description.Text;
        prodType.DisplayOrder = Convert.ToInt32(DisplayOrder.Text);

        bool check = false;

        if (ItemId > 0)
        {

            check = prodTypeAdmin.Update(prodType);
        }
        else
        {
            check = prodTypeAdmin.Add(prodType);
        }

        if (check)
        {
            //redirect to main page
            Response.Redirect("list.aspx");
        }
        else
        {
            //display error message
            lblError.Text = "An error occurred while updating. Please try again.";
        }
    }
开发者ID:daniela12,项目名称:gooptic,代码行数:38,代码来源:add.aspx.cs

示例13: CreateProductType

        private ProductType CreateProductType()
        {
            ProductType item = new ProductType();
            item.Name = CategoryName.Text;

            return item;
        }
开发者ID:Sverre11,项目名称:Grupp2-master,代码行数:7,代码来源:Management.aspx.cs

示例14: Product

 public Product(string productCode, string productName, string quotaType, ProductType productType, int quantity)
 {
     this.ProductName = productName;
     this.Quantity = quantity;
     this.ProductCode = productCode;
     this.QuotaType = quotaType;
     this.ProdType = productType;
 }
开发者ID:mihle,项目名称:VaultService,代码行数:8,代码来源:Product.cs

示例15: FarmUnit

 protected FarmUnit(string id, int health, int productionQuantity, 
     ProductType productType, int healthEffect)
     : base(id)
 {
     this.Health = health;
     this.ProductionQuantity = productionQuantity;
     this.ProductType = productType;
     this.healthEffect = healthEffect;
 }
开发者ID:ivanovcorp,项目名称:SoftwareUniversity,代码行数:9,代码来源:FarmUnit.cs


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