Пример #1
0
        private async void Page_Loaded(object sender, RoutedEventArgs e)
        {
            ConnHolder.SetConnStr(@"Data Source=78.140.21.18;Initial Catalog=td010119; User Id=tdmerc; Password=tdmerc123;");
            var info = await CommandsToWorkWithDB.GetProductsAsync();

            Info = info;
            List <Microsoft.UI.Xaml.Controls.NavigationViewItem> navigationViewItems = new List <Microsoft.UI.Xaml.Controls.NavigationViewItem>();

            for (int i = 0; i < info.Count; i++)
            {
                navigationViewItems.Add(new Microsoft.UI.Xaml.Controls.NavigationViewItem {
                    Tag = info[i].NameOfPlace, Content = info[i].NameOfPlace
                });
            }
            Microsoft.UI.Xaml.Controls.NavigationViewItem Places = new Microsoft.UI.Xaml.Controls.NavigationViewItem();
            Places.Tag             = "Places";
            Places.Content         = "Площадки";
            Places.MenuItemsSource = navigationViewItems;

            nvSample.MenuItems.Add(Places);
        }
        public void SaveConStr()
        {
            var connectionString = @"Data Source=" + Server.Text + ";Initial Catalog=" + DBName.Text + "; User Id=" + Login.Text + "; Password="******";";

            ConnHolder.SetConnStr(connectionString);
        }