public override void OnNavigatedTo() { Debug.WriteLine($"{nameof(ThemeListViewModel)} - {nameof(OnNavigatedTo)}"); Themes.Clear(); var tmp = ThemeRepository.GetAll(); foreach (var item in tmp) { Themes.Add(item); } // Print all the values to the screen to debug //foreach (var item in AccessTokenRepository.GetAll()) //{ // Debug.WriteLine($"Access Tokens: {item.Path} - {item.AccessTokenType} | {item.AccessToken}"); //} //foreach (var item in ThemeRepository.GetAll()) //{ // Debug.WriteLine($"Theme: {item.Name}"); //} //foreach (var item in DirectoryRepository.GetAll()) //{ // Debug.WriteLine($"Directories: {item.Path}"); //} }
public void Should_return_all_themes() { using (var context = new WeapsyDbContext(_contextOptions)) { var repository = new ThemeRepository(Shared.CreateNewContextFactory(context), Shared.CreateNewMapper()); var list = repository.GetAll(); Assert.AreEqual(2, list.Count); } }
static public List <Theme> GetAllThemeswithoutdetaching() { List <Theme> Themetemp = null; using (ThemeRepository Themerepo = new ThemeRepository()) { Themetemp = (List <Theme>)Themerepo.GetAll(); } return(Themetemp); }
static public List <Theme> GetAllThemes(Audit audit) { List <Theme> Themetemp = null; using (ThemeRepository Themerepo = new ThemeRepository()) { Themetemp = (List <Theme>)Themerepo.GetAll(); foreach (Theme theme in Themetemp) { Themerepo.context.Entry(theme).State = EntityState.Detached; } List <int> ResultPoints = new List <int>(); foreach (var item in audit.resultats) { ResultPoints.Add(item.point.PointID); } List <Point> PointTemp1 = new List <Point>(); //foreach (var item in ServicePoint.GetAllPoints()) //{ //} foreach (var theme in Themetemp) { PointTemp1.Clear(); foreach (var item1 in theme.points) { PointTemp1.Add(item1); } //for (int i = 0; i < PointTemp1.Count; i++) //{ // if (!ResultPoints.Contains(point.PointID)) // { // theme.points.Remove(point); // } //} foreach (var point in PointTemp1) { if (!ResultPoints.Contains(point.PointID)) { theme.points.Remove(point); } } } } return(Themetemp); }
static public List <Theme> GetAllThemes() { List <Theme> Themetemp = null; using (ThemeRepository Themerepo = new ThemeRepository()) { Themetemp = (List <Theme>)Themerepo.GetAll(); foreach (Theme theme in Themetemp) { Themerepo.context.Entry(theme).State = EntityState.Detached; } } return(Themetemp); }
//[HttpGet] public ActionResult Ajouter() { #region dropdownlist var SysLst = new List <string>(); var SysQry = periodeRepository.GetAll().ToList(); foreach (Periode p in SysQry) { string pr = "from " + p.DateDebut.ToString().Substring(0, 10) + " to " + p.DateFin.Date.ToString().Substring(0, 10); SysLst.Add(pr); } ViewBag.PeriodeList = new SelectList(SysLst); var SysLst3 = new List <string>(); SysLst3.Add("2 jours"); SysLst3.Add("1 jour"); SysLst3.Add("< 1 jour"); ViewBag.DureeList = new SelectList(SysLst3); var SysLst4 = new List <int>(); for (int i = 1; i < 24; i++) { SysLst4.Add(i); } ViewBag.HeureList = new SelectList(SysLst4); var SysLst5 = new List <int>(); for (int i = 0; i < 60; i += 5) { SysLst5.Add(i); } ViewBag.MinuteList = new SelectList(SysLst5); var SysLst6 = new List <string>(); if (MvcGlobalisationSupport.CultureManager.GetLanguage() == "fr") { var SysQry6 = from b in themeRepository.GetAll() select b.Nom_fr; SysLst6.AddRange(SysQry6.Distinct()); } else if (MvcGlobalisationSupport.CultureManager.GetLanguage() == "en") { var SysQry6 = from b in themeRepository.GetAll() select b.Nom_en; SysLst6.AddRange(SysQry6.Distinct()); } else if (MvcGlobalisationSupport.CultureManager.GetLanguage() == "de") { var SysQry6 = from b in themeRepository.GetAll() select b.Nom_de; SysLst6.AddRange(SysQry6.Distinct()); } else if (MvcGlobalisationSupport.CultureManager.GetLanguage() == "it") { var SysQry6 = from b in themeRepository.GetAll() select b.Nom_it; SysLst6.AddRange(SysQry6.Distinct()); } ViewBag.ThemeList = new SelectList(SysLst6); var SysLst1 = new List <float>(); var SysQry1 = from b in prixRepository.GetAll() select b.PrixAdulte; SysLst1.AddRange(SysQry1.Distinct()); ViewBag.PrixList = new SelectList(SysLst1); var SysLst2 = new List <string>(); SysLst2.Add("Valide"); SysLst2.Add("Non Valide"); ViewBag.EtatList = new SelectList(SysLst2); var SysLst7 = new List <string>(); var SysQry7 = from b in zoneRepository.FindMany(x => x.CentreID == SessionData.CurrentUser.CentreID) select b.Nom; SysLst7.AddRange(SysQry7.Distinct()); ViewBag.ZoneList = new SelectList(SysLst7); #endregion return(View()); }
// GET: Themes public ActionResult GetAll() { var all = rpTheme.GetAll().ToList(); return(PartialView("themes_view", all)); }