private void PrintReceipt() { var receipt = new Receipt { ReceiptType = this.receiptType }; try { this.header.GetReceiptHeader(receipt, false); this.grid.GetReceiptDetails(receipt, false); this.summary.GetReceiptSummary(receipt); this.GetReceiptFooter(receipt); } catch (Exception ex) { MessageBox.Show(this, String.Format(Strings.MsgErrorPrintFailedWithError, ex.Message), Strings.MsgError, MessageBoxButtons.OK, MessageBoxIcon.Error); return; } new ReceiptReportViewerForm(ReceiptReportModel.ConvertFrom(receipt), this.receiptType).Show(); }
public ReceiptReportViewerForm(ReceiptReportModel receipt, ReceiptType type) { InitializeComponent(); this.Receipt = receipt; this.ReceiptType = type; }