|
-
November 16th, 2010, 01:17 PM
#1
Bank project- link accounts to different customers?
Hi,
I'm trying to link bank accounts to customers that are in a customerlist.
At the moment i have a customerlist which contains the name of the customer and their id.
it is a console application and I have to do it by switch statement cases - and so the case "openaccount" should therefore open an account for the given customer id.
I have a base class and all the different accounts e.g. savings, taxfree etc all inherit from this class.
an example of how my "addcustomer" is shown below:
case "addcustomer":
String name = arguments[1];
bool error2 = false;
foreach (Customers x in customerList)
{
if (name.Equals(x.getName()))
{
Console.WriteLine("Error:" + ErrorCodes.CustomerAlreadyExists);
error2 = true;
}
}
string l= "1";
Convert.ToInt32(l);
if (error2 == false)
{
Customers customer = new Customers(name);
customerList.Add(customer);
Console.WriteLine(customer.GetID());
}
break;
any help would REALLY be appreciated as i have been stuck on this for the past week now.
thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|