Ejemplo n.º 1
0
        public MainWindow()
        {
            //TODO: Проверяем и производим автовходи или открываем окно Login

            //PromoWindow.MainWindow dzen = new PromoWindow.MainWindow(userGuid, true);
            //dzen.Show();
            //this.Close();

            if (CanAutorize(userGuid))
            {
                PromoWindow.MainWindow dzen = new PromoWindow.MainWindow(userGuid, true);
                dzen.Show();
                this.Close();
            }
            else {

                // Открываем окно логина или регистрации
                DzenClient.DzenLogin.DzenLogin dzenlogin = new DzenClient.DzenLogin.DzenLogin();
                dzenlogin.Show();
                this.Close();
            }
        }
Ejemplo n.º 2
0
        private void buttonLogin_Click(object sender, RoutedEventArgs e)
        {
            string username = textBoxUsername.Text;
            string password = passwordBox.Password;

            bool result = DBmanager.Autorize(username, password);

            if(result)
            {
                
                Grid parent = _log.Parent as Grid;
                DzenClient.DzenLogin.DzenLogin parent2 = parent.Parent as DzenClient.DzenLogin.DzenLogin;
                PromoWindow.MainWindow client = new PromoWindow.MainWindow(DzenClient.DzenLogin.Core.Login.GetUserGuid(username), true);
                parent2.Close();
                client.Show();
            }
            else
            {
                textBlockLoginPageInformation.Text = "Something went wrong!";
            }

            //if(DzenClient.DzenLogin.Core.Login.CheckInDB(username, password))
            //{
            //    PromoWindow.MainWindow client = new PromoWindow.MainWindow(DzenClient.DzenLogin.Core.Login.GetUserGuid(username), true);

            //    Grid parent = _log.Parent as Grid;
            //    DzenClient.DzenLogin.DzenLogin parent2 = parent.Parent as DzenClient.DzenLogin.DzenLogin;
            //    client.Show();
            //    parent2.Close();

            //}
            //else
            //{
            //    textBlockLoginPageInformation.Text = "Something went wrong!";
            //}

        }
Ejemplo n.º 3
0
        static public void Logon(Guid guid)
        {

            PromoWindow.MainWindow client = new PromoWindow.MainWindow(guid, true);
            client.Show();
        }