public MenuWindow() { InitializeComponent(); currentWindow = this; radGridView.Visibility = Visibility.Hidden; infoFiliere.Visibility = Visibility.Hidden; ButtonEdit.Visibility = Visibility.Hidden; string SaadServer = "DESKTOP-SL2AUNJ"; connString = "Data Source =" + SaadServer + "; Initial Catalog = Gestion_Etudiant; Integrated Security = true;"; con = new SqlConnection(); con.ConnectionString = connString; con.Open(); SqlCommand commande = new SqlCommand("Select * From Filiere", con); SqlDataReader reader = commande.ExecuteReader(); while (reader.Read()) { ComboBox1.Items.Add(reader.GetString(1)); } reader.Close(); fillingChart(); fillingChart2(); }
private void login_Click(object sender, RoutedEventArgs e) { if (username.Text == "admin" && mdp.Password == "123456") { MenuWindow menu = new MenuWindow(); menu.Show(); this.Close(); } else { error.Content = "*Username or Password INCORRECT ! "; } }
private void Window_KeyDown(object sender, KeyEventArgs e) { if (e.Key == Key.Return) { if (username.Text == "admin" && mdp.Password == "123456") { MenuWindow menu = new MenuWindow(); menu.Show(); this.Close(); } else { error.Content = "*Username or Password INCORRECT ! "; } } }