|
/*
* Product Business Object
*/
using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
//Mapping Information
[MapInfo("ProductID", "ID")]
[MapInfo("Name", "Name")]
[MapInfo("ProductNumber", "Code")]
[MapInfo("FinishedGoodsFlag", "Finished")]
[MapInfo("Color", "Color")]
[MapInfo("StandardCost", "Cost")]
[MapInfo("Size", "Size")]
[MapInfo("ModifiedDate", "ModifiedDate")]
public class Product : AWBase
{
private int id;
private string name;
private string code;
private bool finished;
private string color;
private decimal cost;
private string size;
private DateTime modifiedDate;
//Properties
public int ID
{
get { return id; }
set { id = value; }
}
public string Name
{
get { return name; }
set { name = value; }
}
public string Code
{
get { return code; }
set { code = value; }
}
public bool Finished
{
get { return finished; }
set { finished = value; }
}
public string Color
{
get { return color; }
set { color = value; }
}
public decimal Cost
{
get { return cost; }
set { cost = value; }
}
public string Size
{
get { return size; }
set { size = value; }
}
public DateTime ModifiedDate
{
get { return modifiedDate; }
set { modifiedDate = value; }
}
//explict casting
public Product AWBaseToProduct(AWBase pAWBase)
{
return (Product)pAWBase;
}
//Get Products
public List<Product> GetProducts()
{
base.SqlSelectString = "select * from Production.Product";
base.BusObjectType = this.GetType();
List<AWBase> list = base.LoadData();
return list.ConvertAll<Product>(new Converter<AWBase,Product>(AWBaseToProduct));
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.
A list of licenses authors might use can be found here
MCSD.NET Early Achiever,MCDBA SQL 2000,MCITP SQL 2005 Charter Member,MCPD Charter Member