private void hyperlink4_RequestNavigate(object sender, System.Windows.Navigation.RequestNavigateEventArgs e)
        {
            DatePeriodPicker pck = new DatePeriodPicker();

            pck.Owner = this;
            pck.ShowDialog();
            if (pck.PeriodSelected)
            {
                startPeriod = pck.startPeriod;
                endPeriod   = pck.endPeriod;

                NotificationWindow dlg = new NotificationWindow();
                dlg.ShowModal("Please wait as the report is exported and your default mail client started.");
                DispatcherHelper.DoEvents();
                string ext = ".doc";
                string fmt = "WORD";
                if (("Microsoft Word (*.doc)").Equals(comboBox1.Text))
                {
                    ext = ".doc";
                    fmt = "WORD";
                }
                else if (("Microsoft Excel (*.xls)").Equals(comboBox1.Text))
                {
                    ext = ".xls";
                    fmt = "EXCEL";
                }
                else if (("Adobe PDF (*.pdf)").Equals(comboBox1.Text))
                {
                    ext = ".pdf";
                    fmt = "PDF";
                }
                string PathName = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
                string FileName = PathName + "\\reports\\" + string.Format("AccumulatedPaid-{0:ddMMyyyy-HHmm}", DateTime.Now) + ext;

                if (ExportReport(ReportType.REPORT_ACCUMULATED_PAID, FileName, fmt))
                {
                    MAPI mapi = new MAPI();
                    mapi.AddAttachment(FileName);
                    mapi.SendMailPopup(Config.Subject, Config.BodyText);
                }
                else
                {
                    MessageBox.Show("Failed to export and email the report.", "Express Taxi", MessageBoxButton.OK, MessageBoxImage.Error);
                }
                dlg.CloseModal();
            }
            e.Handled = true;
        }
        private void ServicesReport_Click(object sender, RoutedEventArgs e)
        {
            DatePeriodPicker dlg2 = new DatePeriodPicker();

            dlg2.Owner = this;
            dlg2.ShowDialog();
            if (dlg2.PeriodSelected)
            {
                ViewReport dlg = new ViewReport();
                dlg.type        = ReportType.REPORT_SERVICES;
                dlg.conn        = conn;
                dlg.startPeriod = dlg2.startPeriod;
                dlg.endPeriod   = dlg2.endPeriod;
                dlg.ShowDialog();
            }
        }
        private void AccumulatedPaid_Click(object sender, RoutedEventArgs e)
        {
            DatePeriodPicker dlg2 = new DatePeriodPicker();

            dlg2.Owner = this;
            dlg2.ShowDialog();
            if (dlg2.PeriodSelected)
            {
                ViewReport dlg = new ViewReport();
                dlg.type        = ReportType.REPORT_ACCUMULATED_PAID;
                dlg.conn        = conn;
                dlg.startPeriod = dlg2.startPeriod;
                dlg.endPeriod   = dlg2.endPeriod;
                dlg.ShowDialog();
            }
        }