Skip to content

Instantly share code, notes, and snippets.

Created February 8, 2011 02:07
Show Gist options
  • Save anonymous/815709 to your computer and use it in GitHub Desktop.
Save anonymous/815709 to your computer and use it in GitHub Desktop.
// -------------------------------------
// - 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