Created
May 26, 2011 13:10
-
-
Save driscollwebdev/993105 to your computer and use it in GitHub Desktop.
Interface article sample code 3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class PerishableItem : IProduct | |
{ | |
#region IProduct Interface Data Members | |
public string Name { get; set; } | |
public double Price { get; set; } | |
public double UnitPrice { get; set; } | |
public uint SKU { get; set; } | |
#endregion | |
//Omitted Code... it's the same as above | |
} | |
class NonPerishableItem : IProduct | |
{ | |
#region IProduct Interface Data Members | |
string Name { get; set; } | |
double Price { get; set; } | |
double UnitPrice { get; set; } | |
uint SKU { get; set; } | |
#endregion | |
} | |
class Scanner | |
{ | |
public void Scan(IProduct item) | |
{ | |
///TODO: Update the inventory database | |
///TODO: Add the price of this item to the order subtotal | |
} | |
public void CancelScan(IProduct item) | |
{ | |
///TODO: Update the inventory database | |
///TODO: Subtract the price of this item from the order subtotal | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment