예제 #1
0
        private void frmVCard_FormClosing(object sender, FormClosingEventArgs e)
        {
            PersistControlValue.StoreControlValue(txtOutputLocation);
            bool changed = false;

            foreach (tblCrediteur d in crediteuren)
            {
                if (d.Dirty)
                {
                    changed = true;
                    break;
                }
            }
            if (changed)
            {
                DialogResult dr = MessageBox.Show("Save changes?", "Save changes?", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                if (dr == DialogResult.Yes)
                {
                    cmdSave.PerformClick();
                }
                else
                {
                    dataAdaptor.CancelTransaction(true);
                }
            }
            //           e.Cancel = false;
        }
예제 #2
0
 protected override void OnClosing(CancelEventArgs e)
 {
     try
     {
         if (!e.Cancel && (this.DialogResult == DialogResult.Cancel))
         {
             da.CancelTransaction(true);
         }
     }
     finally
     {
     }
 }
예제 #3
0
        private void frmEenmaligeRekening_FormClosing(object sender, FormClosingEventArgs e)
        {
            DialogResult dr = MessageBox.Show("Aangemaakte rekeningen (" + localRekeningen.Count.ToString() + ") bewaren?", "Bewaren?", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

            if (dr == DialogResult.Yes)
            {
                dataAdaptor.UpdateRekeningen(rekeningen);
                dataAdaptor.CommitTransaction(true);
            }
            else
            {
                foreach (tblRekening rek in localRekeningen)
                {
                    rekeningen.Remove(rek);
                }
                dataAdaptor.CancelTransaction(true);
            }
        }