示例#1
0
        private void saveChanges()
        {
            ChangedDataBundle changedDataBundle = new ChangedDataBundle(userAppChangeDict, userBackupDict);

            DBWriter writer = new DBWriter(dbConnection);
            string   query  = generateQuery(changedDataBundle);

            MyMessageBox.display(query);
            writer.writeToDB(query);
        }
示例#2
0
        private void saveButton_Click(object sender, EventArgs e)
        {
            DBWriter writer = new DBWriter(dbConnection);
            string   query;

            while (dg1Handler.checkChangesExist())
            {
                DataGridCell cell = dg1Handler.getLastCellChangedAndUndoChanges();
                query = generateUpdateQuery(dbName, cell);
                writer.writeToDB(query);
                changeCellTextColour(cell, Color.Black);
            }
            //blokuję przyciski zapisu i cofania, bo po zapisaniu zmian już nie ma czego zapisać ani cofnąć
            undoButton.Enabled = false;
            saveButton.Enabled = false;
        }