private void btnCancel_Click(object sender, EventArgs e) { this.Hide(); frmTransaction openTransactions = new frmTransaction(lblWelcome.Text, txtCode.Text, txtQuantity.Text, txtDescription.Text, txtUnitPrice.Text, txtTotalPrice.Text, lblItemID.Text, lblBaseQuantity.Text); openTransactions.ShowDialog(); }
private void button2_Click(object sender, EventArgs e) { this.Hide(); frmTransaction openTransaction = new frmTransaction(lblWelcome.Text, txtCode.Text, comboBox1.Text, txtItem.Text, txtPrice.Text, txtTotalPrice.Text, lblItemID.Text, lblBaseQuantity.Text); openTransaction.ShowDialog(); }
private void pictureBox5_Click(object sender, EventArgs e) { this.Close(); this.Hide(); frmTransaction openTransaction = new frmTransaction(lblWelcome.Text, lblItemCode.Text, lblQuantity.Text, lblDescription.Text, lblUnitPrice.Text, txtTotalPrice.Text, lblItemID.Text, lblBaseQuantity.Text); openTransaction.ShowDialog(); }
private void button2_Click(object sender, EventArgs e) { try { int quantity = int.Parse(lblBaseQuantity.Text); int removeStocks = int.Parse(lblQuantity.Text); int total = quantity - removeStocks; connection.Open(); OleDbCommand command = new OleDbCommand(); command.Connection = connection; string query = "update ItemData set Quantity = '" + total + "' where ItemID = " + lblItemID.Text + " "; command.CommandText = query; command.ExecuteNonQuery(); MessageBox.Show("Transaction Complete.", "Message"); connection.Close(); } catch (Exception ex) { MessageBox.Show("Error " + ex); connection.Close(); } lblDescription.Text = ""; lblUnitPrice.Text = ""; lblQuantity.Text = ""; lblTotal.Text = ""; lblItemID.Text = ""; lblBaseQuantity.Text = ""; lblItemCode.Text = ""; this.Hide(); frmTransaction openTransaction = new frmTransaction(lblWelcome.Text, lblItemCode.Text, lblQuantity.Text, lblDescription.Text, lblUnitPrice.Text, txtTotalPrice.Text, lblItemID.Text, lblBaseQuantity.Text); openTransaction.ShowDialog(); }