2011-01-22 12:38:30 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Runtime.Serialization;
|
2011-01-31 20:33:22 +00:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using Tanshu.Accounts.Contracts;
|
2014-10-12 09:41:45 +00:00
|
|
|
|
using NHibernate.Mapping.ByCode.Conformist;
|
|
|
|
|
using NHibernate.Mapping.ByCode;
|
2011-01-22 12:38:30 +00:00
|
|
|
|
|
2011-01-30 07:14:05 +00:00
|
|
|
|
namespace Tanshu.Accounts.Entities
|
2011-01-22 12:38:30 +00:00
|
|
|
|
{
|
2011-01-30 07:14:05 +00:00
|
|
|
|
public class Modifier
|
2011-01-22 12:38:30 +00:00
|
|
|
|
{
|
2014-10-16 11:11:55 +00:00
|
|
|
|
public Modifier()
|
|
|
|
|
{
|
|
|
|
|
ProductGroupModifiers = new List<ProductGroupModifier>();
|
|
|
|
|
InventoryModifiers = new List<InventoryModifier>();
|
|
|
|
|
}
|
2014-10-12 09:41:45 +00:00
|
|
|
|
public virtual Guid ModifierID { get; set; }
|
2011-01-30 07:14:05 +00:00
|
|
|
|
public virtual string Name { get; set; }
|
2014-10-12 09:41:45 +00:00
|
|
|
|
public virtual bool ShowInBill { get; set; }
|
|
|
|
|
public virtual decimal Price { get; set; }
|
2011-01-30 07:14:05 +00:00
|
|
|
|
|
2011-01-31 20:33:22 +00:00
|
|
|
|
public virtual IList<ProductGroupModifier> ProductGroupModifiers { get; set; }
|
2014-10-12 09:41:45 +00:00
|
|
|
|
public virtual IList<InventoryModifier> InventoryModifiers { get; set; }
|
|
|
|
|
}
|
|
|
|
|
public class ModifierMap : ClassMapping<Modifier>
|
|
|
|
|
{
|
|
|
|
|
public ModifierMap()
|
2011-01-30 07:14:05 +00:00
|
|
|
|
{
|
2014-10-12 09:41:45 +00:00
|
|
|
|
Table("Modifiers");
|
|
|
|
|
Schema("dbo");
|
|
|
|
|
Lazy(true);
|
|
|
|
|
Id(x => x.ModifierID, m => m.Generator(Generators.GuidComb));
|
|
|
|
|
Property(x => x.Name, map => { map.NotNullable(true); map.Unique(true); });
|
|
|
|
|
Property(x => x.ShowInBill, map => { map.NotNullable(true); });
|
|
|
|
|
Property(x => x.Price, map => { map.NotNullable(true); });
|
|
|
|
|
Bag(x => x.InventoryModifiers, colmap => { colmap.Key(x => x.Column("ModifierID")); colmap.Inverse(true); }, map => { map.OneToMany(); });
|
|
|
|
|
Bag(x => x.ProductGroupModifiers, colmap => { colmap.Key(x => x.Column("ModifierID")); colmap.Inverse(true); }, map => { map.OneToMany(); });
|
2011-01-30 07:14:05 +00:00
|
|
|
|
}
|
2011-01-22 12:38:30 +00:00
|
|
|
|
}
|
|
|
|
|
}
|