private void login_Click(object sender, RoutedEventArgs e) { try { SqlConnection sql = new SqlConnection(""); sql.Open(); SqlDataAdapter selen = new SqlDataAdapter("SELECT * FROM LOGIN WHERE USERN = '" + user.Text + "' AND PASS = '******'", sql); DataTable dt = new DataTable(); selen.Fill(dt); //Class1.login(); if (dt.Rows[0][2].Equals("1")) { question create = new question(); create.ShowDialog(); this.Close(); } else if (dt.Rows[0][2].Equals("0")) { Test_Take t = new Test_Take(); t.ShowDialog(); this.Close(); } } catch { MessageBox.Show("Does not exist!"); register r = new register(); r.ShowDialog(); this.Hide(); } }
private void lblRegister_MouseDoubleClick(object sender, MouseButtonEventArgs e) { register register = new register(); register.ShowDialog(); this.Hide(); }