using System;
using System.ComponentModel.DataAnnotations;

namespace MVC3UnobtrusiveComboBoxValidation.Models
{
    public class ValidationModel
    {
        public ValidationModel() 
        {
            SubModel = new SubModel();
        }

        [Required]
        public int Id { get; set; }
        [Range(4,6)]
        public int DllId { get; set; }
        [Required]
        public int Number { get; set; }
        [Required]
        [DataType(DataType.DateTime)]
        public DateTime LastSupply { get; set; }
        public bool Discontinued { get; set; }
        [DataType(DataType.Currency)]
        public decimal UnitPrice { get; set; }

        public SubModel SubModel { get; set; }
    }

    public class SubModel 
    {
        [Required]
        public int Phone { get; set; }
    }
}