public static Maintenance Create(int id) { if (id == 1) return null; else { if (mnt == null) { mnt = new Maintenance(id); } return mnt; } }
private void Form1_FormClosing(object sender, FormClosingEventArgs e) { if (!updated) { if (DialogResult.No == MessageBox.Show("You haven't updated the changes you made to the database. If you exit now they will be lost.\nDo you still want to exit?", "Database not Updated", MessageBoxButtons.YesNo, MessageBoxIcon.Warning)) { e.Cancel = true; } else { mnt = null; } } else { mnt = null; } }
private void Form1_FormClosing(object sender, FormClosingEventArgs e) { if (!updated) { if (DialogResult.No == MessageBox.Show("You haven't updated the changes you made to the database. If you exit now they will be lost.\nDo you still want to exit?", "Database not Updated", MessageBoxButtons.YesNo,MessageBoxIcon.Warning)) e.Cancel = true; else mnt = null; } else mnt = null; }