ActionEduViewModel.cs 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  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 ActionEduViewModel(ActionEdu model, Entities dbContext, ModeAcces acces = ModeAcces.Lecture, Dictionary<string, object> bag = null) : base(model, acces, bag)
  12. {
  13. if (acces == ModeAcces.Creation | acces == ModeAcces.Modification)
  14. {
  15. ActionEduThematiqueFactory fact = new ActionEduThematiqueFactory(dbContext);
  16. Sel_Thematique = new SelectList(fact.getAll(), "Id", "Nom", Obj.ActionEduThematiqueId);
  17. }
  18. }
  19. public override string Annee_Lib { get { return Obj.Annee.Libelle; } }
  20. }
  21. public class ActionEduIndexViewModel : BaseViewModel<IEnumerable<ActionEdu>>
  22. {
  23. public ActionEduIndexViewModel(IEnumerable<ActionEdu> model, ModeAcces acces = ModeAcces.Lecture, Dictionary<string, object> bag = null) : base(model, acces, bag)
  24. {
  25. }
  26. public override string Annee_Lib { get { return ""; } }
  27. }
  28. }