void InitializeWindow() { sources = new Dictionary <DataGrid, List <DocTable> >(); typeToTable = new Dictionary <int, DataGrid>(); tableToType = new Dictionary <DataGrid, int>(); changesToConnections = new HashSet <int>(); typeToExpander = new Dictionary <int, Expander>(); //TODO CHANGE SOMETHING DatabaseHandler.Initialize(); //Getting sorted categories and then creating expanders for those categories var categories = DatabaseHandler.GetSortedCategories(); foreach (var category in categories) { CreateCategory(category); } if (!DatabaseHandler.userRole.Documents.HasFlag(Permissions.INSERT)) { AddDocument.Visibility = Visibility.Collapsed; } }
void InitializeWindow() { if (DatabaseHandler.canConnect) { DatabaseHandler.Initialize(); Util.startingTabsCount = Tabs.Items.Count; typesPage = new TypesPage(); TypesFrame.Content = typesPage; page = new DocumentsPage(); typesPage.updateDocumentTypesHandler += page.UpdateDocumentType; DocumentsFrame.Content = page; pointsPage = new PointsPage(this); typesPage.updatePointTypesHandler += pointsPage.UpdatePointTypes; PointsFrame.Content = pointsPage; } else { IsEnabled = false; } }