Exemplo n.º 1
0
        private void dataGridViewProductStock_RowEnter(object sender, DataGridViewCellEventArgs e)
        {
            string       ArticleCode  = (dataGridViewProductStock.Rows[e.RowIndex].DataBoundItem as StorageSystemArticleInformation).Code;
            StockProduct stockProduct = this.simulatorCore.Stock.GetStockProduct(ArticleCode);

            dataGridViewPackStock.DataSource = new BindingSource(stockProduct.GetPackList(""), "");
        }
Exemplo n.º 2
0
 private void dataGridViewProductStock_RowsAdded(object sender, DataGridViewRowsAddedEventArgs e)
 {
     for (int index = e.RowIndex; index <= e.RowIndex + e.RowCount - 1; index++)
     {
         string       ArticleCode  = (dataGridViewProductStock.Rows[index].DataBoundItem as StorageSystemArticleInformation).Code;
         StockProduct stockProduct = this.simulatorCore.Stock.GetStockProduct(ArticleCode);
         dataGridViewProductStock.Rows[index].Cells["dataGridViewTextBoxColumnStockListPackCount"].Value = stockProduct.GetPackList("").Count;
     }
 }
Exemplo n.º 3
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();
            }
        }
Exemplo n.º 4
0
        private void dataGridViewPackStock_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex == -1)
            {
                return;
            }

            RobotPack selectedPack = (dataGridViewPackStock.Rows[e.RowIndex].DataBoundItem as RobotPack);

            if (e.ColumnIndex == this.ColumnStockOutputPack.Index)
            {
                this.simulatorCore.OutputCore.DirectOutput(selectedPack);
            }

            if (e.ColumnIndex == this.ColumnStockDeletePack.Index)
            {
                StockProduct stockProduct = this.simulatorCore.Stock.GetStockProduct(selectedPack.RobotArticleCode);
                stockProduct.RemoveItem(selectedPack);
                List <RobotPack> productPackList = stockProduct.GetPackList("");
                this.UpdateDataGridView(dataGridViewPackStock, productPackList);

                dataGridViewProductStock.CurrentRow.Cells["dataGridViewTextBoxColumnStockListPackCount"].Value = productPackList.Count;
            }
        }
Exemplo n.º 5
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();
        }