1

I have a situation with data field validation in MVC 4

this is my Model

    public class Purchase
{
    public Purchase()
    {
        PurchaseDetails = new List<PurchaseDetails>();
    }

    public int PurchaseID { get; set; }

    [DisplayName("Compra N°")]
    [Required]
    public int PurchaseNumber { get; set; }

    [DisplayName("Anulada")]
    [Required]
    public bool isAnulada { get; set; }
    public int ProviderID { get; set; }
    public virtual Provider Provider { get; set; }

    [DisplayName("Nombres/Notas")]
    [Required]
    public string Notes { get; set; }

    [DisplayName("Detalles de Compra")]
    public string ProposalDetails { get; set; }

    [DataType(DataType.Date), DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:dd/MM/yyyy}")]
    [DisplayName("Creado")]
    public DateTime TimeStamp { get; set; }

    [DataType(DataType.Date), DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:dd/MM/yyyy}")]
    [DisplayName("Pagado en Fecha")]
    public DateTime PaidDate { get; set; }

    [DisplayName("Impuesto a la Compra")]
    [Range(0.00, 100.0, ErrorMessage = "Valor debe estar expresado en % Entre 0 y 100")]
    public decimal AdvancePaymentTax { get; set; }
    [DisplayName("Pagada")]
    [Required]
    public bool Paid { get; set; }

    public virtual ICollection<PurchaseDetails> PurchaseDetails { get; set; }
}

When try Post or Create my purchase raise the error "The Field must be a Date" i don't know how, this malfunction appear in IExplorer an Chrome browser

Error Any Idea? Thanks for the answer....

0 Answers0