Esempio n. 1
0
 private void BtnAddReader_Click(object sender, EventArgs e)
 {
     using (var form = new AddEditReaderForm(null, readersRepository))
     {
         if (form.ShowDialog() == DialogResult.OK)
         {
             readerBindingSource.DataSource = readersRepository.GetAll().ToList();
         }
     }
 }
Esempio n. 2
0
        private void BtnEditReader_Click(object sender, EventArgs e)
        {
            if (readerBindingSource.Current == null)
            {
                return;
            }

            using (var form = new AddEditReaderForm((Reader)readerBindingSource.Current, readersRepository))
            {
                if (form.ShowDialog() == DialogResult.OK)
                {
                    readerBindingSource.ResetCurrentItem();
                }
            }
        }