private void log_in_btn(object sender, EventArgs e) { sql_queries query = new sql_queries("Data Source=(local);Initial Catalog=Auction_mangement_system;Integrated Security=True"); if (!query.check_username_and_password(username_login_textbox.Text, password_login_passwordbox.Password)) { MessageBox.Show("Invalid username or password"); } else if (username_login_textbox.Text.ToLower() == "admin") { Admin_Home admin_Home = new Admin_Home(); admin_Home.Show(); this.Close(); } else { DataTable dt = new DataTable(); dt = query.profilename(username_login_textbox.Text); User.profilename = dt.Rows[0]["profile_name"].ToString(); User.username = dt.Rows[0]["username"].ToString(); User.password = dt.Rows[0]["password"].ToString(); // MessageBox.Show("The username is " + User.username + " and the profilename is " + User.profilename); Home home = new Home(); home.Show(); this.Close(); } }
private void home_Click(object sender, EventArgs e) { Admin_Home home = new Admin_Home(); home.Show(); this.Close(); }