Ejemplo n.º 1
0
 private void SentinelSiteList_Load(object sender, EventArgs e)
 {
     if (!DesignMode)
     {
         // Translate the UI
         Localizer.TranslateControl(this);
         // Make sure there is an AdminlevelId
         if (AdminLevelId == 0)
             return;
         // Update the title
         AdminLevel adminLevel = Survey.AdminLevels.FirstOrDefault();
         if (adminLevel != null && adminLevel.Name != null)
             headerLabel.Text = String.Format("{0}: {1}", headerLabel.Text, adminLevel.Name);
         // Get the Survey repo
         SurveyRepo = new SurveyRepository();
         // Get all the SentinelSites for this Admin unit
         SentinelSites = SurveyRepo.GetSitesForAdminLevel(new List<string>() { AdminLevelId.ToString() });
         // Order the sites
         SentinelSites = SentinelSites.OrderBy(s => s.SiteName).ToList();
         // Load the SentinelSites into the ListView
         sentinelSiteListView.SetObjects(SentinelSites);
     }
 }