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


C# Production.AddProductionShift方法代码示例

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


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

示例1: AddShiftsOnDifferentDaysWithSameTeam

        public void AddShiftsOnDifferentDaysWithSameTeam()
        {
            Production production = new Production("Machine A", new ProductNumber("11232"), new OrderNumber("1234"), 1000, 124);

            ProductionTeam team = new ProductionTeam("Team 1");

            DateTime start1 = new DateTime(2008, 10, 12, 8, 30, 0);
            DateTime start2 = new DateTime(2008, 11, 12, 8, 30, 0);

            ProductionShift shift1 = production.AddProductionShift(team, start1);
            ProductionShift shift2 = production.AddProductionShift(team, start2);

            CollectionAssert.AreEquivalent(new [] { shift1, shift2 }, new List<ProductionShift>(production.Shifts));
        }
开发者ID:mikkela,项目名称:oee,代码行数:14,代码来源:ProductionTest.cs

示例2: AddShift

        public void AddShift()
        {
            Production production = new Production("Machine A", new ProductNumber("11232"), new OrderNumber("1234"), 1000, 124);

            ProductionTeam team = new ProductionTeam("Team 1");

            DateTime start = new DateTime(2008, 10, 12, 8, 30, 0);

            ProductionShift shift = production.AddProductionShift(team, start);

            CollectionAssert.AreEquivalent(new [] { shift }, new List<ProductionShift>(production.Shifts));
        }
开发者ID:mikkela,项目名称:oee,代码行数:12,代码来源:ProductionTest.cs

示例3: CreateProductionLeg

        public void CreateProductionLeg()
        {
            Production production = new Production("Machine A", new ProductNumber("11232"), new OrderNumber("1234"), 1000, 124);
            ProductionTeam team = new ProductionTeam("Team");
            DateTime start = new DateTime(2008, 10, 12, 8, 30, 0);
            ProductionShift shift = production.AddProductionShift(team, start.Date);

            long counterStart = 9956;

            ProductionLeg leg =  shift.AddProductionLeg(start, counterStart);

            Assert.AreEqual<DateTime>(start, leg.ProductionStart);
            Assert.AreEqual<long>(counterStart, leg.CounterStart);
        }
开发者ID:mikkela,项目名称:oee,代码行数:14,代码来源:ProductionLegTest.cs

示例4: AddStopsToProductionLeg

        public void AddStopsToProductionLeg()
        {
            Production production = new Production("Machine A", new ProductNumber("11232"), new OrderNumber("1234"), 1000, 124);
            ProductionShift shift = production.AddProductionShift(new ProductionTeam("T"), DateTime.Now.Date);
            ProductionLeg leg = shift.AddProductionLeg(DateTime.Now, 0);

            CollectionAssert.AreEquivalent(new ProductionStopRegistration[] { }, new List<ProductionStopRegistration>(leg.ProductionStopRegistrations));

            leg.AddProductionStopRegistration(new ProductionStopRegistration(stop1, new TimeSpan(0, 10, 0)));
            CollectionAssert.AreEquivalent(new [] { new ProductionStopRegistration(stop1, new TimeSpan(0, 10, 0)) }, new List<ProductionStopRegistration>(leg.ProductionStopRegistrations));

            leg.AddProductionStopRegistration(new ProductionStopRegistration(stop3, new TimeSpan(0, 35, 0)));
            CollectionAssert.AreEquivalent(new [] { new ProductionStopRegistration(stop1, new TimeSpan(0, 10, 0)), new ProductionStopRegistration(stop3, new TimeSpan(0, 35, 0)) }, new List<ProductionStopRegistration>(leg.ProductionStopRegistrations));

            leg.AddProductionStopRegistration(new ProductionStopRegistration(stop1, new TimeSpan(0, 12, 0)));
            CollectionAssert.AreEquivalent(new [] { new ProductionStopRegistration(stop1, new TimeSpan(0, 10, 0)), new ProductionStopRegistration(stop1, new TimeSpan(0, 12, 0)), new ProductionStopRegistration(stop3, new TimeSpan(0, 35, 0)) }, new List<ProductionStopRegistration>(leg.ProductionStopRegistrations));
        }
开发者ID:mikkela,项目名称:oee,代码行数:17,代码来源:ProductionLegTest.cs

示例5: UpdateProductionShifts

        public void UpdateProductionShifts()
        {
            Production production = new Production("Machine A", product1, order1, 1000, 100);

            using (IEntityRepository<Production> repository = factory.CreateEntityRepository<Production>())
            {
                repository.Save(production);
            }

            ProductionShift shift1 = production.AddProductionShift(team1, new DateTime(2008, 11, 12));
            ProductionShift shift2 = production.AddProductionShift(team2, new DateTime(2008, 11, 12));

            using (IEntityRepository<ProductionShift> repository = factory.CreateEntityRepository<ProductionShift>())
            {
                repository.Save(shift1);
                repository.Save(shift2);
            }

            using (IEntityRepository<Production> repository = factory.CreateEntityRepository<Production>())
            {
                repository.Save(production);
            }

            using (IEntityRepository<Production> repository = factory.CreateEntityRepository<Production>())
            {
                Production loadedProduction = repository.Load(production.Id);

                Assert.AreNotSame(production, loadedProduction);
                Assert.AreEqual(production, loadedProduction);
                Assert.AreEqual(production.Machine, loadedProduction.Machine);
                Assert.AreEqual(production.Product, loadedProduction.Product);
                Assert.AreEqual(production.Order, loadedProduction.Order);
                Assert.AreEqual(production.ExpectedItems, loadedProduction.ExpectedItems);
                Assert.AreEqual(production.ProducedItemsPerHour, loadedProduction.ProducedItemsPerHour);
                CollectionAssert.AreEquivalent(new List<ProductionShift>(production.Shifts), new List<ProductionShift>(loadedProduction.Shifts));
            }
        }
