Example #1
0
        override public void CreateNewCustomer()
        {
            if (_isExistingCustomer)
            {
                throw new Exception("Create New Customer may only be called for a new customer");
            }

            // create a random 4 digit PIN
            Random r         = new Random();
            string randomPIN = r.Next(1000, 11000).ToString();

            // set the PIN, and create the customerInfo
            _pin = randomPIN;
            CustomerInformation customerInfo = CreateCustomerInformation();

            // creating a customer might fail due to Name or SSN, but we do not
            // need to do anything about it
            //_clientContextObj.DeleteContext("CONNTYPE", ref _contextArray);
            _clientContextObj.ConnectionUsage = ConnectionTypes.NonPersistent;
            _Handler.CreateCustomer(_name, customerInfo, ref _clientContextObj);

            // say this is now an existing customer
            _isExistingCustomer = true;
        }