ActionEduViewModel.cs 1.2 KB

12345678910111213141516171819202122232425262728293031
  1. using CD67.FicheCollege.Entity;
  2. using CD67.FicheCollege.Factory;
  3. using CD67.FicheCollege.MVC.Internal;
  4. using System.Collections.Generic;
  5. using System.Web.Mvc;
  6. namespace CD67.FicheCollege.MVC.Models
  7. {
  8. public class ActionEduViewModel : BaseViewModel<ActionEdu>
  9. {
  10. public SelectList Sel_Thematique;
  11. public SelectList Sel_Statut;
  12. public ActionEduViewModel(ActionEdu model, Entities dbContext, ModeAcces acces = ModeAcces.Lecture, Dictionary<string, object> bag = null) : base(model, acces, bag)
  13. {
  14. if (acces == ModeAcces.Creation | acces == ModeAcces.Modification)
  15. {
  16. ActionEduThematiqueFactory fact_thema = new ActionEduThematiqueFactory(dbContext);
  17. Sel_Thematique = new SelectList(fact_thema.getAll(), "Id", "Nom", Obj.ActionEduThematiqueId);
  18. ActionEduStatutFactory fact_statuts = new ActionEduStatutFactory(dbContext);
  19. Sel_Statut = new SelectList(fact_statuts.getAll(), "Id", "Nom", Obj.StatutId);
  20. }
  21. }
  22. public override int Annee_Id { get { return Obj.Annee.Id; } }
  23. public override string Annee_Lib { get { return Obj.Annee.Libelle; } }
  24. }
  25. }