using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;

namespace ValidationAttributesDemo.Models
{
    public class ProductViewModel
    {
        [Required(ErrorMessage = "Custom message for Unit Price!")]
        [DisplayName("Unit price")]
        [DataType(DataType.Currency)]
        [Range(0, int.MaxValue)]
        public decimal? UnitPrice
        {
            get;
            set;
        }

        [Required(ErrorMessage = "This field needs a value!")]
        [DisplayName("Product name")]
        public string ProductName
        {
            get;
            set;
        }

        public int ProductID
        {
            get;
            set;
        }

        [Required(ErrorMessage = "My custom validation message!")]
        [DisplayName("Units in stock")]
        [DataType("Integer")]
        public short? UnitsInStock
        {
            get;
            set;
        }

        public bool Discontinued
        {
            get;
            set;
        }

        [DisplayName("Last supply")]
        [DataType(DataType.Date)]
        public DateTime LastSupply
        {
            get;
            set;
        }

        public short UnitsOnOrder { get; set; }
    }
}