using System.Collections.Generic;
using Baza_Reklam.Classes.Interfaces;
using Baza_Reklam.Classes.Repositories;

namespace Baza_Reklam.Classes.Model
{
    public class Section : IEntity
    {
        private int _id;
        private Title _title;
        private string _name;
        private bool _isActive;

        public int Id
        {
            get { return _id; }
            set { _id = value; }
        }

        public Title Title
        {
            get { return _title; }
            set { _title = value; }
        }

        public string Name
        {
            get { return _name; }
            set { _name = value; }
        }

        public bool IsActive
        {
            get { return _isActive; }
            set { _isActive = value; }
        }

        public List<Module> Modules
        {
            get
            {
                ModuleRepository moduleRepository = new ModuleRepository();
                return moduleRepository.FindAllActiveBySection(this);
            }
        }

        public Section(int id, Title title, string name)
        {
            _id = id;
            _title = title;
            _name = name;
        }
    }
}