• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# IProduct类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



IProduct类属于命名空间,在下文中一共展示了IProduct类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
 }
开发者ID:halcwb,项目名称:GenForm,代码行数:7,代码来源:ProductChecker.cs


示例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);
            }
        }
开发者ID:Fabii23,项目名称:NHibernate,代码行数:35,代码来源:ProductRepository.cs


示例3: IsMatched

        public bool IsMatched(IProduct element)
        {
            if (element == null)
                return false;

            return _color == element.Color;
        }
开发者ID:liupanpansmile,项目名称:AgileDevelopmentStudy,代码行数:7,代码来源:ISpecification.cs


示例4: RemoveProduct

 public void RemoveProduct(IProduct product)
 {
     if (this.Products.Contains(product))
     {
         this.Products.Remove(product);
     }
 }
开发者ID:IskraNikolova,项目名称:Object-oriented-programming,代码行数:7,代码来源:ShoppingCart.cs


示例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();
            }
        }
开发者ID:xxfss2,项目名称:Cat,代码行数:26,代码来源:Produce_ProductService.cs


示例6: RemoveProduct

 public void RemoveProduct(IProduct product)
 {
     if (ContainsProduct(product))
     {
         this.productList.Remove(product);
     }
 }
开发者ID:zlatkovtv,项目名称:SoftUni_OOP,代码行数:7,代码来源:ShoppingCart.cs


示例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));
		}
开发者ID:Chuhukon,项目名称:uWebshop-Releases,代码行数:7,代码来源:UrlService.cs


示例8: AddProduct

 public void AddProduct(IProduct product)
 {
     Validator.CheckIfNull(
       product,
       string.Format(GlobalErrorMessages.ObjectCannotBeNull, "Product"));
     this.productList.Add(product);
 }
开发者ID:zlatkovtv,项目名称:SoftUni_OOP,代码行数:7,代码来源:ShoppingCart.cs


示例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);
 }
开发者ID:AdrianDamyanov,项目名称:CSharpOOP,代码行数:7,代码来源:ShoppingCart.cs


示例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;
        }
开发者ID:komelio,项目名称:Dimeng.LinkToMicrocad,代码行数:60,代码来源:Part.cs


示例11: ShowPrice1

        public string ShowPrice1(IProduct product)
        {
            if (product.GetPrice() > 16)
                return "Expensive";

            return "Cheap";
        }
开发者ID:nick-zhang,项目名称:FeatureExamples,代码行数:7,代码来源:Student.cs


示例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);
        }
开发者ID:drpeck,项目名称:Merchello,代码行数:37,代码来源:MapProductVariantDataTask.cs


示例13: RemoveProduct

        public void RemoveProduct(IProduct product)
        {
            // Added validation for null
            Validator.CheckIfNull(product, string.Format(GlobalErrorMessages.ObjectCannotBeNull, "Product"));

            this.products.Remove(product);
        }
开发者ID:ZahariyaPehlivanova,项目名称:KPK-CodeDocumentation-Homework,代码行数:7,代码来源:ShoppingCart.cs


示例14: ShowColor

        public string ShowColor(IProduct product)
        {
            if (product.Color == "Red")
                return "Red";

            return string.Empty;
        }
开发者ID:nick-zhang,项目名称:FeatureExamples,代码行数:7,代码来源:Student.cs


示例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
            {
            }
        }
开发者ID:junwin,项目名称:TradingTools,代码行数:35,代码来源:MemoryPriceHandler.cs


示例16: TestBase

        public TestBase()
        {
            var builder = new ContainerBuilder();
               builder.RegisterType<DatabaseFactory>().As<IDatabaseFactory>().InstancePerLifetimeScope();
               builder.RegisterType<UnityOfWork>().As<IUnitOfWork>();

               builder.RegisterType<ContactRepostory>().AsImplementedInterfaces();
               builder.RegisterType<ContactServices>().AsImplementedInterfaces();
               builder.RegisterType<ProductRepository>().AsImplementedInterfaces();
               builder.RegisterType<LodgingRepository>().AsImplementedInterfaces();
               builder.RegisterType<ResortRepository>().AsImplementedInterfaces();

               builder.RegisterType<ProductService>().AsImplementedInterfaces();
               builder.RegisterType<LodgingService>().AsImplementedInterfaces();
               builder.RegisterType<ResortService>().AsImplementedInterfaces();

               #region 权限
               builder.RegisterType<PermissionModuleRepository>().AsImplementedInterfaces();
               builder.RegisterType<PermissionRoleRepository>().AsImplementedInterfaces();
               builder.RegisterType<PermissionReRoleModuleRepostory>().AsImplementedInterfaces();
               builder.RegisterType<PermissionSvc>().AsImplementedInterfaces();
               #endregion
               container= builder.Build();
               this.unitOfWork = container.Resolve<IUnitOfWork>();
               this.contact=container.Resolve<IContact>();
               this.productsvc=container.Resolve<IProduct>();
               this.resortSvc = container.Resolve<IResort>();
               this.lodgingsvc = container.Resolve<ILodging>();
               this.permissionSvc = container.Resolve<IPermission>();
             //  StartUp();
        }
开发者ID:Jan307,项目名称:permissionrepository,代码行数:31,代码来源:TestBase.cs


示例17: OutputSaleUnit

 private static void OutputSaleUnit(StringBuilder sb, IProduct product)
 {
     bool omitSaleUnit = product.SaleUnitIsNull()
                         || product.SoldByPurchaseUnit();
     if (!omitSaleUnit)
         sb.Append(GetOutputOfUnit(product.SaleUnit));
 }
开发者ID:JohnCai,项目名称:Homework,代码行数:7,代码来源:OrderLineDescriber.cs


示例18: OrderLine

        public OrderLine(IProduct product)
        {
            if (product == null)
                throw new ArgumentNullException("product", "product Can't be null!");

            Product = product;
            Quantity = 1;
        }
开发者ID:JohnCai,项目名称:Homework,代码行数:8,代码来源:OrderLine.cs


示例19: AddCosmetics

 public void AddCosmetics(IProduct cosmetics)
 {
     Validator.CheckIfNull(
        cosmetics,
        string.Format(GlobalErrorMessages.ObjectCannotBeNull, "Cosmetics"));
     this._productList.Add(cosmetics);
     _productList = _productList.OrderBy(x => x.Brand).ThenByDescending(y => y.Price).ToList();
 }
开发者ID:zlatkovtv,项目名称:SoftUni_OOP,代码行数:8,代码来源:Category.cs


示例20: AddProduct

 public void AddProduct(IProduct product)
 {
     if (product == null)
     {
         throw new ArgumentNullException("Null product can not be added to list");
     }
     this.products.Add(product);
 }
开发者ID:VasilenaDragancheva,项目名称:OOP,代码行数:8,代码来源:ShoppingCard.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# IProductAttributeFormatter类代码示例发布时间:2022-05-24
下一篇:
C# IProcessorArchitecture类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap