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

namespace CD67.FicheCollege.MVC.Models
{
    public class ActionEduCollegeViewModel : BaseViewModel<ActionEduCollege>
    {
        public SelectList Sel_College;

        public ActionEduCollegeViewModel(ActionEduCollege model, Entities dbContext, ModeAcces acces = ModeAcces.Lecture, Dictionary<string, object> bag = null) : base(model, acces, bag)
        {
            CollegeFactory fact = new CollegeFactory(dbContext);
            Sel_College = new SelectList(fact.getManyBy(c=>c.Annee_Id==Obj.ActionEdu.AnneeId), "Id", "Libelle", Obj.CollegeId);
        }

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

}