Exemplo n.º 1
0
        private void ExecutePrint(object sender, ExecutedRoutedEventArgs e)
        {
            List <RuntimeData> cData = dataGridHelper.getCurrentDataStack;

            if (cData.Count(x => x.TransactionId == Guid.Empty || x.TransactionId == null) > 0)
            {
                MessageBox.Show("This data contains records that are loaded directly from a file. To print out an invoice data must loaded properly from database. ", "Error");
                return;
            }
            int count;

            if ((count = cData.Count(x => x.FrAmount == 0)) > 0)
            {
                if (MessageBoxResult.No == MessageBox.Show("There are " + count.ToString() + " records whose billed amount is 0. Are you sure you want to continue?"))
                {
                    return;
                }
            }
            count = cData.Count(x => x.FrAmount == null);
            if (count > 0)
            {
                if (MessageBox.Show("There are " + count.ToString() + " records whose billed amount is not set. Are you sure you want to continue? If you continue then amount billed for those those records will be equal to 0.", "Confirm", MessageBoxButton.YesNo) == MessageBoxResult.No)
                {
                    return;
                }
            }
            PrintWindow win = new PrintWindow(cData, cData.Select(x => x.BookingDate).Max(), cData.Select(x => x.BookingDate).Min());

            win.Show();
        }
Exemplo n.º 2
0
        private void MISReportMenuItem_Click(object sender, RoutedEventArgs e)
        {
            PrintWindow win = new PrintWindow(null, DateTime.Today, DateTime.Today, false);

            win.Show();
        }