I can not find a solution for inventory and sales management.
The scenario would be a Stock of Autoparts, where I register the entry of a product into stock with a certain quantity.
cod - name - qtd - vlr
3239 - Water pump - 2 - R $ 300,00
and soon I want to add another 3 quantities of the same item totaling 5 Water Pump items, or reducing quantities as sales are made.
maybe some IF, FOR, COLLECTION
Ex:
If (cod == cod)
{
++1 qtd
}
I have an Access database, I am accessing directly in the database without being DataSet:
An example of how I am writing the data today in db:
OleDbConnection Con = new OleDbConnection();
Con.ConnectionString = Properties.Settings.Default.dbqtd;
Con.Open();
OleDbCommand Cmm = new OleDbCommand();
Cmm.CommandText = "INSERT INTO estoque (codproduto, nome, qtd, local, numero) VALUES (?, ?, ?, ?, ?) ";
Cmm.Parameters.Clear();
Cmm.Parameters.Add("@codproduto", OleDbType.VarChar, 50).Value = txtCodProd.Text;
Cmm.Parameters.Add("@nome", OleDbType.VarChar, 50).Value = txtNome.Text;
Cmm.Parameters.Add("@qtd", OleDbType.VarChar,50).Value = txtQtd.Text;
Cmm.Parameters.Add("@local", OleDbType.VarChar, 50).Value = txtLocal.Text;
Cmm.Parameters.Add("@numero", OleDbType.VarChar, 50).Value = txtNumero.Text;
Cmm.CommandType = CommandType.Text;
Cmm.Connection = Con;
Cmm.ExecuteNonQuery();
MessageBox.Show("Inclusão efetuada com Sucesso !");