private void SetCombo() { cbxSiteIds.Background = Brushes.Brown; cbxSiteIds.Foreground = Brushes.White; cbxSiteIds.BorderBrush = Brushes.Brown; cbxSiteIds.Resources.Add(SystemColors.WindowBrushKey, Brushes.DarkGoldenrod); cbxHistory.Background = Brushes.Brown; cbxHistory.Foreground = Brushes.White; cbxHistory.BorderBrush = Brushes.Brown; cbxHistory.Resources.Add(SystemColors.WindowBrushKey, Brushes.DarkGoldenrod); foreach (var r in MigrationVariables.GetRangeDates()) { cbxHistory.Items.Add(r); } foreach (var item in aHelpers.GetAllFirebirdConnections().OrderBy(o => o.SiteId)) { cbxSiteIds.Items.Add(item.SiteId); } cbxSiteIds.SelectedIndex = 0; cbxHistory.SelectedIndex = 3; lblSqlConnStr.Content = TransactionManager.DatabaseContext.Database.Connection.ConnectionString; UpdateMigrationVars(); }
public static void Init() { if (SiteIds.Count == 0) { AspnetDbHelpers help = new AspnetDbHelpers(); SiteIds = help.GetAllFirebirdConnections().Where(w => w.SiteId.HasValue).Select(s => s.SiteId.Value).ToList(); } }
public void GetAllFirebirdConnectionsTest() { Mock <DbSet <SQLDatabase.EF.FirebirdConnection> > moq_FireConn = new Mock <DbSet <SQLDatabase.EF.FirebirdConnection> >(); moq_FireConn.SetupData(fbConn); nuContext.Setup(c => c.FirebirdConnections).Returns(moq_FireConn.Object); AspnetDbHelpers ah = new AspnetDbHelpers(nuContext.Object); Assert.AreEqual(db.FirebirdConnections.Count(), ah.GetAllFirebirdConnections().Count); }