Feature: Added SortOrder to Inventory.

Chore: Settle Choices form greatly simplified.
Feature: Modifiers are now cached.
This commit is contained in:
tanshu
2014-11-10 16:36:49 +05:30
parent 3706d8eb1e
commit c52f382ec2
12 changed files with 247 additions and 130 deletions

View File

@ -16,6 +16,7 @@ namespace Tanshu.Accounts.Entities
public virtual Guid InventoryID { get; set; }
public virtual Kot Kot { get; set; }
public virtual int SortOrder { get; set; }
public virtual Product Product { get; set; }
public virtual decimal Quantity { get; set; }
public virtual decimal Price { get; set; }
@ -49,6 +50,7 @@ namespace Tanshu.Accounts.Entities
Schema("dbo");
Lazy(true);
Id(x => x.InventoryID, m => m.Generator(Generators.GuidComb));
Property(x => x.SortOrder, map => map.NotNullable(true));
Property(x => x.Quantity, map => map.NotNullable(true));
Property(x => x.Price, map => map.NotNullable(true));
Property(x => x.FullPrice, map => map.NotNullable(true));

View File

@ -69,7 +69,12 @@ namespace Tanshu.Accounts.Entities
map.Cascade(Cascade.None);
});
Bag(x => x.Inventories, colmap => { colmap.Key(x => x.Column("KotID")); colmap.Inverse(true); }, map => { map.OneToMany(); });
Bag(x => x.Inventories, colmap =>
{
colmap.Key(x => x.Column("KotID"));
colmap.Inverse(true);
colmap.OrderBy(x => x.SortOrder);
}, map => { map.OneToMany(); });
}
}
}