示例#1
0
 public string setWelcomeLabel(int id)
 {
     try
     {
         MySqlComm mysql = new MySqlComm();
         MySqlConnectionDatabase conn = new MySqlConnectionDatabase();
         mysql = conn.connection();
         mysql.open();
         string query = "SELECT staff.name FROM staff WHERE staff.id=" + id + ";";
         return(mysql.getOneData(query));
     }
     catch (Exception e)
     {
         MessageBox.Show("Hiba az adatbázis elérésekor: " + e, "Adatbázis HIBA!", MessageBoxButtons.OK, MessageBoxIcon.Error);
         return(null);
     }
 }
示例#2
0
 public string getSelectedVisits(string id)
 {
     try
     {
         MySqlComm mysql = new MySqlComm();
         MySqlConnectionDatabase conn = new MySqlConnectionDatabase();
         mysql = conn.connection();
         mysql.open();
         string query = "SELECT text FROM patient_visits " +
                        "WHERE id='" + id + "';";
         return(mysql.getOneData(query));
     }
     catch (Exception e)
     {
         MessageBox.Show("Hiba az adatbázis elérésekor: " + e, "Adatbázis HIBA!", MessageBoxButtons.OK, MessageBoxIcon.Error);
         return(id);
     }
 }