using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace FSI.Prj.Mgt.Models
{
    public class Project
    {
        public Project()
        {
           // Organizations = new HashSet<Organization>();
        }

        [Key]
        public int Id { get; set; }

        [DisplayName("Projekt-Nr")]
        public int No { get; set; }

        [DisplayName("Name")]
        [Required(ErrorMessage = "Projekt-Name eingeben.")]
        public string Name { get; set; }

        [DisplayName("Beschreibung")]
        [Required(ErrorMessage = "Beschreibung eingeben.")]
        public string Description { get; set; }


        [DisplayName("Status")]
        [Required(ErrorMessage = "Status muss angegeben werden.")]
        public ProjectStatus Status { get; set; }

        
        [DisplayName("Anlage, Teilanlage, ...")]        
        public virtual int OrganizationId { get; set; }
        
        [ForeignKey("OrganizationId")]
        public virtual Organization Organization { get; set; }

        //public virtual ICollection<Organization> Organizations { get; set; }

        [DisplayName("Erstellungsdatum")]
        public DateTime CreationTimeStamp { get; set; }

        [DisplayName("Änderungsdatum")]
        public DateTime ModificationTimeStamp { get; set; }

    }

    public enum ProjectStatus
    {
        [Display(Name = "in Bearbeitung")]
        started,

        [Display(Name = "beendet")]
        ended,

        [Display(Name = "zurückgestellt")]
        shelved,
    }
}
