Exemplo n.º 1
0
        //Preconditions: Click Insert>Patron
        //Postconditions: pops up dialog box for user to enter patron information then adds to the library
        private void patronSubMenuItem_Click(object sender, EventArgs e)
        {
            PatronDialogBox patronDBox = new PatronDialogBox();    //create object for PatronDialogBox

            patronDBox.ShowDialog();                               //pulls up the PatronDialogBox - modal

            theLibrary.AddPatron(patronDBox.AddPatronName, patronDBox.AddPatronID);
        }
Exemplo n.º 2
0
        //Preconditions: click Report>List Patrons
        //Postconditions: goes through a loop to display all the patrons in the library
        private void patronListSubMenuItem_Click(object sender, EventArgs e)
        {
            PatronDialogBox patronDBox = new PatronDialogBox(); //create object for PatronDialogBox

            outputTextBox.Text = "";                            //Clears the textbox

            outputTextBox.Text = "Count of Patrons: " + theLibrary.GetPatronCount() + System.Environment.NewLine +
                                 System.Environment.NewLine;

            for (int k = 0; k < theLibrary._patrons.Count; k++)     //loops through the library and displays patrons
            {
                outputTextBox.Text += theLibrary._patrons[k] +
                                      System.Environment.NewLine + System.Environment.NewLine;
            }
        }