Example #1
0
        private void btnToal_Click(object sender, EventArgs e)
        {
            cTax cost = new cTax();

            if (txtQuantity.Text == "")
            {
                MessageBox.Show("Enter quantity", "Sales Inventory System", MessageBoxButtons.OK, MessageBoxIcon.Question);

                txtQuantity.Focus();
            }
            else
            {
                cost.item1 = double.Parse(txtQuantity.Text);

                iSubTotal = cost.GetAmount();
                iTax      = cost.cFindTax(iSubTotal);
                iTotal    = iSubTotal + iTax;

                txtTax.Text      = string.Format("{0:C}", iTax);
                txtTotal.Text    = string.Format("{0:C}", iTotal);
                txtSubTotal.Text = string.Format("{0:C}", iSubTotal);

                txtTax.BackColor = Color.Azure;
            }
        }
Example #2
0
        private void totalButton_Click(object sender, EventArgs e)
        {
            cTax cost = new cTax();

            cost.item1 = double.Parse(txtQuantity.Text);

            iSubTotal = cost.GetAmount();
            iTax      = cost.cFindTax(iSubTotal);

            iTotal = iSubTotal + iTax;

            txtTax.Text      = String.Format("{0:C}", iTax);
            txtSubTotal.Text = String.Format("{0:C}", iSubTotal);
            txtTotal.Text    = String.Format("{0:C}", iTotal);

            txtTax.BackColor = Color.Azure;
        }