34 lines
753 B
C#
34 lines
753 B
C#
using System;
|
|
using System.ComponentModel.DataAnnotations;
|
|
using System.Web.Mvc;
|
|
using AutoMapper;
|
|
using InventoryTraker.Web.Core;
|
|
|
|
namespace InventoryTraker.Web.Models
|
|
{
|
|
public class InventoryAddForm
|
|
{
|
|
[HiddenInput(DisplayValue = false)]
|
|
[Required]
|
|
public int InventoryTypeId { get; set; }
|
|
|
|
[Required]
|
|
public DateTime ExpirationDate { get; set; }
|
|
|
|
[Required, Range(1, int.MaxValue, ErrorMessage = "Quantity must be greater than 0")]
|
|
public int Quantity { get; set; }
|
|
|
|
[Required, Display(Name = "Arrival Date")]
|
|
public DateTime AddedDate { get; set; }
|
|
|
|
public string Memo { get; set; }
|
|
|
|
public class AutoMapperProfile : Profile
|
|
{
|
|
public AutoMapperProfile()
|
|
{
|
|
CreateMap<InventoryAddForm, Inventory>();
|
|
}
|
|
}
|
|
}
|
|
} |