|
-
Dec 10th, 2009, 03:52 PM
#11
Re: Constructive Criticism
We'll get to naming conventions later. Create a class PlayerDAL.cs. Create a class PlayerBL.cs
In PlayerDAL.cs
static DataSet GetPlayers(int teamID)
{
//Call database
//Fill dataset
//Return dataset
}
In PlayerBL.cs
static List<Player> GetPlayers(Team team)
{
DataSet ds = PlayerDAL.GetPlayers(team.TeamID);
//Loop through dataset
//Create player objects
//Add to list
//Return list
}
From your page,
PlayerBL.GetPlayers(tm2);
OK, so that's one way. Another preference is to have the DAL method return List<Player> and have the BL class method deal with it or do any additional processing if required and then return List<Player>.
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
|