private void ExitButton_Click(object sender, RoutedEventArgs e) { AuthorizationWindow mainWindow = new AuthorizationWindow(); mainWindow.Show(); this.Close(); }
private void labelBack_MouseEnter(object sender, MouseEventArgs e) { AuthorizationWindow mainWindow = new AuthorizationWindow(); mainWindow.Show(); this.Close(); }
private void AuthorizationBtn_Click(object sender, RoutedEventArgs e) { AuthorizationWindow authorizationWindow = new AuthorizationWindow(); Close(); authorizationWindow.Show(); }
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()); } } }
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(); } }
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); }
private void ShowAuthWindow() { if (ConnectApp.IsConnect()) { if (AuthWindow.DataContext == null) { AuthWindow.DataContext = AuthVM; } AuthWindow.Show(); ConnectApp.Close(); } else { app.Shutdown(1); } }
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; } }
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; }