Example #1
0
        /// <summary>
        /// Открытие формы для изменения склада, раздела или продукта.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void changeToolStripMenuItem_Click(object sender, EventArgs e)
        {
            TreeNode selectedNode = treeView.SelectedNode;

            if (selectedNode.Tag is StorageModel storageModel)
            {
                StorageForm storageForm = new StorageForm(selectedNode, storageModel, true)
                {
                    Owner = this
                };
                storageForm.ShowDialog();
            }

            if (selectedNode.Tag is SectionModel sectionModel)
            {
                SectionForm sectionForm = new SectionForm(selectedNode, sectionModel, true)
                {
                    Owner = this
                };
                sectionForm.ShowDialog();
            }

            if (selectedNode.Tag is ProductModel productModel)
            {
                ProductForm productForm = new ProductForm(selectedNode, productModel, true)
                {
                    Owner = this
                };
                productForm.ShowDialog();
            }

            UpdateListViewItems();
        }
Example #2
0
        /// <summary>
        /// Открытие формы для создания склада.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void createStorageInstanceToolStripMenuItem_Click(object sender, EventArgs e)
        {
            StorageForm storageForm = new StorageForm(treeView, false)
            {
                Owner = this
            };

            storageForm.ShowDialog();
        }