Example #1
0
        override public void CreateNewAccount(AccountType accountType)
        {
            if (!_isExistingCustomer)
            {
                throw new Exception("New Accounts may only be created for an existing customer");
            }

            object oDescription;
            string accountTypeString;

            ACCT_TYPE_SAV ats = new ACCT_TYPE_SAV();
            ACCT_TYPE_CHK atc = new ACCT_TYPE_CHK();

            // if this is savings
            if (accountType == AccountType.Savings)
            {
                accountTypeString = "S";

                ats.ACCT_SAVE_BAL      = 0.0M;
                ats.ACCT_SAVE_INT_RATE = 2.5M;
                ats.ACCT_SAVE_SVC_CHRG = 1.0M;

                oDescription = ats;
            }
            else
            {
                accountTypeString = "C";

                atc.ACCT_CHK_OD_CHG   = 1;
                atc.ACCT_CHK_OD_LIMIT = 1000;
                atc.ACCT_CHK_BAL      = 0;

                oDescription = atc;
            }
            //_clientContextObj.DeleteContext("CONNTYPE", ref _contextArray);
            _clientContextObj.ConnectionUsage = ConnectionTypes.NonPersistent;
            string newNumber = _Handler.CreateAccount(_name, accountTypeString, oDescription, ref _clientContextObj);

            // add the new Number to the list of Accounts
            if (_accountNumbers == null)
            {
                _accountNumbers = new string[1];
            }
            else
            {
                Array.Resize(ref _accountNumbers, _accountNumbers.Length + 1);
            }
            _accountNumbers[_accountNumbers.Length - 1] = newNumber;
        }