Inventory Type editing
This commit is contained in:
@@ -4,15 +4,6 @@ using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace InventoryTraker.Web.Models
|
||||
{
|
||||
public class InventoryQuantityForm
|
||||
{
|
||||
[Required]
|
||||
public int InventoryId { get; set; }
|
||||
|
||||
[Required, Range(1, int.MaxValue, ErrorMessage = "Quantity must be greater than 0")]
|
||||
public int Quantity { get; set; }
|
||||
}
|
||||
|
||||
public class InventoryDistributeForm
|
||||
{
|
||||
public IList<InventoryQuantityForm> InventoryQuantities { get; set; }
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace InventoryTraker.Web.Models
|
||||
{
|
||||
public class InventoryQuantityForm
|
||||
{
|
||||
[Required]
|
||||
public int InventoryId { get; set; }
|
||||
|
||||
[Required, Range(1, int.MaxValue, ErrorMessage = "Quantity must be greater than 0")]
|
||||
public int Quantity { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,22 +1,31 @@
|
||||
using Heroic.AutoMapper;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Web.Mvc;
|
||||
using Heroic.AutoMapper;
|
||||
using InventoryTraker.Web.Core;
|
||||
|
||||
namespace InventoryTraker.Web.Models
|
||||
{
|
||||
public class InventoryTypeViewModel : IMapFrom<InventoryType>
|
||||
public class InventoryTypeViewModel : IMapFrom<InventoryType>, IMapTo<InventoryType>
|
||||
{
|
||||
[HiddenInput]
|
||||
public int Id { get; set; }
|
||||
|
||||
[Required]
|
||||
public string Identifier { get; set; }
|
||||
|
||||
[Required]
|
||||
public string Name { get; set; }
|
||||
|
||||
[Required]
|
||||
public int UnitsPerCase { get; set; }
|
||||
|
||||
[Required]
|
||||
public string ContainerType { get; set; }
|
||||
|
||||
[Required]
|
||||
public double WeightPerCase { get; set; }
|
||||
|
||||
[Required]
|
||||
public decimal PricePerCase { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user