Paul Clapham wrote:I would rewrite that logic to something like this:
"If the customer is already in the file, then
... (something)
else
write the customer record with the data from the parameters."
Now what's that something?
"If the name from the forum is not empty, then
... update the customer record with the data from the parameters."
That takes care of the database part of your requirements. Try to get that working first.
Here is how I have it working, which I think covers what you were saying.
Scenario 1
1. user enters a customerid
2. if the customerid exists
3. and the user has NOT entered a new name and address
4. use the name and address stored in the db record
Scenario 2
1. user enters a customerid
2. if the customerid exists
3. and the user has entered a new name and address
4. update the db to reflect the new name and address for that user
Scenario 3
1. user enters a customerid
2. if the customerid does NOT exist
3. create a new record of the user
The issue I am having is on getting Scenario 3 to work when combined with 1 and 2. I have 1 and 2 working perfectly together, and 3 working perfectly on it's own, but when I put the 3 together, Scenario 3 no longer works.