Inventory details

This commit is contained in:
2016-09-02 12:33:38 -04:00
parent f5e438e994
commit 9cdf90b1e9
18 changed files with 206 additions and 171 deletions
@@ -27,6 +27,8 @@ namespace InventoryTraker.Web.Models
public string Memo { get; set; }
public bool IsExpired => ExpirationDate < DateTime.Today;
public void CreateMappings(IMapperConfiguration configuration)
{
configuration.CreateMap<Inventory, InventoryViewModel>()
@@ -10,6 +10,7 @@ namespace InventoryTraker.Web.Models
{
[Required]
public int Id { get; set; }
public int InventoryId { get; set; }
public string Name { get; set; }
public int UnitsPerCase { get; set; }
@@ -36,6 +37,8 @@ namespace InventoryTraker.Web.Models
public void CreateMappings(IMapperConfiguration configuration)
{
configuration.CreateMap<Transaction, TransactionViewModel>()
.ForMember(d => d.InventoryId,
opt => opt.MapFrom(s => s.Inventory.Id))
.ForMember(d => d.Name,
opt => opt.MapFrom(s => s.Inventory.InventoryType.Name))
.ForMember(d => d.ExpirationDate,