public async Task <IActionResult> Edit(int id, [Bind("ArticleId,Name,UnitId,ArticleTypeId,Price,DeliveryPeriod,CreationDate")] M_Article article)
        {
            if (id != article.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(entity: article);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ArticleExists(id: article.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(actionName: "Index"));
            }
            ViewData[index : "ArticleTypeId"] = new SelectList(items : _context.ArticleTypes, dataValueField : "ArticleTypeId", dataTextField : "Name", selectedValue : article.ArticleTypeId);
            ViewData[index : "UnitId"]        = new SelectList(items : _context.Units, dataValueField : "UnitId", dataTextField : "Name", selectedValue : article.UnitId);
            return(View(model: article));
        }
示例#2
0
        public void SetArticleProvided()
        {
            var operationManager = new OperationManager();
            var bom = new M_ArticleBom()
            {
                ArticleChild = new M_Article()
                {
                    Name = "Wood"
                }
            };
            var job     = TypeFactory.CreateJobItem(jobName: "Sample Operation 1", jobDuration: 10, bom: bom);
            var article = new M_Article()
            {
                Name         = "Bear"
                , Operations = new List <M_Operation>()
                {
                    job.Operation
                }
                , ArticleBoms = new List <M_ArticleBom>()
                {
                    bom
                }
            };
            var fArticle = TypeFactory.CreateDummyArticle(59, 0, article, 1);

            operationManager.AddOperation(job);
            var numberOfRequiredDispos = operationManager.CreateRequiredArticles(fArticle, ActorRefs.Nobody, 0);

            Assert.True(numberOfRequiredDispos == 1);
        }
示例#3
0
 public void UpdateTransitionTime(M_Article article, decimal factor)
 {
     foreach (var operation in article.Operations)
     {
         operation.AverageTransitionDuration = Convert.ToInt32(value: Math.Round(d: operation.Duration * factor, decimals: 0, mode: MidpointRounding.AwayFromZero));
     }
 }
示例#4
0
 private void InitOpenProvidersDictionary(M_Article article)
 {
     if (_openNodes.ContainsKey(article) == false)
     {
         _openNodes.Add(article, new StackSet <OpenNode <T> >());
     }
 }
示例#5
0
        /**
         * SE:I --> satisfy by orders PuOP
         */
        public EntityCollector Satisfy(Demand demand, Quantity demandedQuantity)
        {
            EntityCollector entityCollector = new EntityCollector();
            M_Article       article         = demand.GetArticle();
            DueTime         dueTime         = demand.GetStartTimeBackward();

            if (article.ToBuild)
            {
                throw new MrpRunException(
                          "You try to create a purchaseOrderPart for a articleToBuild.");
            }

            // currently only one businessPartner per article TODO: This could be changing
            M_ArticleToBusinessPartner articleToBusinessPartner =
                _dbMasterDataCache.M_ArticleToBusinessPartnerGetAllByArticleId(article.GetId())[0];
            M_BusinessPartner businessPartner =
                _dbMasterDataCache.M_BusinessPartnerGetById(new Id(articleToBusinessPartner
                                                                   .BusinessPartnerId));
            T_PurchaseOrder purchaseOrder = new T_PurchaseOrder();

            // [Name],[DueTime],[BusinessPartnerId]
            purchaseOrder.DueTime         = dueTime.GetValue();
            purchaseOrder.BusinessPartner = businessPartner;
            purchaseOrder.Name            = $"PurchaseOrder{article.Name} for " +
                                            $"businessPartner {purchaseOrder.BusinessPartner.Id}";

            // init a new purchaseOderPart
            T_PurchaseOrderPart tPurchaseOrderPart = new T_PurchaseOrderPart();

            // [PurchaseOrderId],[ArticleId],[Quantity],[State],[ProviderId]
            tPurchaseOrderPart.PurchaseOrder   = purchaseOrder;
            tPurchaseOrderPart.PurchaseOrderId = purchaseOrder.Id;
            tPurchaseOrderPart.Article         = article;
            tPurchaseOrderPart.ArticleId       = article.Id;
            tPurchaseOrderPart.Quantity        =
                CalculateQuantity(articleToBusinessPartner, demandedQuantity) *
                articleToBusinessPartner
                .PackSize;
            if (tPurchaseOrderPart.Quantity < demandedQuantity.GetValue())
            {
                throw new MrpRunException("You cannot purchase less than you need!");
            }

            tPurchaseOrderPart.State = State.Created;

            PurchaseOrderPart purchaseOrderPart =
                new PurchaseOrderPart(tPurchaseOrderPart, null);

            T_DemandToProvider demandToProvider = new T_DemandToProvider()
            {
                DemandId   = demand.GetId().GetValue(),
                ProviderId = purchaseOrderPart.GetId().GetValue(),
                Quantity   = demandedQuantity.GetValue()
            };

            entityCollector.Add(purchaseOrderPart);
            entityCollector.Add(demandToProvider);
            return(entityCollector);
        }
