本文整理汇总了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;
}
示例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;
}
示例3: createProductType
private ProductType createProductType() {
ProductType p = new ProductType();
p.Name = txtName.Text;
return p;
}
示例4: InappProductStrings
public InappProductStrings(string pdtId, ProductType pdtType, string shortName)
{
DefaultProductId = pdtId;
DefaultProductType = pdtType;
DefaultProductShortName = shortName;
//OverrideIdsByStore = new Dictionary<string, List<string>>();
}
示例5: LoadCB
private void LoadCB()
{
ProductType product = new ProductType();
typeCB.DataSource = product.GetAllProductTypeQuery();
typeCB.DisplayMember = "Name";
typeCB.ValueMember = "ID";
}
示例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;
}
示例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;
}
示例8: ProductTypeRowModel
public ProductTypeRowModel(ProductType type)
{
this.Id = type.Id;
this.Name = type.Name;
this.SkuAlias = type.SkuAlias;
this.IsEnabled = type.IsEnabled;
}
示例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;
}
示例10: createProductType
private ProductType createProductType()
{
//access productType db
ProductType p = new ProductType();
p.TypeDescreption = TextBoxProductDesc.Text;
return p;
}
示例11: CreateProductType
private ProductType CreateProductType()
{
ProductType p = new ProductType();
p.TName = txtbox_TName.Text;
return p;
}
示例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.";
}
}
示例13: CreateProductType
private ProductType CreateProductType()
{
ProductType item = new ProductType();
item.Name = CategoryName.Text;
return item;
}
示例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;
}
示例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;
}