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

namespace MvcApplication3.Entities
{
    public class Department
    {
        [Key]
        public int Id { get; set; }
        
        public string Name { get; set; }
        
        public string Code { get; set; }
        
        public int? DivisionId { get; set; }

        [ForeignKey("DivisionId")]
        public Division Division { get; set; }
        
        public string DivisionName
        {
            get
            {
                return this.Division == null ? string.Empty : this.Division.Name;
            }
        }
        
        public bool Active { get; set; }
    }
}