示例#6
0
        internal void LogValueChange(M_Article article, double value)
        {
            var pub = new FUpdateStockValue(stockName: article.Name
                                            , newValue: value
                                            , articleType: article.ArticleType.Name);

            Agent.Context.System.EventStream.Publish(@event: pub);
        }
示例#7
0
        public IEnumerable <OpenNode <T> > GetOpenProvider(M_Article article)
        {
            if (AnyOpenProvider(article) == false)
            {
                return(null);
            }

            return(_openNodes[article]);
        }
示例#8
0
 public void Add(M_Article article, OpenNode <T> openNode)
 {
     if (openNode.GetOpenNode().GetType() != typeof(StockExchangeDemand))
     {
         throw new MrpRunException("An open provider can only be a StockExchangeDemand.");
     }
     InitOpenProvidersDictionary(article);
     _openNodes[article].Push(openNode);
 }
        /// <summary>
        ///
        /// </summary>
        /// <param name="articleTypes"></param>
        /// <param name="units"></param>
        /// <returns></returns>
        private static M_Article[] CreateArticles(M_ArticleType[] articleTypes, M_Unit[] units)
        {
            var articles = new M_Article[]
            {
                // Final Products
                new M_Article
                {
                    Name         = ARTICLE_TABLE, ArticleTypeId = articleTypes.Single(predicate: s => s.Name == "Product").Id,
                    CreationDate = DateTime.Parse(s: "2016-09-01"), DeliveryPeriod = 20,
                    UnitId       = units.Single(predicate: s => s.Name == "Pieces").Id, Price = 25.00, ToPurchase = false,
                    ToBuild      = true, PictureUrl = "/images/Product/05_Truck_final.jpg"
                },

                // Intermediate Products
                new M_Article
                {
                    Name         = ARTICLE_TABLE_LEG, ArticleTypeId = articleTypes.Single(predicate: s => s.Name == "Assembly").Id,
                    CreationDate = DateTime.Parse(s: "2016-09-01"), DeliveryPeriod = 5,
                    UnitId       = units.Single(predicate: s => s.Name == "Pieces").Id, Price = 2.00, ToPurchase = false,
                    ToBuild      = true, PictureUrl = "/images/Product/05_Truck_final.jpg"
                },
                new M_Article
                {
                    Name         = ARTICLE_TABLETOP, ArticleTypeId = articleTypes.Single(predicate: s => s.Name == "Assembly").Id,
                    CreationDate = DateTime.Parse(s: "2016-09-01"), DeliveryPeriod = 5,
                    UnitId       = units.Single(predicate: s => s.Name == "Pieces").Id, Price = 10.00, ToPurchase = false,
                    ToBuild      = true, PictureUrl = "/images/Product/05_Truck_final.jpg"
                },

                // base Materials
                new M_Article
                {
                    Name          = ARTICLE_WOOD_PANEL,
                    ArticleTypeId = articleTypes.Single(predicate: s => s.Name == "Material").Id,
                    CreationDate  = DateTime.Parse(s: "2002-09-01"), DeliveryPeriod = 5,
                    UnitId        = units.Single(predicate: s => s.Name == "Pieces").Id, Price = 3.00, ToPurchase = true,
                    ToBuild       = false
                },
                new M_Article
                {
                    Name          = ARTICLE_PEG,
                    ArticleTypeId = articleTypes.Single(predicate: s => s.Name == "Material").Id,
                    CreationDate  = DateTime.Parse(s: "2002-09-01"), DeliveryPeriod = 5,
                    UnitId        = units.Single(predicate: s => s.Name == "Pieces").Id, Price = 0.70, ToPurchase = true,
                    ToBuild       = false
                },
                new M_Article
                {
                    Name         = ARTICLE_SCREW, ArticleTypeId = articleTypes.Single(predicate: s => s.Name == "Consumable").Id,
                    CreationDate = DateTime.Parse(s: "2005-09-01"), DeliveryPeriod = 4,
                    UnitId       = units.Single(predicate: s => s.Name == "Kilo").Id, Price = 0.50, ToPurchase = true, ToBuild = false
                },
            };

            return(articles);
        }
        public async Task <IActionResult> Create([Bind("ArticleId,Name,UnitId,ArticleTypeId,Price,DeliveryPeriod,CreationDate")] M_Article article)
        {
            if (ModelState.IsValid)
            {
                _context.Add(entity: article);
                await _context.SaveChangesAsync();

                return(RedirectToAction(actionName: "Index"));
            }
            ViewData[index : "ArticleTypeId"] = new SelectList(items : _context.ArticleTypes, dataValueField : "ArticleTypeId", dataTextField : "Name", selectedValue : article.ArticleTypeId);
            ViewData[index : "UnitId"]        = new SelectList(items : _context.Units, dataValueField : "UnitId", dataTextField : "Name", selectedValue : article.UnitId);
            return(View(model: article));
        }
        public async Task <M_Article> GetArticleBomRecursive(M_Article article, int articleId)
        {
            article.ArticleChilds = ArticleBoms.Include(navigationPropertyPath: a => a.ArticleChild)
                                    .ThenInclude(navigationPropertyPath: w => w.Operations)
                                    .Where(predicate: a => a.ArticleParentId == articleId).ToList();

            foreach (var item in article.ArticleChilds)
            {
                await GetArticleBomRecursive(article : item.ArticleParent, articleId : item.ArticleChildId);
            }
            await Task.Yield();

            return(article);
        }
示例#12
0
        public static CustomerOrderPart CreateCustomerOrderPartWithGivenArticle(
            int quantity, M_Article article, DueTime dueTime)
        {
            T_CustomerOrder     tCustomerOrder     = CreateCustomerOrder(dueTime);
            T_CustomerOrderPart tCustomerOrderPart = new T_CustomerOrderPart();

            tCustomerOrderPart.CustomerOrder   = tCustomerOrder;
            tCustomerOrderPart.CustomerOrderId = tCustomerOrder.Id;
            tCustomerOrderPart.Article         = article;
            tCustomerOrderPart.ArticleId       = tCustomerOrderPart.Article.Id;
            tCustomerOrderPart.Quantity        = quantity;
            tCustomerOrderPart.State           = State.Created;

            return(new CustomerOrderPart(tCustomerOrderPart));
        }
示例#13
0
        public M_Stock M_StockGetByArticleId(Id articleId)
        {
            M_Article article = M_ArticleGetById(articleId);

            if (article.Stock == null)
            {
                // init stocks for all articles
                foreach (var stock in _stocks)
                {
                    M_ArticleGetById(new Id(stock.ArticleForeignKey)).Stock = stock;
                }
            }

            return(article.Stock);
        }
示例#14
0
 public static FArticle CreateDummyArticle(int dueTime, int currentTime, M_Article article, int quantity)
 {
     return(new FArticle(
                key: Guid.NewGuid()
                , dueTime: dueTime
                , quantity: quantity
                , article: article
                , creationTime: currentTime
                , customerOrderId: 0
                , isHeadDemand: true
                , stockExchangeId: Guid.Empty
                , storageAgent: ActorRefs.NoSender
                , isProvided: false
                , originRequester: ActorRefs.Nobody
                , dispoRequester: ActorRefs.Nobody
                , providerList: new List <Guid>()
                , finishedAt: 0
                ));
 }
示例#15
0
        public M_Article[] Init(MasterDBContext context)
        {
            var articles = new M_Article[]
            {
                // Final Product
                DUMP_TRUCK,
                RACE_TRUCK,

                // Cabin
                SKELETON,
                TRUCK_BED,
                CHASSIS_TYPE_DUMP,
                CHASSIS_TYPE_RACE,
                RACE_WING,
                CABIN,
                ENGINE_BLOCK,

                // Truck Bed
                SIDEWALL_LONG,
                SIDEWALL_SHORT,
                BASEPLATE_TRUCK_BED,
                DUMP_JOINT,

                ENGINE_RACE_EXTENSION,

                // Skeleton
                WHEEL,
                BASE_PLATE,
                SEMITRAILER,
                WASHER,

                // base Materials
                TIMBER_PLATE,
                TIMBER_BLOCK,
                GLUE, PEGS, POLE, BUTTON, PACKING, USER_MANUAL
            };

            context.Articles.AddRange(entities: articles);
            context.SaveChanges();
            return(articles);
        }
        internal void ResponseFromSystemForBom(M_Article article)
        {
            // Update
            var dueTime = _fArticle.DueTime;

            if (article.Operations != null)
            {
                dueTime = _fArticle.DueTime - article.Operations.Sum(selector: x => x.Duration + x.AverageTransitionDuration);
            }
            // TODO: Object that handles the different operations- current assumption is all operations are handled as a sequence (no alternative/parallel plans)

            _fArticle = _fArticle.UpdateCustomerOrderAndDue(id: _fArticle.CustomerOrderId, due: dueTime, storage: _fArticle.StorageAgent)
                        .UpdateArticle(article: article);

            // Creates a Production Agent for each element that has to be produced
            for (var i = 0; i < _quantityToProduce; i++)
            {
                var agentSetup  = AgentSetup.Create(agent: Agent, behaviour: ProductionAgent.Behaviour.Factory.Get(simType: SimulationType.None));
                var instruction = CreateChild.Create(setup: agentSetup, target: ((IAgent)Agent).Guardian, source: Agent.Context.Self);
                Agent.Send(instruction: instruction);
            }
        }
