By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,341 Members | 1,436 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,341 IT Pros & Developers. It's quick & easy.

How can I create group logic with class?

P: n/a
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
Nov 15 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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

"Migrant" <mi*****@hotmail.com> wrote in message news:<eT**************@tk2msftngp13.phx.gbl>...
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

Nov 15 '05 #2

P: n/a
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 :)))

"Glen Jones" <gl********@hotmail.com>, haber iletisinde sunlari
yazdi:ba**************************@posting.google. com...
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

"Migrant" <mi*****@hotmail.com> wrote in message

news:<eT**************@tk2msftngp13.phx.gbl>...
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

Nov 15 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.