本文整理汇总了C#中IProduct类的典型用法代码示例。如果您正苦于以下问题:C# IProduct类的具体用法?C# IProduct怎么用?C# IProduct使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IProduct类属于命名空间,在下文中一共展示了IProduct类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ProductAssociatesShapeWithUnitGroup
public static bool ProductAssociatesShapeWithUnitGroup(IProduct product)
{
if (product.Quantity.Unit.UnitGroup == null) return false;
var valid = product.Shape.UnitGroups.Contains(product.Quantity.Unit.UnitGroup);
if (!valid) throw new AssertFailedException(new StackFrame().GetMethod().Name);
return true;
}
示例2: SaveProduct
/// <summary>
/// Makes call to db to insert new Product
/// </summary>
/// <param name="product"></param>
public void SaveProduct(IProduct product)
{
try
{
using (ISession session = NHibernateTest.NHibernateHelper.GetCurrentSession())
{
using (ITransaction transaction = session.BeginTransaction())
{
try
{
// session.Save(product);
session.SaveOrUpdate(product);
transaction.Commit();
//session.Flush();
}
catch (Exception e)
{
transaction.Rollback();
Console.WriteLine("Error : " + e.Message);
Console.WriteLine("Error : " + e.StackTrace);
}
}
}
}
catch (Exception e)
{
Console.WriteLine("Error occurred :" + e.Message);
Console.WriteLine("Error occurred :" + e);
}
}
示例3: IsMatched
public bool IsMatched(IProduct element)
{
if (element == null)
return false;
return _color == element.Color;
}
示例4: RemoveProduct
public void RemoveProduct(IProduct product)
{
if (this.Products.Contains(product))
{
this.Products.Remove(product);
}
}
示例5: Edit
public void Edit(int id, int factoryId, int amount, string material, string drawingId, DateTime orderdate, DateTime factOrderDate, decimal? clientPrice, decimal? factoryPrice, int? money, DateTime? devliDateFact, DateTime? devliDateCus, string qualityer, decimal modelPrice, IProduct product, decimal exchangeRate)
{
using (IUnitOfWork uow = IoC.Resolve<IUnitOfWork>("cat"))
{
IFactoryRepository factoryRep = IoC.Resolve<IFactoryRepository>();
IFactory fact = factoryRep.GetById(factoryId);
IProduce_Product p = _bar.GetById(id);
p.Factory = fact;
p.Amount = amount;
p.Material = material;
p.DrawingId = drawingId;
p.OrderDate = orderdate;
p.FactoryOrderDate = factOrderDate;
p.ClientPrice = clientPrice;
p.FactoryPrice = factoryPrice;
p.ClientPriceMoney = money;
p.DelivDateCust = devliDateCus;
p.DelivDateFact = devliDateFact;
p.Qualityer = qualityer;
p.ModelPrice = modelPrice;
p.Product = product;
p.ExchangeRate = exchangeRate;
uow.Commit();
}
}
示例6: RemoveProduct
public void RemoveProduct(IProduct product)
{
if (ContainsProduct(product))
{
this.productList.Remove(product);
}
}
示例7: ProductCanonical
public string ProductCanonical(IProduct product, ILocalization localization)
{
product = _productService.Localize(product, localization);
var productUrl = _productUrlService.GetCanonicalUrl(product);
return _urlFormatService.FormatUrl(_urlLocalizationService.LocalizeCatalogUrl(productUrl, localization));
}
示例8: AddProduct
public void AddProduct(IProduct product)
{
Validator.CheckIfNull(
product,
string.Format(GlobalErrorMessages.ObjectCannotBeNull, "Product"));
this.productList.Add(product);
}
示例9: ContainsProduct
public bool ContainsProduct(IProduct product)
{
return shopingCart.Any( p =>p.Name == product.Name
&& p.Brand == product.Brand
&& p.Price == product.Price
&& p.Gender == product.Gender);
}
示例10: Part
public Part(string partname,
int qty,
double width,
double length,
double thickness,
string material,
string ebw1,
string ebw2,
string ebl1,
string ebl2,
string comment,
string comment2,
string comment3,
int bp,
string mp,
double xo,
double yo,
double zo,
double xr,
double yr,
double zr,
string draw3dstr,
string draw2dstr,
IProduct product)
: this()
{
this.PartName = partname;
this.Width = width;
this.Length = length;
this.Qty = qty;
this.Thickness = thickness;
this.Material = material;
this.EBW1 = ebw1;
this.EBW2 = ebw2;
this.EBL1 = ebl1;
this.EBL2 = ebl2;
this.Comment = comment;
this.Comment2 = comment2;
this.Comment3 = comment3;
this.BasePoint = bp;
this.MachinePoint = new MachinePoint(mp);
this.XOrigin = xo;
this.YOrigin = yo;
this.ZOrigin = zo;
this.XRotation = xr;
this.YRotation = yr;
this.ZRotation = zr;
this.Draw3DToken = draw3dstr;
this.Draw2DToken = draw2dstr;
//TODO:
//this.Product = product;
this.TXOrigin = this.XOrigin;
this.TYOrigin = this.YOrigin;
this.TZOrigin = this.ZOrigin;
this.TXRotation = this.XRotation;
this.TYRotation = this.YRotation;
this.TZRotation = this.ZRotation;
}
示例11: ShowPrice1
public string ShowPrice1(IProduct product)
{
if (product.GetPrice() > 16)
return "Expensive";
return "Cheap";
}
示例12: PerformTask
/// <summary>
/// The perform task.
/// </summary>
/// <param name="entity">
/// The entity.
/// </param>
/// <returns>
/// The <see cref="Attempt"/>.
/// </returns>
public override Attempt<IProduct> PerformTask(IProduct entity)
{
foreach (var origVariant in Original.ProductVariants.ToArray())
{
var cloneVariant = this.GetClonedMathingVariant(entity, origVariant);
cloneVariant.Barcode = origVariant.Barcode;
cloneVariant.Available = false;
cloneVariant.Price = origVariant.Price;
cloneVariant.OnSale = origVariant.OnSale;
cloneVariant.SalePrice = origVariant.SalePrice;
cloneVariant.CostOfGoods = origVariant.CostOfGoods;
cloneVariant.Download = origVariant.Download;
cloneVariant.DownloadMediaId = origVariant.DownloadMediaId;
cloneVariant.Height = origVariant.Height;
cloneVariant.Length = origVariant.Length;
cloneVariant.Weight = origVariant.Weight;
cloneVariant.Width = origVariant.Width;
cloneVariant.Manufacturer = origVariant.Manufacturer;
cloneVariant.ManufacturerModelNumber = origVariant.ManufacturerModelNumber;
cloneVariant.TrackInventory = origVariant.TrackInventory;
cloneVariant.OutOfStockPurchase = origVariant.OutOfStockPurchase;
cloneVariant.Shippable = origVariant.Shippable;
cloneVariant.Taxable = origVariant.Taxable;
}
return Attempt<IProduct>.Succeed(entity);
}
示例13: RemoveProduct
public void RemoveProduct(IProduct product)
{
// Added validation for null
Validator.CheckIfNull(product, string.Format(GlobalErrorMessages.ObjectCannotBeNull, "Product"));
this.products.Remove(product);
}
示例14: ShowColor
public string ShowColor(IProduct product)
{
if (product.Color == "Red")
return "Red";
return string.Empty;
}
示例15: ApplyDOMUpdate
public void ApplyDOMUpdate(IProduct product, KaiTrade.Interfaces.IPXUpdate update)
{
try
{
KaiTrade.Interfaces.IDOM dom = _mnemonicDOM[product.Mnemonic];
if (dom == null)
{
// must have a least a price
decimal? initPx = null;
if (update.BidPrice.HasValue)
{
initPx = update.BidPrice;
}
else if (update.OfferPrice.HasValue)
{
initPx = update.OfferPrice;
}
else if (update.TradePrice.HasValue)
{
initPx = update.TradePrice;
}
if (initPx.HasValue)
{
dom = GetProductDOM(product, initPx.Value);
}
}
dom.Update(update);
}
catch
{
}
}