开发者ID:mikkela,项目名称:oee,代码行数:37,代码来源:ProductionRepositoryTest.cs

示例6: AddShiftsOnSameDayWithSameTeam

        public void AddShiftsOnSameDayWithSameTeam()
        {
            Production production = new Production("Machine A", new ProductNumber("11232"), new OrderNumber("1234"), 1000, 124);

            ProductionTeam team = new ProductionTeam("Team 1");

            DateTime start = new DateTime(2008, 10, 12, 8, 30, 0);

            ProductionShift shift1 = production.AddProductionShift(team, start);
            ProductionShift shift2 = production.AddProductionShift(team, start.AddHours(1));
        }
开发者ID:mikkela,项目名称:oee,代码行数:11,代码来源:ProductionTest.cs

示例7: Duplicate

        private Production Duplicate(Production p, IEnumerable<ProductionShift> shifts)
        {
            Production production = new Production(p.Machine, p.Product, p.Order,
                                                    p.ExpectedItems,
                                                    p.ProducedItemsPerHour,
                                                    p.ValidatedStartTime);

            foreach (var shift in shifts)
            {
                var s = production.AddProductionShift(shift.Team, shift.ProductionStart.Date);
                foreach (var leg in shift.ProductionLegs)
                {
                    var l = s.AddProductionLeg(leg.ProductionStart, leg.CounterStart);

                    foreach (var registration in shift.ProductionStopRegistrations)
                    {
                        l.AddProductionStopRegistration(registration);
                    }

                    l.UpdateStatistics(leg.ProductionEnd, leg.CounterEnd, leg.DiscardedItems);
                }

            }

            return production;
        }
开发者ID:mikkela,项目名称:oee,代码行数:26,代码来源:ProductionQueryRepository.cs

示例8: CreateWithNegativeCounterStart

        public void CreateWithNegativeCounterStart()
        {
            DateTime time = DateTime.Now;

            Production production = new Production("Machine A", new ProductNumber("11232"), new OrderNumber("1234"), 1000, 124);
            ProductionShift shift = production.AddProductionShift(new ProductionTeam("T"), DateTime.Now.Date);
            ProductionLeg leg = shift.AddProductionLeg(DateTime.Now, -1);
        }
开发者ID:mikkela,项目名称:oee,代码行数:8,代码来源:ProductionLegTest.cs

示例9: UpdateWithProductionStartSameAsProductionEnd

        public void UpdateWithProductionStartSameAsProductionEnd()
        {
            DateTime time = DateTime.Now;

            Production production = new Production("Machine A", new ProductNumber("11232"), new OrderNumber("1234"), 1000, 124);
            ProductionShift shift = production.AddProductionShift(new ProductionTeam("T"), DateTime.Now.Date);
            ProductionLeg leg = shift.AddProductionLeg(time, 0);

            leg.UpdateStatistics(time, 0, 0);
        }
开发者ID:mikkela,项目名称:oee,代码行数:10,代码来源:ProductionLegTest.cs

示例10: UpdateWithNegativeDiscarded

        public void UpdateWithNegativeDiscarded()
        {
            DateTime time = DateTime.Now;

            Production production = new Production("Machine A", new ProductNumber("11232"), new OrderNumber("1234"), 1000, 124);
            ProductionShift shift = production.AddProductionShift(new ProductionTeam("T"), DateTime.Now.Date);
            ProductionLeg leg = shift.AddProductionLeg(time, 0);

            leg.UpdateStatistics(time.AddMinutes(10), 50, -5);
        }
开发者ID:mikkela,项目名称:oee,代码行数:10,代码来源:ProductionLegTest.cs

示例11: UpdateWithCounterEndSmallerThanCounterStart

        public void UpdateWithCounterEndSmallerThanCounterStart()
        {
            DateTime time = DateTime.Now;

            Production production = new Production("Machine A", new ProductNumber("11232"), new OrderNumber("1234"), 1000, 124);
            ProductionShift shift = production.AddProductionShift(new ProductionTeam("T"), DateTime.Now.Date);
            ProductionLeg leg = shift.AddProductionLeg(time, 400);

            leg.UpdateStatistics(time.AddMinutes(10), 300, 0);
        }
开发者ID:mikkela,项目名称:oee,代码行数:10,代码来源:ProductionLegTest.cs

示例12: ProductionStatistics

        public void ProductionStatistics()
        {
            DateTime start = new DateTime(2008, 10, 12, 8, 30, 0);
            DateTime end = new DateTime(2008, 10, 12, 14, 45, 0);
            long counterStart = 1111;
            long counterEnd = 12342;
            long discardedItems = 534;

            Production production = new Production("Machine A", new ProductNumber("11232"), new OrderNumber("1234"), 1000, 124);
            ProductionShift shift = production.AddProductionShift(new ProductionTeam("T"), DateTime.Now.Date);
            ProductionLeg leg = shift.AddProductionLeg(start, counterStart);

            leg.UpdateStatistics(end, counterEnd, discardedItems);

            Assert.AreEqual<long>(11231, leg.ProducedItems);
            Assert.AreEqual<long>(10697, leg.ProducedApprovedItems);
            Assert.AreEqual<TimeSpan>(new TimeSpan(6, 15, 0), leg.ProductionTime);
        }
开发者ID:mikkela,项目名称:oee,代码行数:18,代码来源:ProductionLegTest.cs


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