Hi!
i have a class "user" with 3 properties: userIid, userName, userEmail and
another class that is a collection of users "userCollection":
namespace meta01.colecciones
{
public class userCollection: System.Collections.CollectionBase
{
public userCollection()
{
}
public user this[ int index ]
{
get
{
return( (user) List[index] );
}
set
{
List[index] = value;
}
}
public void add(user oUser)
{
List.Add(oUser);
}
public void remove(user value)
{
List.Remove(value);
}
public user getUser(int i)
{
return (user)List[i];
}
public int IndexOf( user value )
{
return (List.IndexOf(value)) ;
}
public void Insert(int index, user value)
{
this.List.Insert(index, value);
}
}
}
In my webform i create some users like this:
oUserCollection.add(new user(1,"user1","11*@or.com"));
oUserCollection.add(new user(2,"user2","22*@or.com"));
oUserCollection.add(new user(3,"user3","33*@or.com"));
oUserCollection.add(new user(4,"user4","44*@or.com"));
I can list the contents of the collection but how can i get an user by its
userID.
If i want the details of user1 how can i get them???
There's a better way of doing this??
Thank you very much.