Class wwBusiness<EntityType>

A generic implementation of the wwBusiness class that provides for an Entity type which is passed in as a generic parameter. This class exposes the type passed as the entity type that is created to expose the fields of the underlying database record in the DataRow member as strongly typed properties.

busCustomer Customer = new busCustomer() Customer.Load(3); Customer.Entity.Firstname = "Rick Jr. II"; Customer.Entity.LastOrder = DateTime.Now; Customer.Save();

Entity objects can be easily read from and assigned in code.

System.Object
  Westwind.BusinessObjects.wwBusiness
    Westwind.BusinessObjects.wwBusiness&lt;EntityType&gt;

public class wwBusiness<EntityType> : wwBusiness

Class Members

MemberDescription
Constructor
GetDetailList Returns a List of Entity objects from a DataTable or the current datatable if the table passed is null. This method essentially provides strongly typed access to data even if the data does not match the exact table structure.
public virtual List<EntityType> GetDetailList( DataTable dt );
LoadEntity Loads an entity object without loading up a DataRow. More efficient to load this way since no DataSet is involved, but since there's no DataRow any DataRow features cannot be used
public virtual bool LoadEntity( int Pk );

public virtual bool LoadEntity( string Pk );

public virtual bool LoadEntity( Guid Pk );

LoadEntityBase Base method that can be used to execute a Sql Statement to grab and entity instance.
public virtual bool LoadEntityBase( string Sql,
IDbDataParameter[] Parameters );
SaveEntity Saves the Entity to disk without using a DataRow.
public virtual bool SaveEntity();

public virtual bool SaveEntity( EntityType Entity );

Entity A strongly typed representation of the currently active DataRow object on the business object. The type of the Entity property is determined by the generic parameter set on the business object:

Requirements

Namespace: Westwind.BusinessObjects
Assembly: westwind.businessobjects.dll


 Last Updated: 3/7/2007 | Send topic feedback