示例#17
0
        /**
         * returns a provider, which can be a stockExchangeProvider, if article can be fulfilled by stock, else
         * a productionOrder/purchaseOrderPart
         */
        private Provider CreateStockExchangeProvider(M_Article article, DueTime dueTime,
                                                     Quantity demandedQuantity)
        {
            if (demandedQuantity == null || demandedQuantity.GetValue() == 0)
            {
                throw new MrpRunException("Quantity is not set.");
            }
            M_Stock         stock         = _dbMasterDataCache.M_StockGetByArticleId(article.GetId());
            T_StockExchange stockExchange = new T_StockExchange();

            stockExchange.StockExchangeType = StockExchangeType.Provider;
            stockExchange.Quantity          = demandedQuantity.GetValue(); // TODO: PASCAL .GetValueOrDefault();
            stockExchange.State             = State.Created;

            stockExchange.Stock          = stock;
            stockExchange.StockId        = stock.Id;
            stockExchange.RequiredOnTime = dueTime.GetValue();
            stockExchange.ExchangeType   = ExchangeType.Withdrawal;
            StockExchangeProvider stockExchangeProvider = new StockExchangeProvider(stockExchange);

            return(stockExchangeProvider);
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="article"></param>
        /// <param name="dbTransactionData"></param>
        /// <param name="dbMasterDataCache"></param>
        /// <param name="parentProductionOrder"></param>
        /// <param name="quantity">of production article to produce
        /// --> is used for childs as: articleBom.Quantity * quantity</param>
        /// <returns></returns>
        public static Demands CreateProductionOrderBoms(M_Article article,
                                                        Provider parentProductionOrder, Quantity quantity)
        {
            IDbTransactionData dbTransactionData =
                ZppConfiguration.CacheManager.GetDbTransactionData();

            M_Article readArticle = dbTransactionData.M_ArticleGetById(article.GetId());

            if (readArticle.ArticleBoms != null && readArticle.ArticleBoms.Any())
            {
                List <Demand> newDemands = new List <Demand>();
                IProductionOrderBomCreator productionOrderBomCreator = new ProductionOrderBomCreator();

                foreach (M_ArticleBom articleBom in readArticle.ArticleBoms)
                {
                    newDemands.AddRange(
                        productionOrderBomCreator.CreateProductionOrderBomsForArticleBom(articleBom,
                                                                                         quantity, (ProductionOrder)parentProductionOrder));
                }

                // backwards scheduling
                OperationBackwardsSchedule lastOperationBackwardsSchedule = null;

                IEnumerable <ProductionOrderOperation> sortedProductionOrderOperations = newDemands
                                                                                         .Select(x => ((ProductionOrderBom)x).GetProductionOrderOperation())
                                                                                         .OrderByDescending(x => x.GetValue().HierarchyNumber);

                foreach (var productionOrderOperation in sortedProductionOrderOperations)
                {
                    lastOperationBackwardsSchedule = productionOrderOperation.ScheduleBackwards(
                        lastOperationBackwardsSchedule, parentProductionOrder.GetStartTimeBackward());
                }

                return(new ProductionOrderBoms(newDemands));
            }

            return(null);
        }
示例#19
0
        public M_Article[] Init(MasterDBContext context)
        {
            var articles = new M_Article[]
            {
                //Endprodukte
                SCHRANK,
                REGAL,

                //Zwischenprodukte
                RAHMEN,
                RAHMEN_MIT_RÜCKWAND,
                SEITENWAND,
                ABLAGE,
                RÜCKWAND,
                BODENPLATTE,
                DECKPLATTE,
                SCHRANKTÜR,

                //Ausgangsmaterialien
                METALLDÜBEL,
                HOLZBRETT_KURZ,
                HOLZBRETT_LANG,
                TÜRGRIFF,
                SCHARNIERE,
                SCHRAUBE,
                NAGEL,
                SPANPLATTE,
                FUß,
                KLEIDERSTANGE,
                KLEIDERSTANGENHALTERUNG
            };

            context.Articles.AddRange(entities: articles);
            context.SaveChanges();
            return(articles);
        }
示例#20
0
        internal ArticleData(MasterTableArticleType articleType, MasterTableUnit unit)
        {
            SCHRANK = new M_Article
            {
                Name           = "Schrank",
                ArticleTypeId  = articleType.PRODUCT.Id,
                CreationDate   = DateTime.Parse(s: "2020-07-07"),
                DeliveryPeriod = 20,
                UnitId         = unit.PIECES.Id,
                Price          = 200,
                ToPurchase     = false,
                ToBuild        = true
            };

            REGAL = new M_Article
            {
                Name           = "Regal",
                ArticleTypeId  = articleType.PRODUCT.Id,
                CreationDate   = DateTime.Parse(s: "2020-07-07"),
                DeliveryPeriod = 20,
                UnitId         = unit.PIECES.Id,
                Price          = 150,
                ToPurchase     = false,
                ToBuild        = true
            };

            RAHMEN = new M_Article
            {
                Name           = "Rahmen",
                ArticleTypeId  = articleType.ASSEMBLY.Id,
                CreationDate   = DateTime.Parse(s: "2020-07-07"),
                DeliveryPeriod = 10,
                UnitId         = unit.PIECES.Id,
                Price          = 80,
                ToPurchase     = false,
                ToBuild        = true
            };

            RAHMEN_MIT_RÜCKWAND = new M_Article
            {
                Name           = "Rahmen mit Rückwand",
                ArticleTypeId  = articleType.ASSEMBLY.Id,
                CreationDate   = DateTime.Parse(s: "2020-07-07"),
                DeliveryPeriod = 10,
                UnitId         = unit.PIECES.Id,
                Price          = 100,
                ToPurchase     = false,
                ToBuild        = true
            };

            SEITENWAND = new M_Article
            {
                Name           = "Seitenwand",
                ArticleTypeId  = articleType.ASSEMBLY.Id,
                CreationDate   = DateTime.Parse(s: "2020-07-07"),
                DeliveryPeriod = 10,
                UnitId         = unit.PIECES.Id,
                Price          = 30,
                ToPurchase     = false,
                ToBuild        = true
            };

            ABLAGE = new M_Article
            {
                Name           = "Ablage",
                ArticleTypeId  = articleType.ASSEMBLY.Id,
                CreationDate   = DateTime.Parse(s: "2020-07-07"),
                DeliveryPeriod = 10,
                UnitId         = unit.PIECES.Id,
                Price          = 10,
                ToPurchase     = false,
                ToBuild        = true
            };

            RÜCKWAND = new M_Article
            {
                Name           = "Rückwand",
                ArticleTypeId  = articleType.ASSEMBLY.Id,
                CreationDate   = DateTime.Parse(s: "2020-07-07"),
                DeliveryPeriod = 10,
                UnitId         = unit.PIECES.Id,
                Price          = 25,
                ToPurchase     = false,
                ToBuild        = true
            };

            BODENPLATTE = new M_Article
            {
                Name           = "Bodenplatte",
                ArticleTypeId  = articleType.ASSEMBLY.Id,
                CreationDate   = DateTime.Parse(s: "2020-07-07"),
                DeliveryPeriod = 10,
                UnitId         = unit.PIECES.Id,
                Price          = 15,
                ToPurchase     = false,
                ToBuild        = true
            };

            DECKPLATTE = new M_Article
            {
                Name           = "Deckplatte",
                ArticleTypeId  = articleType.ASSEMBLY.Id,
                CreationDate   = DateTime.Parse(s: "2020-07-07"),
                DeliveryPeriod = 10,
                UnitId         = unit.PIECES.Id,
                Price          = 10,
                ToPurchase     = false,
                ToBuild        = true
            };

            SCHRANKTÜR = new M_Article
            {
                Name           = "Schranktür",
                ArticleTypeId  = articleType.ASSEMBLY.Id,
                CreationDate   = DateTime.Parse(s: "2020-07-07"),
                DeliveryPeriod = 10,
                UnitId         = unit.PIECES.Id,
                Price          = 40,
                ToPurchase     = false,
                ToBuild        = true
            };

            METALLDÜBEL = new M_Article
            {
                Name           = "Metalldübel",
                ArticleTypeId  = articleType.MATERIAL.Id,
                CreationDate   = DateTime.Parse(s: "2020-07-07"),
                DeliveryPeriod = 5,
                UnitId         = unit.PIECES.Id,
                Price          = 0.5,
                ToPurchase     = true,
                ToBuild        = false
            };

            HOLZBRETT_KURZ = new M_Article
            {
                Name           = "kurzes Holzbrett",
                ArticleTypeId  = articleType.MATERIAL.Id,
                CreationDate   = DateTime.Parse(s: "2020-07-07"),
                DeliveryPeriod = 5,
                UnitId         = unit.PIECES.Id,
                Price          = 8,
                ToPurchase     = true,
                ToBuild        = false
            };

            HOLZBRETT_LANG = new M_Article
            {
                Name           = "langes Holzbrett",
                ArticleTypeId  = articleType.MATERIAL.Id,
                CreationDate   = DateTime.Parse(s: "2020-07-07"),
                DeliveryPeriod = 5,
                UnitId         = unit.PIECES.Id,
                Price          = 25,
                ToPurchase     = true,
                ToBuild        = false
            };

            TÜRGRIFF = new M_Article
            {
                Name           = "Türgriff",
                ArticleTypeId  = articleType.MATERIAL.Id,
                CreationDate   = DateTime.Parse(s: "2020-07-07"),
                DeliveryPeriod = 5,
                UnitId         = unit.PIECES.Id,
                Price          = 2,
                ToPurchase     = true,
                ToBuild        = false
            };

            SCHARNIERE = new M_Article
            {
                Name           = "Scharniere",
                ArticleTypeId  = articleType.MATERIAL.Id,
                CreationDate   = DateTime.Parse(s: "2020-07-07"),
                DeliveryPeriod = 5,
                UnitId         = unit.PIECES.Id,
                Price          = 5,
                ToPurchase     = true,
                ToBuild        = false
            };

            SCHRAUBE = new M_Article
            {
                Name           = "Schraube",
                ArticleTypeId  = articleType.MATERIAL.Id,
                CreationDate   = DateTime.Parse(s: "2020-07-07"),
                DeliveryPeriod = 5,
                UnitId         = unit.PIECES.Id,
                Price          = 0.2,
                ToPurchase     = true,
                ToBuild        = false
            };

            NAGEL = new M_Article
            {
                Name           = "Nagel",
                ArticleTypeId  = articleType.MATERIAL.Id,
                CreationDate   = DateTime.Parse(s: "2020-07-07"),
                DeliveryPeriod = 5,
                UnitId         = unit.PIECES.Id,
                Price          = 0.1,
                ToPurchase     = true,
                ToBuild        = false
            };

            SPANPLATTE = new M_Article
            {
                Name           = "Spanplatte",
                ArticleTypeId  = articleType.MATERIAL.Id,
                CreationDate   = DateTime.Parse(s: "2020-07-07"),
                DeliveryPeriod = 5,
                UnitId         = unit.PIECES.Id,
                Price          = 20,
                ToPurchase     = true,
                ToBuild        = false
            };

            FUß = new M_Article
            {
                Name           = "Fuß",
                ArticleTypeId  = articleType.MATERIAL.Id,
                CreationDate   = DateTime.Parse(s: "2020-07-07"),
                DeliveryPeriod = 5,
                UnitId         = unit.PIECES.Id,
                Price          = 2,
                ToPurchase     = true,
                ToBuild        = false
            };

            KLEIDERSTANGE = new M_Article
            {
                Name           = "Kleiderstange",
                ArticleTypeId  = articleType.MATERIAL.Id,
                CreationDate   = DateTime.Parse(s: "2020-07-07"),
                DeliveryPeriod = 5,
                UnitId         = unit.PIECES.Id,
                Price          = 5,
                ToPurchase     = true,
                ToBuild        = false
            };

            KLEIDERSTANGENHALTERUNG = new M_Article
            {
                Name           = "Kleiderstangenhalterung",
                ArticleTypeId  = articleType.MATERIAL.Id,
                CreationDate   = DateTime.Parse(s: "2020-07-07"),
                DeliveryPeriod = 5,
                UnitId         = unit.PIECES.Id,
                Price          = 0.5,
                ToPurchase     = true,
                ToBuild        = false
            };
        }
示例#21
0
 public bool AnyOpenProvider(M_Article article)
 {
     InitOpenProvidersDictionary(article);
     return(_openNodes[article].Any());
 }
示例#22
0
 public static ResponseFromSystemForBom Create(M_Article message, IActorRef target)
 {
     return(new ResponseFromSystemForBom(message: message, target: target));
 }
示例#23
0
 public static FArticle CreateDummyArticle(int dueTime, long customerDue, int currentTime, M_Article article, int quantity)
 {
     return(new FArticle(
                key: Guid.Empty
                , dueTime: dueTime
                , customerDue: customerDue
                , keys: new FSharpSet <Guid>(new Guid[] { })
                , quantity: quantity
                , article: article
                , creationTime: currentTime
                , customerOrderId: 0
                , isHeadDemand: true
                , stockExchangeId: Guid.Empty
                , storageAgent: ActorRefs.NoSender
                , isProvided: false
                , providedAt: 0
                , originRequester: ActorRefs.Nobody
                , dispoRequester: ActorRefs.Nobody
                , providerList: new List <FStockProvider>()
                , finishedAt: 0
                , remainingDuration: 0
                ).CreateProductionKeys.SetPrimaryKey);
 }
示例#24
0
 public OpenNode(T openNode, Quantity openQuantity, M_Article article)
 {
     _openNode     = openNode;
     _openQuantity = openQuantity;
     _article      = article;
 }
示例#25
0
        internal MasterTableArticle(MasterTableArticleType articleType, MasterTableUnit unit)
        {
            DUMP_TRUCK = new M_Article
            {
                Name         = "Dump-Truck", ArticleTypeId = articleType.PRODUCT.Id,
                CreationDate = DateTime.Parse(s: "2016-09-01"), DeliveryPeriod = 20, UnitId = unit.PIECES.Id,
                Price        = 45.00, ToPurchase = false, ToBuild = true, PictureUrl = "/images/Product/05_Truck_final.jpg"
            };

            RACE_TRUCK = new M_Article
            {
                Name          = "Race-Truck",
                ArticleTypeId = articleType.PRODUCT.Id,
                CreationDate  = DateTime.Parse(s: "2016-09-01"), DeliveryPeriod = 20,
                UnitId        = unit.PIECES.Id, Price = 45.00, ToPurchase = false,
                ToBuild       = true, PictureUrl = "/images/Product/06_Race-Truck_final.jpg"
            };

            SKELETON = new M_Article
            {
                Name          = "Skeleton",
                ArticleTypeId = articleType.ASSEMBLY.Id,
                CreationDate  = DateTime.Parse(s: "2016-09-01"), DeliveryPeriod = 10,
                UnitId        = unit.PIECES.Id, Price = 15.00, ToPurchase = false,
                ToBuild       = true, PictureUrl = "/images/Product/01_Bodenplatte.jpg"
            };

            TRUCK_BED = new M_Article
            {
                Name          = "Truck-Bed",
                ArticleTypeId = articleType.ASSEMBLY.Id,
                CreationDate  = DateTime.Parse(s: "2016-09-01"), DeliveryPeriod = 10,
                UnitId        = unit.PIECES.Id, Price = 15.00, ToPurchase = false,
                ToBuild       = true, PictureUrl = "/images/Product/03_Ladefläche.jpg"
            };

            CHASSIS_TYPE_DUMP = new M_Article
            {
                Name          = "Chassis Type: Dump",
                ArticleTypeId = articleType.ASSEMBLY.Id,
                CreationDate  = DateTime.Parse(s: "2016-09-01"), DeliveryPeriod = 10,
                UnitId        = unit.PIECES.Id, Price = 15.00, ToPurchase = false,
                ToBuild       = true, PictureUrl = "/images/Product/02_Gehäuse.jpg"
            };

            CHASSIS_TYPE_RACE = new M_Article
            {
                Name          = "Chassis Type: Race",
                ArticleTypeId = articleType.ASSEMBLY.Id,
                CreationDate  = DateTime.Parse(s: "2016-09-01"), DeliveryPeriod = 10,
                UnitId        = unit.PIECES.Id, Price = 20.00, ToPurchase = false,
                ToBuild       = true, PictureUrl = "/images/Product/08_Race-Truck_Chassie.jpg"
            };

            RACE_WING = new M_Article
            {
                Name          = "Race Wing",
                ArticleTypeId = articleType.ASSEMBLY.Id,
                CreationDate  = DateTime.Parse(s: "2016-09-01"), DeliveryPeriod = 5,
                UnitId        = unit.PIECES.Id, Price = 5.00, ToPurchase = false,
                ToBuild       = true, PictureUrl = "/images/Product/07_Race-Wing.jpg"
            };

            CABIN = new M_Article
            {
                Name          = "Cabin",
                ArticleTypeId = articleType.ASSEMBLY.Id,
                CreationDate  = DateTime.Parse(s: "2002-09-01"), DeliveryPeriod = 10,
                UnitId        = unit.PIECES.Id, Price = 1.75, ToPurchase = false,
                ToBuild       = true
            };

            ENGINE_BLOCK = new M_Article
            {
                Name          = "Engine-Block",
                ArticleTypeId = articleType.ASSEMBLY.Id,
                CreationDate  = DateTime.Parse(s: "2002-09-01"), DeliveryPeriod = 10,
                UnitId        = unit.PIECES.Id, Price = 3.00, ToPurchase = false,
                ToBuild       = true
            };

            // Truck Bed
            SIDEWALL_LONG = new M_Article
            {
                Name          = "Side wall long",
                ArticleTypeId = articleType.ASSEMBLY.Id,
                CreationDate  = DateTime.Parse(s: "2002-09-01"), DeliveryPeriod = 10,
                UnitId        = unit.PIECES.Id, Price = 0.35, ToPurchase = false,
                ToBuild       = true
            };

            SIDEWALL_SHORT = new M_Article
            {
                Name          = "Side wall short",
                ArticleTypeId = articleType.ASSEMBLY.Id,
                CreationDate  = DateTime.Parse(s: "2002-09-01"), DeliveryPeriod = 10,
                UnitId        = unit.PIECES.Id, Price = 0.25, ToPurchase = false,
                ToBuild       = true
            };

            BASEPLATE_TRUCK_BED = new M_Article
            {
                Name          = "Base plate Truck-Bed",
                ArticleTypeId = articleType.ASSEMBLY.Id,
                CreationDate  = DateTime.Parse(s: "2002-09-01"), DeliveryPeriod = 10,
                UnitId        = unit.PIECES.Id, Price = 0.40, ToPurchase = false,
                ToBuild       = true
            };

            DUMP_JOINT = new M_Article
            {
                Name          = "Dump Joint" /*Kippgelenk*/,
                ArticleTypeId = articleType.MATERIAL.Id,
                CreationDate  = DateTime.Parse(s: "2002-09-01"), DeliveryPeriod = 10,
                UnitId        = unit.PIECES.Id, Price = 0.90, ToPurchase = true,
                ToBuild       = false
            };

            // Engine Extension and Race Wing
            ENGINE_RACE_EXTENSION = new M_Article
            {
                Name         = "Engine Race Extension", ArticleTypeId = articleType.ASSEMBLY.Id,
                CreationDate = DateTime.Parse(s: "2002-09-01"), DeliveryPeriod = 10, UnitId = unit.PIECES.Id,
                Price        = 0.50, ToPurchase = false, ToBuild = true
            };
            // Skeleton
            WHEEL = new M_Article
            {
                Name         = "Wheel", ArticleTypeId = articleType.MATERIAL.Id,
                CreationDate = DateTime.Parse(s: "2002-09-01"), DeliveryPeriod = 10, UnitId = unit.PIECES.Id,
                Price        = 1.00, ToPurchase = true, ToBuild = false
            };

            BASE_PLATE = new M_Article
            {
                Name         = "Base plate", ArticleTypeId = articleType.ASSEMBLY.Id,
                CreationDate = DateTime.Parse(s: "2002-09-01"), DeliveryPeriod = 10, UnitId = unit.PIECES.Id,
                Price        = 0.80, ToPurchase = false, ToBuild = true
            };

            SEMITRAILER = new M_Article
            {
                Name         = "Semitrailer" /*Aufleger*/, ArticleTypeId = articleType.MATERIAL.Id,
                CreationDate = DateTime.Parse(s: "2002-09-01"), DeliveryPeriod = 10, UnitId = unit.PIECES.Id,
                Price        = 0.10, ToPurchase = true, ToBuild = false
            };

            WASHER = new M_Article
            {
                Name         = "Washer", ArticleTypeId = articleType.MATERIAL.Id,
                CreationDate = DateTime.Parse(s: "2002-09-01"), DeliveryPeriod = 10, UnitId = unit.KILO.Id,
                Price        = 0.02, ToPurchase = true, ToBuild = false
            };

            // base Materials
            TIMBER_PLATE = new M_Article
            {
                Name         = "Timber Plate 1,5m x 3,0m", ArticleTypeId = articleType.MATERIAL.Id,
                CreationDate = DateTime.Parse(s: "2002-09-01"), DeliveryPeriod = 5, UnitId = unit.PIECES.Id,
                Price        = 0.20, ToPurchase = true, ToBuild = false
            };

            TIMBER_BLOCK = new M_Article
            {
                Name         = "Timber Block 0,20m x 0,20m", ArticleTypeId = articleType.MATERIAL.Id,
                CreationDate = DateTime.Parse(s: "2002-09-01"), DeliveryPeriod = 5, UnitId = unit.PIECES.Id,
                Price        = 0.70, ToPurchase = true, ToBuild = false
            };

            GLUE = new M_Article
            {
                Name         = "Glue", ArticleTypeId = articleType.CONSUMABLE.Id,
                CreationDate = DateTime.Parse(s: "2002-09-01"), DeliveryPeriod = 10, UnitId = unit.LITER.Id,
                Price        = 0.01, ToPurchase = true, ToBuild = false
            };

            PEGS = new M_Article
            {
                Name         = "Pegs", ArticleTypeId = articleType.CONSUMABLE.Id,
                CreationDate = DateTime.Parse(s: "2005-09-01"), DeliveryPeriod = 3, UnitId = unit.KILO.Id,
                Price        = 0.01, ToPurchase = true, ToBuild = false
            };

            POLE = new M_Article
            {
                Name         = "Pole", ArticleTypeId = articleType.MATERIAL.Id,
                CreationDate = DateTime.Parse(s: "2002-09-01"), DeliveryPeriod = 10, UnitId = unit.PIECES.Id,
                Price        = 0.25, ToPurchase = true, ToBuild = false
            };

            BUTTON = new M_Article
            {
                Name         = "Button", ArticleTypeId = articleType.MATERIAL.Id,
                CreationDate = DateTime.Parse(s: "2002-09-01"), DeliveryPeriod = 10, UnitId = unit.KILO.Id,
                Price        = 0.05, ToPurchase = true, ToBuild = false
            };

            PACKING = new M_Article
            {
                Name         = "Packing", ArticleTypeId = articleType.CONSUMABLE.Id,
                CreationDate = DateTime.Parse(s: "2005-09-01"), DeliveryPeriod = 4, UnitId = unit.KILO.Id,
                Price        = 2.15, ToPurchase = true, ToBuild = false
            };

            USER_MANUAL = new M_Article
            {
                Name         = "User Manual", ArticleTypeId = articleType.CONSUMABLE.Id,
                CreationDate = DateTime.Parse(s: "2005-09-01"), DeliveryPeriod = 4, UnitId = unit.KILO.Id,
                Price        = 0.50, ToPurchase = true, ToBuild = false
            };
        }