Пример #1
0
        private void claimFileDirButton_Click(object sender, EventArgs e)
        {
            DialogResult result = databaseFileDialog.ShowDialog();

            cbFilterODByCheckedOutPerson.Items.Clear();
            cbFilterODByCheckedOutPerson.Items.Add("All");

            cbFilterCOBooksPatron.Items.Clear();
            cbFilterCOBooksPatron.Items.Add("All");

            cbCheckoutTo.Items.Clear();

            if (result == DialogResult.OK)
            {
                databaseFile.Text = databaseFileDialog.FileName;
                lib.OpenLibrary(databaseFileDialog.FileName);
                try
                {
                    List <Patron> patrons = lib.GetAllPatrons();
                    cbFilterODByCheckedOutPerson.Items.AddRange(patrons.ToArray());
                    cbFilterCOBooksPatron.Items.AddRange(patrons.ToArray());
                    cbCheckoutTo.Items.AddRange(patrons.ToArray());

                    UpdateGrids();
                }
                catch (Exception loadingException)
                {
                }
            }
        }