コード例 #1
0
        void updateProduct()
        {
            product = new Product()
            {
                Barcode     = txtBarcode.Text,
                Description = txtName.Text,
                UnitPrice   = Convert.ToDecimal(txtPrice.Text),
            };

            dbController.updateProduct(oldProduct, product);
            txtQuantity.Enabled = true;
            txtBarcode.Enabled  = true;

            toggle();
            clearTexts();
        }
コード例 #2
0
        void updateProduct()
        {
            if (MyExtension.Validation.isFilled(contentPanel))
            {
                int category_id = dbController.categoryMapper.getCategoryIndexFromName(cbCategory.Text);

                product = new Product()
                {
                    Barcode     = txtBarcode.Text,
                    Description = txtName.Text,

                    Warranty      = txtWarranty.Text,
                    Replacement   = txtReplacement.Text,
                    Specification = txtSpecs.Text,
                    Category_id   = category_id,
                };

                dbController.updateProduct(oldProduct, product);
                txtBarcode.Enabled = true;

                toggle();
                clearTexts();
            }
        }