Example #1
0
        private void printPunchCardsMenu_Click(object sender, EventArgs e)
        {
            // Initialize dialog
            // CONSIDER: shouldn't have GetEventDB here! Do something different.
            PrintPunches printPunchesDialog = new PrintPunches(controller.GetEventDB());
            printPunchesDialog.controller = controller;
            printPunchesDialog.PrintSettings = punchPrintSettings;
            printPunchesDialog.PrintSettings.Count = 1;

            // show the dialog, on success, print.
            if (printPunchesDialog.ShowDialog(this) == DialogResult.OK) {
                // Save the settings for the next invocation of the dialog.
                punchPrintSettings = printPunchesDialog.PrintSettings;
                controller.PrintPunches(punchPrintSettings, false);
            }

            // And the dialog is done.
            printPunchesDialog.Dispose();
        }