Пример #1
0
        private void ExitButton_Click(object sender, RoutedEventArgs e)
        {
            AuthorizationWindow mainWindow = new AuthorizationWindow();

            mainWindow.Show();
            this.Close();
        }
Пример #2
0
        private void labelBack_MouseEnter(object sender, MouseEventArgs e)
        {
            AuthorizationWindow mainWindow = new AuthorizationWindow();

            mainWindow.Show();
            this.Close();
        }
Пример #3
0
        private void AuthorizationBtn_Click(object sender, RoutedEventArgs e)
        {
            AuthorizationWindow authorizationWindow = new AuthorizationWindow();

            Close();
            authorizationWindow.Show();
        }
Пример #4
0
 private void EnterButton_Click(object sender, RoutedEventArgs e)
 {
     if (ModelCheck())
     {
         try
         {
             _user.Login               = LoginTextBox.Text;
             _user.Password            = PassTextBox.Text;
             _user.IsBlocked           = false;
             _user.RoleId              = 1;
             _reader.FIO               = FIOTextBox.Text;
             _reader.BirthDate         = BirthDatePicker.SelectedDate;
             _reader.Phone             = PhoneTextBox.Text;
             _reader.IsCollegeEmployee = IsEmpCheckBox.IsChecked;
             _reader.Rating            = 0;
             dBQueryHelper.AddUserWithReader(_reader, _user);
             AuthorizationWindow mainWindow = new AuthorizationWindow();
             mainWindow.Show();
             this.Close();
         }
         catch (Exception ex)
         {
             MessageBox.Show(ex.ToString());
         }
     }
 }
Пример #5
0
        public static Authorization AuthorizeNewAccount(string redirectUrl, string scope)
        {
            Authorization       account    = new Authorization();
            AuthorizationWindow authWindow = new AuthorizationWindow(clientId, redirectUrl, scope);

            authWindow.AuthSuccess += authWindow_AuthSuccess;
            authWindow.Show();
            return(account);
        }
        private void ProfileButton_Click(object sender, RoutedEventArgs e)
        {
            ProfileWindow profileWindow = new ProfileWindow((int)InformationAboutCurrnetUser.UserId);

            if (profileWindow.ShowDialog() == true)
            {
                LogOutOnGoogle();
                InformationAboutCurrnetUser.NullAllSettings();
                AuthorizationWindow authorization = new AuthorizationWindow();
                authorization.Show();
                this.Close();
            }
        }
Пример #7
0
        protected override void OnStartup(StartupEventArgs e)
        {
            IDbContextFactory <FileCabinetContext> dbContextFactory = new FileCabinetDbContextFactory();
            IUnitOfWork           unitOfWork = new UnitOfWork(dbContextFactory);
            IAuthorizationService service    = new AuthorizationService(unitOfWork);
            Window authorization             = new AuthorizationWindow(service, unitOfWork);

            authorization.Show();

            //var windowFactory = new SimpleWindowFactory(unitOfWork, 87);
            //var window = windowFactory.CreateWindow(WindowType.Admin);
            //window.Show();
            base.OnStartup(e);
        }
Пример #8
0
 private void ShowAuthWindow()
 {
     if (ConnectApp.IsConnect())
     {
         if (AuthWindow.DataContext == null)
         {
             AuthWindow.DataContext = AuthVM;
         }
         AuthWindow.Show();
         ConnectApp.Close();
     }
     else
     {
         app.Shutdown(1);
     }
 }
Пример #9
0
        public MainWindow()
        {
            InitializeComponent();

            this.DataContext = MainViewModel.This;

            if (Settings.Default.token == "")
            {
                //скрываем главную форму если нет токена
                Visibility = Visibility.Hidden;
                //отображаем окно авторизации
                var authorization = new AuthorizationWindow {
                    main = this
                };
                //ссылка на главную форму
                authorization.Show();
            }
            else
            {
                VkSettings.Token = Settings.Default.token;
            }
        }
Пример #10
0
 public static Authorization AuthorizeNewAccount(string redirectUrl, string scope)
 {
     Authorization account = new Authorization();
     AuthorizationWindow authWindow = new AuthorizationWindow(clientId, redirectUrl, scope);
     authWindow.AuthSuccess += authWindow_AuthSuccess;
     authWindow.Show();
     return account;
 }