コード例 #1
0
ファイル: mainDbPage.xaml.cs プロジェクト: Hitokai/4thYear
        /// <summary>
        /// Смена вкладок при нажатии на кнопки меню
        /// </summary>
        /// <param name="sender">Объект</param>
        /// <param name="e">Событие</param>
        private void ClickOnViewBtn(object sender, RoutedEventArgs e)
        {
            pageContent.Children.Clear();
            UserControl usc = null;

            if (((Button)sender as Button).Name == "driversViewBtn")
            {
                usc = new dbView("drivers");
                DBConnect.tableName = "drivers";
            }

            if (((Button)sender as Button).Name == "carsViewBtn")
            {
                usc = new dbView("cars");
                DBConnect.tableName = "cars";
            }

            if (((Button)sender as Button).Name == "trailersViewBtn")
            {
                usc = new dbView("trailers");
                DBConnect.tableName = "trailers";
            }

            if (((Button)sender as Button).Name == "cargoViewBtn")
            {
                usc = new dbView("drivers");
                DBConnect.tableName = "cargo";
            }

            pageContent.Children.Add(usc);
        }
コード例 #2
0
        private void backBut_Click(object sender, RoutedEventArgs e)
        {
            pageContent.Children.Clear();
            UserControl usc = null;

            usc = new dbView("drivers");
            pageContent.Children.Add(usc);
        }