Skip to content

Instantly share code, notes, and snippets.

@micahasmith
Created October 3, 2011 01:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save micahasmith/1258237 to your computer and use it in GitHub Desktop.
Save micahasmith/1258237 to your computer and use it in GitHub Desktop.
The Classic DAL in .NET
public class PeopleDAL
{
public DataSet Person_GetAll()
{
//Returns a DataSet containing all people records in the database.
}
public DataSet Person_GetByPersonID(int personID)
{
// Queries the database for the particular user identified by
// personID. If the user is located then the DataSet contains a
// single record corresponding to the requested user. If the user
// is not found then the DataSet does not contain any records.
}
public bool Person_Save(ref int personID, string fname, string lname, DateTime dob)
{
// Locates the record for the given personID. If the record exists,
// the method updates the record. If the record does not exist, the
// method adds the record and sets the personID variable equal to
// the identity value assigned to the new record. Then the method
// returns the value to the business layer because personID is
// marked with the ref modifier.
}
public int Person_DeleteInactive()
{
//Deletes all inactive people in the database and returns a value
//indicating how many records were deleted.
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment