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 ActionEduViewModel : BaseViewModel<ActionEdu>
    {
        public SelectList Sel_Thematique;
        public SelectList Sel_Statut;

        public ActionEduViewModel(ActionEdu model, Entities dbContext, ModeAcces acces = ModeAcces.Lecture, Dictionary<string, object> bag = null) : base(model, acces, bag)
        {
            if (acces == ModeAcces.Creation | acces == ModeAcces.Modification)
            {
                ActionEduThematiqueFactory fact_thema = new ActionEduThematiqueFactory(dbContext);
                Sel_Thematique = new SelectList(fact_thema.getAll(), "Id", "Nom", Obj.ActionEduThematiqueId);

                ActionEduStatutFactory fact_statuts = new ActionEduStatutFactory(dbContext);
                Sel_Statut = new SelectList(fact_statuts.getAll(), "Id", "Nom", Obj.StatutId);
            }
        }

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

    }

}