private void back_button_Click(object sender, RoutedEventArgs e) { Window3_1 dashboard = new Window3_1(); this.Close(); dashboard.ShowDialog(); this.Show(); Upload.Close(); }
private void Button_Login_validation_Click(object sender, RoutedEventArgs e) { if (string.IsNullOrWhiteSpace(PasswordBox.Password) || string.IsNullOrWhiteSpace(UsernameBox.Text)) { MessageBox.Show("Don't leave empty boxes"); } if (UsernameBox.Text.Equals("Admin") && PasswordBox.Password.Equals("*sinergy#")) { WindowAdmin PantallaAdmin = new WindowAdmin(); this.Close(); PantallaAdmin.ShowDialog(); this.Show(); } else { List <String> users = new List <String>(); //lista con cada linea del txt StreamReader sr = new StreamReader(AppDomain.CurrentDomain.BaseDirectory + "\\Users.txt", Encoding.UTF8); string striusuers; while ((striusuers = sr.ReadLine()) != null) { users.Add(striusuers); } //bool flag = false; foreach (string i in users) { string username = i.Split(';')[0]; string password = i.Split(';')[1]; if (UsernameBox.Text.Equals(username) && PasswordBox.Password.Equals(password)) { Window3_1 Pantalla3_1 = new Window3_1(); this.Close(); Pantalla3_1.ShowDialog(); this.Show(); } else { Label_if_incorrecto.Visibility = Visibility.Visible; } } } }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.Dashboard = ((Entorno_visual.Window3_1)(target)); return; case 2: this.Sing_Out = ((System.Windows.Controls.Button)(target)); #line 15 "..\..\Window3_1.xaml" this.Sing_Out.Click += new System.Windows.RoutedEventHandler(this.Sing_Out_Click); #line default #line hidden return; case 3: this.Release_Button = ((System.Windows.Controls.Button)(target)); #line 16 "..\..\Window3_1.xaml" this.Release_Button.Click += new System.Windows.RoutedEventHandler(this.Release_Button_Click); #line default #line hidden return; case 4: this.Button_exit4 = ((System.Windows.Controls.Button)(target)); #line 17 "..\..\Window3_1.xaml" this.Button_exit4.Click += new System.Windows.RoutedEventHandler(this.Button_exit4_Click); #line default #line hidden return; } this._contentLoaded = true; }