Exemplo n.º 1
0
        public void LoadInput(string articleCode,
                              string articleName,
                              string articleDosageForm,
                              string articlePackagingUnit,
                              int articleMaxSubItemQuantity,
                              string batchNumber,
                              string externalID,
                              DateTime expiryDate,
                              int subItemQuantity,
                              string machineLocation,
                              string tenantID,
                              string stockLocationInfoID,
                              bool updateUI = true)
        {
            // 1 add Item to the stock.
            StockProduct currentStockProduct = this.GetStockProduct(articleCode);
            RobotPack    pack = new RobotPack();

            pack.RobotArticleCode = articleCode;
            pack.ID     = this.GetNextPackID();
            pack.Depth  = 60;
            pack.Height = 60;
            pack.Width  = 60;
            pack.Shape  = PackShape.Cuboid;

            pack.BatchNumber     = batchNumber;
            pack.ExternalID      = externalID;
            pack.ExpiryDate      = expiryDate;
            pack.SubItemQuantity = subItemQuantity;
            pack.MachineLocation = machineLocation;
            pack.StockLocationID = stockLocationInfoID;
            pack.TenantID        = tenantID;
            currentStockProduct.AddItem(pack);

            // 2 update Article Information
            StorageSystemArticleInformation currentArticleInformation =
                this.articleInformationList.GetArticleInformation(articleCode, true);

            currentArticleInformation.Name               = articleName;
            currentArticleInformation.DosageForm         = articleDosageForm;
            currentArticleInformation.PackagingUnit      = articlePackagingUnit;
            currentArticleInformation.MaxSubItemQuantity = articleMaxSubItemQuantity;

            // 3 forward stock update Event.
            if (updateUI)
            {
                this.DoStockUpdated();
            }
        }
        public StorageSystemArticleInformation GetArticleInformation(string productCode, bool createIfMissing)
        {
            if (this.acticleList.ContainsKey(productCode))
            {
                return(this.acticleList[productCode]);
            }
            else
            {
                if (createIfMissing)
                {
                    StorageSystemArticleInformation newArticle = new StorageSystemArticleInformation();
                    newArticle.Code = productCode;
                    this.acticleList.Add(productCode, newArticle);
                    return(newArticle);
                }
            }

            return(null);
        }
Exemplo n.º 3
0
        public void LoadInput(StockInputResponse inputResponse)
        {
            // 1 add Item to the stock.
            for (int i = 0; i < inputResponse.Packs.Count; i++)
            {
                StockProduct currentStockProduct = this.GetStockProduct(inputResponse.Packs[i].RobotArticleCode);
                inputResponse.Packs[i].ID = this.GetNextPackID();
                currentStockProduct.AddItem(inputResponse.Packs[i]);
            }

            // 2 update Article Information
            for (int i = 0; i < inputResponse.Articles.Count; i++)
            {
                StorageSystemArticleInformation currentArticleInformation =
                    this.articleInformationList.GetArticleInformation(inputResponse.Articles[i].Code, true);
                currentArticleInformation.Name               = inputResponse.Articles[i].Name;
                currentArticleInformation.DosageForm         = inputResponse.Articles[i].DosageForm;
                currentArticleInformation.PackagingUnit      = inputResponse.Articles[i].PackagingUnit;
                currentArticleInformation.MaxSubItemQuantity = inputResponse.Articles[i].MaxSubItemQuantity;
            }

            // 3 forward stock update Event.
            this.DoStockUpdated();
        }