Пример #1
0
        private void GetBooks()
        {
            try
            {
                int pos = bookBindingSource.Position;

                dsBooks = BooksListDataSetFiller.FillData(SelectedAccount.Instance.AccountId);
                bookBindingSource.DataSource = dsBooks;

                bookBindingSource.Position = pos;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + "\n\n" + ex.StackTrace,
                                "Ooops!",
                                MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
 public static BooksListDS FillData(int account)
 {
     BooksListDS _dsDestination = new BooksListDS();
     using (bookTableAdapter _taSource = new bookTableAdapter())
     {
         accountingDataSet.bookDataTable _tblSource = _taSource.GetData(account);
         foreach (accountingDataSet.bookRow row in _tblSource.Rows)
         {
             _dsDestination.Tables["Book"].Rows.Add(new object[] {
                 row.bookId,
                 row.account,
                 row.booktype,
                 row.title,
                 row.created
             });
         }
     }
     return _dsDestination;
 }