Beispiel #1
0
        private void txtQuantidade_TextChanged(object sender, EventArgs e)
        {
            int x = Convert.ToInt32(txtQuantidade.Text);

            if (x < 0 && txtIdProduto.Text != "")
            {
                Camadas.BLL.Produto bllProd = new Camadas.BLL.Produto();
                string msg  = "Excedeu a quantidade de Produtos!";
                int    id   = Convert.ToInt32(txtIdProduto.Text);
                string qtde = bllProd.qtdeProduto(id).ToString();
                MessageBox.Show(msg, "Aviso!", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                txtQuantidade.Text = qtde;
            }
        }
Beispiel #2
0
        private void cmbProduto_SelectedIndexChanged(object sender, EventArgs e)
        {
            txtIdProduto.Text = cmbProduto.SelectedValue.ToString();

            Camadas.BLL.Produto bllProd = new Camadas.BLL.Produto();
            int id = Convert.ToInt32(txtIdProduto.Text);

            txtValorUnitario.Text = bllProd.BuscaValor(id).ToString();
            txtQuantidade.Text    = bllProd.qtdeProduto(id).ToString();

            int TAM = Convert.ToInt32(txtQuantidade.Text);

            cmbQuantidade.DataSource = estoque(TAM);
        }