Ejemplo n.º 1
0
        private void bnAddSource_Click(object sender, EventArgs e)
        {
            try
            {
                BackupSource BackupSource = new BackupSource();
                frmNewSource NQ = new frmNewSource(ref BackupSource);
                if (NQ.ShowDialog(this) == System.Windows.Forms.DialogResult.OK)
                {

                    Settings.Sources.Add(BackupSource);
                    ((CurrencyManager)dgvSources.BindingContext[Settings.Sources]).Refresh();
                    dgvSources.CurrentCell = dgvSources[0, dgvSources.RowCount - 1];

                }
            }
            catch (Exception ex)
            {
                HelperFunctions.ShowError(ex);
            }
        }
Ejemplo n.º 2
0
 private void Edit()
 {
     try
     {
         if (dgvSources.Rows.Count == 0) return;
         BackupSource BackupSource = Settings.Sources[dgvSources.CurrentCell.RowIndex];
         frmNewSource NQ = new frmNewSource(ref BackupSource);
         if (NQ.ShowDialog() == System.Windows.Forms.DialogResult.OK)
         {
             ((CurrencyManager)dgvSources.BindingContext[Settings.Sources]).Refresh();
         }
     }
     catch (Exception ex)
     {
         HelperFunctions.ShowError(ex);
     }
 }