예제 #1
0
        public void printPreview(PrinteModel model)
        {
            if (model != null)
            {
                printModel = model;
            }
            else
            {
                return;
            }
            try
            {
                init();
                PrintPreviewDialog previewDialog = new PrintPreviewDialog();
                previewDialog.Document = docToPrint;
                var result = previewDialog.ShowDialog();
                if (result == DialogResult.OK)
                {
                    docToPrint.Print();
                }
            }
            catch (Exception ex)
            {

            }
        }
예제 #2
0
        public void print(PrinteModel model)
        {
            //SetCurrentMember(regcode);
            if (model != null)
            {
                printModel = model;
            }
            else
            {
                return;
            }
            try
            {
                init();
                docToPrint.Print();
            }
            catch (Exception ex)
            {
                //logger.Error(ex.Message);
            }

        }