Example #1
0
        public MainWindow()
        {
            InitializeComponent();

            DataBaseAuth init = new DataBaseAuth();

            init.Init();

            DataBaseMobilePhone initDbMbp = new DataBaseMobilePhone();

            initDbMbp.Init();


            ReadDataBaseMobilePhone();

            lvMobilePhone.Visibility = Visibility.Hidden;
            //lvMobilePhone.ContextMenu.
            //Правильная версия



            Window   = new Log2(dialogLW, thread);
            dialogLW = Window.ShowWindow("Ошибка");

            Thread.Sleep(3000);
            dialogLW.tbError.Dispatcher.Invoke(DispatcherPriority.Background, new Action(() => { dialogLW.tbError.Text += "Получил управление потоком \n"; }));

            Thread.Sleep(3000);

            ErrorWithThread errwiththread = new ErrorWithThread("Главное окно загружено\nНажмите кнопку \"ДОБАВИТЬ\" для демонстрации работы консоли\n", dialogLW);

            errwiththread.LogWindow();
        }
Example #2
0
        private void btnOk_Click_Ok(object sender, RoutedEventArgs e)
        {
            DataBaseAuth regist = new DataBaseAuth();

            regist.Registration(tbxLogin.Text, pbPass.Password);
            Close();
        }
Example #3
0
        private void btnOk_Click_Ok(object sender, RoutedEventArgs e)
        {
            DataBaseAuth Authorisation = new DataBaseAuth();

            isAuth = Authorisation.Authorisation(tbxLogin.Text, pbPass.Password);

            if (isAuth)
            {
                MainWindow mv = this.Owner as MainWindow;
                imgOk.Visibility            = Visibility.Visible;
                tblError.Text               = "Вы авторизованы (база MySQL)";
                mv.tblAuth.Text             = "Вы авторизованы (база MySQL)";
                mv.lvMobilePhone.Visibility = Visibility.Visible;
            }
            else
            {
                MainWindow mv = this.Owner as MainWindow;
                imgOk.Visibility = Visibility.Hidden;
                tblError.Text    = "Вы не авторизованы MySQL(база MySQL)";
                mv.tblAuth.Text  = "Вы не авторизованы MySQL(база MySQL)";
            }
        }