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


C# Mapper.OurPriceCalibration方法代码示例

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


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

示例1: ParseAndSave

        public void ParseAndSave()
        {
            var file = httpContext.Request.Files[0];

            IEnumerable<ISupplier> list = null;

            Dictionary<string, Dictionary<string, int>> ConversionDictionary = null;

            switch (model.Supplier)
            {
                case "Igal":
                    list = csvParser.Parse<Igal>(file.InputStream);
                    ConversionDictionary = Igal.ConversionDictionary;
                    break;
                case "IgalGIA":
                    list = csvParser.Parse<IgalGIA>(file.InputStream);
                    ConversionDictionary = IgalGIA.ConversionDictionary;
                    break;
            }

            list = list.Distinct().ToList();

            var mapper = new Mapper<INV_DIAMONDS_INVENTORY>(ConversionDictionary);
            mapper.SetPricePolicy(PricePolicy.Calibrate);
            mapper.OurPriceCalibration((decimal)1.07);

            var dblist = list.Select(mapper.Map).ToList();

            var db = new DatabasePersistence();
            db.AddSupplierDiamondList(dblist);
            db.SaveOrUpdate();
        }
开发者ID:mamluka,项目名称:JewelryONet,代码行数:32,代码来源:TempUpdateDiamodsHendler.cs

示例2: Map_ShouldMapThePriceCorrectyWithMultiplyByWeightAndCalibration

        public void Map_ShouldMapThePriceCorrectyWithMultiplyByWeightAndCalibration()
        {
            //Arrange
            var mapper = new Mapper<INV_DIAMONDS_INVENTORY>(Igal.ConversionDictionary);
            mapper.SetPricePolicy(PricePolicy.MultiplyByWeightAndCalibrate);
            mapper.OurPriceCalibration((decimal) 1.17);

            var igalDiamond = new Igal()
            {
                Clarity = "SI2",
                Culet = "",
                Color = "H",
                Cut = "VG",
                DepthPresentage =  (decimal)4.25,
                InventoryCode = "12345",
                Fluorescence = "MB",
                Girdle = "",
                Length = (decimal)3.5,
                Polish = "G",
                Price = 9999,
                Report = "EGL IL",
                ReportURL = "",
                Shape = "BR",
                Symmetry = "EX",
                Table = (decimal)54.5,
                Weight = (decimal)2.41,
                Width = (decimal)6.35

            };
            //Act
            var inv_entry = mapper.Map(igalDiamond);
            //Assert
            inv_entry.totalprice.Should().Be((decimal)28194.1803);
        }
开发者ID:mamluka,项目名称:JewelryONet,代码行数:34,代码来源:MapperTests.cs


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