How can I create group logic with class?

  • Thread starter Thread starter Migrant
  • Start date Start date
M

Migrant

Hi Friends;

I want develop a group logic with C# (n tier refraction).I know I must
create a Class and inherit it But I don't have enough know-how about develop
classes. Somebody can help me?

An Example For My Group Logic:

102 Banks
102.01 Credit Banks
102.01.01 Abn Ambro
102.01.01.001 Center Subsidiary
102.01.01.002 Miami Subsidiary
102.01.02 FinanceBank
102.01.02.001 Center Subsidiary
102.01.02.002 Miami Subsidiary

......

Note : We learn sub item via dots. For eample 102.01 Credit Banks is sub
item of 102 Banks

Thank you for interested people.

Arda Han
 
Migrant,

If I understand your question, you want to create classes from a base
class and a way to create the highest level class from an IP address.

You can do this so many ways with objects, it just depends on the
functionality you need. Here is one way to make the hierarchy you
listed.

// Create the base class
public class Company
{
// Add Properties and Methods needed by each derived class

// One example could be CompanyName
// i.e. returns "Abn Ambro", "Finance Bank"
}

// Create a class for a Bank
public class Bank : Company
{
// Add a property to get the type name
// i.e. returns "CreditBank", "DebtBank"
}

// Create a Utility class
public class IPBusinessConverter
{
public Bank GetBankFromIP( string strIP )
{
Bank objBank = new Bank();

// This could call many methods based on the octets
// But here is all in one example
switch( strIP )
{
case "102.01.01.002":// Miami Subsidiary
// Create the Bank, Parent Company, Bank Type
...
}
}
}

Wow hard than I thought to create a class structure with out what you
need the classes to do, but hopefully this will help you decide what
to do.

Good Luck,
Glen Jones MCSD
 
It isn't for IP. It is for Account numbers for customers.
Your idea good but I remember a algorithm method from my engineering school
days :)) I think I must create a unique group elements ID and their Parent
ID. If it is true I can create it. But I want develop this algoritm with
class method. But I don't have enough know-how for this.

Somebody can help me?

Best wishes.

Migrant From Delphi :)))
 
Back
Top