using System.ComponentModel.DataAnnotations;
using System.Web.Mvc;

namespace TestCasePlanner.ViewModels
{
    public class EditTestProjectViewModel
    {
        [Display(Name = "ProjectName", ResourceType = typeof(Resources.Resources))]
        [Required(ErrorMessageResourceType = typeof(Resources.Resources), ErrorMessageResourceName = "ProjectNameRequired")]
        [StringLength(50, ErrorMessageResourceType = typeof(Resources.Resources), ErrorMessageResourceName = "ProjectNameLong")]
        [Remote("DoesProjectNameExist", "Project", HttpMethod = "POST", AdditionalFields = "ID", ErrorMessageResourceType = typeof(Resources.Resources), ErrorMessageResourceName = "ProjectNameExists")]
        public string Name { get; set; }

        [Display(Name = "ProjectShortName", ResourceType = typeof(Resources.Resources))]
        [Required(ErrorMessageResourceType = typeof(Resources.Resources), ErrorMessageResourceName = "ProjectShortNameRequired")]
        [StringLength(5, ErrorMessageResourceType = typeof(Resources.Resources), ErrorMessageResourceName = "ProjectShortNameLong")]
        public string ShortName { get; set; }

        [Display(Name = "ProjectDescription", ResourceType = typeof(Resources.Resources))]
        [StringLength(256, ErrorMessageResourceType = typeof(Resources.Resources), ErrorMessageResourceName = "ProjectDescriptionNameLong")]
        public string Description { get; set; }

        public string ID { get; set; }
    }

    public class NewTestProjectViewModel
    {
        [Display(Name = "ProjectName", ResourceType = typeof(Resources.Resources))]
        [Required(ErrorMessageResourceType = typeof(Resources.Resources), ErrorMessageResourceName = "ProjectNameRequired")]
        [StringLength(50, ErrorMessageResourceType = typeof(Resources.Resources), ErrorMessageResourceName = "ProjectNameLong")]
        [Remote("DoesProjectNameExist", "Project", HttpMethod = "POST", ErrorMessageResourceType = typeof(Resources.Resources), ErrorMessageResourceName = "ProjectNameExists")]
        public string Name { get; set; }

        [Display(Name = "ProjectShortName", ResourceType = typeof(Resources.Resources))]
        [Required(ErrorMessageResourceType = typeof(Resources.Resources), ErrorMessageResourceName = "ProjectShortNameRequired")]
        [StringLength(5, ErrorMessageResourceType = typeof(Resources.Resources), ErrorMessageResourceName = "ProjectShortNameLong")]
        public string ShortName { get; set; }

        [Display(Name = "ProjectDescription", ResourceType = typeof(Resources.Resources))]
        [StringLength(256, ErrorMessageResourceType = typeof(Resources.Resources), ErrorMessageResourceName = "ProjectDescriptionNameLong")]
        public string Description { get; set; }
    }
}