private void metroButton2_Click(object sender, EventArgs e) { this.Hide(); Menuregistratura f1 = new Menuregistratura(); f1.ShowDialog(); this.Close(); }
private void metroButton1_Click(object sender, EventArgs e) { object dolj; int p; string conn = "server=80.87.192.168;port=3306;user=phpmyadmin;database=hospital;password=XGScapxERn0Z5268;"; string login = metroTextBox1.Text; string password = metroTextBox2.Text; string sqlcommand = $"SELECT * FROM doctors WHERE login ='******' and password = '******'"; using (MySqlConnection connection = new MySqlConnection(conn)) { connection.Open(); MySqlCommand logins_avtoriz = new MySqlCommand(sqlcommand, connection); MySqlDataReader reader = logins_avtoriz.ExecuteReader(); if (reader.HasRows) { while (reader.Read()) { dolj = reader.GetValue(6); p = Convert.ToInt32(dolj); if (p == 8) { this.Hide(); Menuregistratura f1 = new Menuregistratura(); f1.ShowDialog(); this.Close(); } if (p == 9) { this.Hide(); асписание расписание = new асписание(); расписание.ShowDialog(); this.Close(); } if (p == 6) { Redras redras = new Redras(); redras.ShowDialog(); this.Close(); } } } } }