Ejemplo n.º 1
0
        private void productComboBox_TextChanged(object sender, EventArgs e)
        {
            _purchase = _purchaseManager.LastPurchaseInfo(Convert.ToInt32(productComboBox.SelectedValue));

            availableQuantityTextBox.Text =
                _purchaseManager.AvailableQuantity(Convert.ToInt32(productComboBox.SelectedValue)).ToString();

            priceTextBox.Text = _purchase.MRP.ToString();
            quantityTextBox.ResetText();
            totalMRPTextBox.ResetText();
        }
        private void GetTotalAvailableQuantity()
        {
            //availableQuantityTextBox.Text = null;

            int quantity = GetPurchaseQuantity();

            PurchaseItems purchase_ = new PurchaseItems();

            purchase_.CategoryId = Convert.ToInt32(categoryComboBox.SelectedValue);
            purchase_.ProductId  = Convert.ToInt32(productsComboBox.SelectedValue);

            int avail = _PurchaseManager.AvailableQuantity(purchase_);

            int totalQuantity = avail + quantity;

            //availableQuantity = availableQuantity + totalQuantity;

            availableQuantityTextBox.Text = totalQuantity.ToString();
        }
Ejemplo n.º 3
0
        private void productComboBox_TextChanged(object sender, EventArgs e)
        {
            if (Convert.ToInt32(productComboBox.SelectedValue) > 0)
            {
                product = _productManager.SearchProductById(Convert.ToInt32(productComboBox.SelectedValue));
                Purchase purchase = _purchaseManager.LastPurchaseInfo(Convert.ToInt32(productComboBox.SelectedValue));
                int      qty      = _purchaseManager.AvailableQuantity(Convert.ToInt32(productComboBox.SelectedValue));

                codeTextBox.Text = product.Code;
                previousUnitPriceTextBox.Text = purchase.UnitPrice.ToString();
                previousMRPTextBox.Text       = purchase.MRP.ToString();
                availableQuantityTextBox.Text = qty.ToString();
            }
            else
            {
                codeTextBox.ResetText();
                availableQuantityTextBox.ResetText();
                previousUnitPriceTextBox.ResetText();
                previousMRPTextBox.ResetText();
            }

            productErrorLabel.ResetText();
        }