Beispiel #1
0
        /// <summary>
        /// enables or disables the text boxes based on whether or not
        /// the preceeding identifiers were toggled on the PaymentAndCustomerType form,
        /// also disables the proceedButton to force the user to calculate customer's change
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void PaymentCalculator_Load(object sender, EventArgs e)
        {
            proceedButton.Enabled = false;
            if (GlobalUtilities.getCashPaymentIdentifier() != true)
            {
                cashTextBox.ReadOnly = true;
            }

            if (GlobalUtilities.getCreditPaymentIdentifier() != true)
            {
                creditTextBox.ReadOnly = true;
            }

            if (GlobalUtilities.getDebitPaymentIdentifier() != true)
            {
                debitTextBox.ReadOnly = true;
            }

            if (GlobalUtilities.getCheckPaymentIdentifier() != true)
            {
                checkTextBox.ReadOnly = true;
            }

            if (GlobalUtilities.getSalaryDeductionPaymentIdentifier() != true)
            {
                salaryDeductionTextBox.ReadOnly = true;
            }

            totalAmountTextBox.Text = String.Format("{0:n}", GlobalUtilities.getTotalCost());
            changeTextBox.Text      = "0";
        }