-
-
Save Azerothian/815714 to your computer and use it in GitHub Desktop.
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
// ------------------------------------- | |
// - Branches Table Mapping - Branches.cs | |
// ------------------------------------- | |
// Initial Table Mapping - 01.02.2011 - B Allen | |
using System; | |
using System.Collections.Generic; | |
using System.Data.Linq; | |
using System.Text; | |
using normist.data.Abstraction; | |
using NHibernate.Mapping.Attributes; | |
namespace normist.data.Tables | |
{ | |
[Serializable] | |
[Class(Table = "t_Suppliers", NameType = typeof(Supplier))] | |
public class Supplier : DataTableBase<Branch> | |
{ | |
private string _supplierID; | |
private string _supplierName; | |
private string _supplierStreetAddress; | |
[Property(TypeType = typeof(string), Name = "SupplierID", Length = 10, NotNull=true)] | |
public virtual string SupplierID { | |
get {return _supplierID;} | |
set { | |
if ((value ?? "").Length > 10) | |
throw new Exception("The Supplier ID is Too Long"); | |
_supplierID = value; | |
} | |
} | |
[Property(TypeType = typeof(string), Name = "SupplierName", Length = 50, NotNull=true)] | |
public virtual string SupplierName | |
{ | |
get { return _supplierName; } | |
set | |
{ | |
if ((value ?? "").Length > 50) | |
throw new Exception("The Supplier Name is Too Long"); | |
_supplierName = value; | |
} | |
} | |
[Property(TypeType = typeof(string), Name = "SupplierStreetAddress", Length = 50, NotNull=true)] | |
public virtual string SupplierAddress | |
{ | |
get { return _supplierStreetAddress; } | |
set | |
{ | |
if ((value ?? "").Length > 50) | |
throw new Exception("The Supplier Address Is Too Long"); | |
_supplierStreetAddress = value; | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment