using CD67.FicheCollege.Entity;
using CD67.FicheCollege.Factory;
using System.Collections.Generic;
using System.Linq;
using System.Web.Mvc;

namespace CD67.FicheCollege.MVC.Models
{
    public class AnneeViewModel : BaseViewModel<Annee>
    {
        public IQueryable<Annee> ListAnnees;

        public AnneeViewModel(Annee model, Entities dbContext, ModeAcces acces = ModeAcces.Lecture, Dictionary<string, object> bag = null) : base(model, acces, bag)
        {
            AnneeFactory fact = new AnneeFactory(dbContext);
            ListAnnees = fact.getAll();
        }

        public override int Annee_Id { get { return Obj.Id; } }
        public override string Annee_Lib { get { return Obj.Libelle; } }
    }

    public class AnneeIndexViewModel : BaseViewModel<IEnumerable<Annee>>
    {
        public AnneeIndexViewModel(IEnumerable<Annee> model, ModeAcces acces = ModeAcces.Lecture, Dictionary<string, object> bag = null) : base(model, acces, bag)
        {
        }

        public override int Annee_Id { get { return 0; } }
        public override string Annee_Lib { get { return ""; } }

    }
}