private void Registration_Click_btn(object sender, RoutedEventArgs e) { try { if (teljesnev.Text.Length > 0 && email.Text.Length > 0 && tartomanyi.Text.Length > 0 && tartomanyi_pass.Password.Length > 0) { if (ActiveDirecotry.Bind(tartomanyi.Text, tartomanyi_pass.Password)) { ComboBox katcbx = kategoria_cbx as ComboBox; Kategoria_struct kategoria_items = katcbx.SelectedItem as Kategoria_struct; Source.ViewModel.Login.Registration(tartomanyi.Text, teljesnev.Text, email.Text, kategoria_items.id); MainWindow login = new MainWindow(); var window = Window.GetWindow(this); window.Close(); login.Show(); } else { InfoBlock.Text = "Tartományi azonosítás sikertelen!"; } } else { InfoBlock.Text = "Kitöltetlen mező!"; } } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }
//private void usernameRemember() //{ // if (login_cbx.IsChecked == true) // { // Source.ViewModel.Login.SaveUser(Luser_tbx.Text); // } // else // { // Source.ViewModel.Login.DeleteSavedUser(); // } //} private void enter() { if (dbConnectionOpener()) { if (ActiveDirecotry.Bind(Luser_tbx.Text, Lpass_pwd.Password)) { Session.ActiveDirectoryDomain = Luser_tbx.Text; if (Source.ViewModel.Login.Authentication(Luser_tbx.Text)) { Main mw = new Main(); var window = Window.GetWindow(this); //usernameRemember(); mw.Show(); window.Close(); } else { LoginSign.Text = "Kérem regisztráljon!"; } } else { LoginSign.Text = "Sikertelen hitelesítés!"; } } else { LoginSign.Text = "Nincs adatkapcsolat!"; } }