private void btnSaveOut_Click(object sender, EventArgs e) { double tps = Convert.ToDouble(txtStockOut.Text) * Convert.ToDouble(txtPriceOut.Text); try { MySqlConnection con = new MySqlConnection("Server=localhost;UID=root;Database=db_cignal"); con.Open(); MySqlCommand command = con.CreateCommand(); command.CommandText = "update inventoryOut set Model=@Model,Stock=@Stock,Date=@Date,Price=@Price,TotalPrice=@Total where Product=@Product"; command.Parameters.AddWithValue("@Product", cbProductOut.SelectedItem.ToString()); command.Parameters.AddWithValue("@Model", txtModelOut.Text); command.Parameters.AddWithValue("@Stock", txtStockOut.Text); command.Parameters.AddWithValue("@Date", DateTime.Now); command.Parameters.AddWithValue("@Price", txtPriceOut.Text); command.Parameters.AddWithValue("@Total", tps.ToString()); command.Prepare(); command.ExecuteNonQuery(); BindGridInventoryOut(); ClearFieldsinInventoryOUT(); con.Close(); MessageBox.Show("Saved!"); } catch (Exception r) { MessageBox.Show(r.ToString()); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)