private void btnback_Click(object sender, EventArgs e) { this.Hide(); mainform f = new mainform(); f.Show(); }
public basketfrm(mainform a) { this.a = a; InitializeComponent(); this.btnclean.BackColor = System.Drawing.Color.Transparent; this.label1.BackColor = System.Drawing.Color.Transparent; this.btnback.BackColor = System.Drawing.Color.Transparent; this.lbhead.BackColor = System.Drawing.Color.Transparent; }
private void LogIn() { string loginuser = tblog.Text; string passuser = tbpas.Text; DataBase db = new DataBase(); DataTable table = new DataTable(); MySqlDataAdapter adapter = new MySqlDataAdapter(); MySqlCommand command = new MySqlCommand("SELECT * FROM `enter` WHERE `login`=@log AND `password`=@pas", db.getconn()); command.Parameters.Add("@log", MySqlDbType.VarChar).Value = loginuser; command.Parameters.Add("@pas", MySqlDbType.VarChar).Value = passuser; adapter.SelectCommand = command; adapter.Fill(table); if (table.Rows.Count > 0) { this.Hide(); mainform f = new mainform(); f.Show(); } else { MessageBox.Show("Такого пользователя нет в системе или неверный пароль", "Ошибка входа", MessageBoxButtons.OK, MessageBoxIcon.Error); } }