private void Fill_Changelog() { Changelogbox.Visible = true; var cl = db.Select("SELECT * FROM Changelog ORDER BY id DESC", "Changelog"); var cl_zaehler = db.zaehler; db.Update("UPDATE User SET cl = '" + cl[0][0] + "' WHERE id = '" + Form1.userid + "' AND cl != '" + cl[0][0] + "'"); var temp_text = ""; if (Form1.admin == 1) { temp_text += "\r"; } for (int i = 0; i < cl_zaehler; i++) { if (i > 0) { temp_text += "\r\r\r"; } temp_text += cl[1][i] + " --- " + cl[3][i]; temp_text += "\r\r"; temp_text += cl[2][i]; } Changelogbox.Text = temp_text; }
private void button1_Click(object sender, EventArgs e) { switch (Formular) { case "Archiv": if (Aktion == "Kommentar") { db.Update("UPDATE Archiv SET bemerkung = '" + textBox1.Text + "' WHERE id = '" + DBId + "'"); MessageBox.Show("Bemerkung erfolgreich geändert"); this.Close(); } break; } }
private void Austragen(bool offduty = false) { var select_fz = db.Select("SELECT * FROM Dienstzeit WHERE fahrzeug = '" + fahrzeug + "' AND ausgetragen IS NULL", "Dienstzeit"); var count_select_fz = db.zaehler; if (count_select_fz == 1 || Check_Krankenhaus(select_fz[5][0])) { db.Update("UPDATE Dienstzeit SET ausgetragen = NOW() WHERE user = '******' AND ausgetragen IS NULL"); } else { var uebergabe = MessageBox.Show("Möchtest du alle Austragen/Umtragen?", "Austragung", MessageBoxButtons.YesNo); if (uebergabe == DialogResult.Yes) { db.Update("UPDATE Dienstzeit SET ausgetragen = NOW() WHERE fahrzeug = '" + fahrzeug + "' AND ausgetragen IS NULL"); if (!offduty) { if (button1.Text == "Status wechseln") { for (int i = 0; i < count_select_fz; i++) { if (int.Parse(select_fz[1][i]) != Form1.userid) { Eintragen(select_fz[1][i]); } } } } } else if (uebergabe == DialogResult.No) { db.Update("UPDATE Dienstzeit SET ausgetragen = NOW() WHERE user = '******' AND ausgetragen IS NULL"); } } Load_DB(); }
private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex != -1) { if (e.ColumnIndex == 5) { var status = 0; if (dataGridView1.Rows[e.RowIndex].Cells[5].Value.ToString() == "Inaktiv") { status = 1; } var id = dataGridView1.Rows[e.RowIndex].Cells[0].Value.ToString(); db.Update("UPDATE Schwarzes_Brett SET aktiv = '" + status + "' WHERE id = '" + id + "'"); Content(); notification.Show("Erfolgreich aktualisiert!", AlertType.success); } } }