private void Daily_Report_View_FormClosing(object sender, FormClosingEventArgs e) { //Show Daily_Report form again Daily_Report d_report = new Daily_Report(); this.Dispose(); d_report.ShowDialog(); }
}//*****************Changing background with data from database END***************************// //Check awailable Program Messages public void check_AwailableMessages() { try { string Query_CeckMsg = "select count(*) from um_db.nachrichten where seen='" + "no" + "';"; MySqlConnection conDataBase_CeckMsg = new MySqlConnection(constring); MySqlCommand cmdDataBase_CeckMsg = new MySqlCommand(Query_CeckMsg, conDataBase_CeckMsg); MySqlDataReader myReader_CeckMsg; //Open Connection conDataBase_CeckMsg.Open(); int CountSeen = 0; CountSeen = int.Parse(cmdDataBase_CeckMsg.ExecuteScalar().ToString()); myReader_CeckMsg = cmdDataBase_CeckMsg.ExecuteReader(); if (CountSeen > 0) { //If new messages awailable then show form Daily_Report d_report = new Daily_Report(); d_report.ShowDialog(); } //Close Connection conDataBase_CeckMsg.Close(); } catch (Exception ex) { MessageBox.Show("Check_AwailableMessages Fehler: in Form Daily_report!"); MessageBox.Show(ex.Message); } }
private void tagesberichtToolStripMenuItem_Click(object sender, EventArgs e) { Daily_Report d_report = new Daily_Report(); d_report.ShowDialog(); }