private void ConfigForm_FormClosing(object sender, FormClosingEventArgs e) { if (!readOnly && !ignoreClosing && FormUtils.Ask("Cохранить изменения?")) { Save(); } }
public void Exit() { if (userInfo.HasWatching && !userInfo.Watching.IsCompleted) { if (FormUtils.Ask("Завершить дежурство?")) { userInfo.Watching.endTime = DateTime.Now; using (GmConnection conn = App.CreateConnection()) { userInfo.Watching.SaveEndTime(conn); } } } }
private void btnRemove_Click(object sender, EventArgs e) { WatchingScheme ws = lbSchemes.SelectedItem as WatchingScheme; if (ws != null) { if (FormUtils.Ask("Удалить схему '" + ws.name + "'?")) { using (GmConnection conn = App.CreateConnection()) { WatchingScheme.Remove(conn, ws.Id); } lbSchemes.Items.Remove(ws); } } }