private void btnBack_Click(object sender, EventArgs e) { this.Close(); if (Tag != null) { ViewMyTags vmt = new ViewMyTags(userid); vmt.Show(); } else { Home h = new Home(userid); h.Show(); } }
private void btnLogin_Click(object sender, EventArgs e) { string Email = txtEmail.Text; string Password = txtPassword.Text; loginUserdata l = new loginUserdata(); DataTable dt = l.login(Email, Password); if (dt.Rows.Count > 0) { int user_id = int.Parse(dt.Rows[0][0].ToString()); Home h = new Home(user_id); this.Hide(); h.Show(); } else { MessageBox.Show("Invalid Email or Password. Try again."); } }
private void Login_OnClick(object sender, RoutedEventArgs e) { bool login = false; // Login Functionality foreach (var student in Students) { if (EmailBox.Text == student.Email && PasswordBox.Password == student.Password) { login = true; CurrentStudentEmail = student.Email; // Login button to open a new window var home = new Home(CurrentStudentEmail, Students); home.Show(); Close(); } } if (!login) { MessageBox.Show("Invalid Email or Password"); } }
private void Export_FormClosing(object sender, FormClosingEventArgs e) { Home h = new Home(userId); h.Show(); }
private void Add_Tags_FormClosing(object sender, FormClosingEventArgs e) { Home h = new Home(userid); h.Show(); }