Ejemplo n.º 1
0
        private void pd2_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
        {
            Rectangle bounds = new Rectangle(50, 40, 800, 1035);       //Some printers can handle up to 1042
            Graphics  g      = e.Graphics;
            string    text;
            Font      headingFont    = new Font("Arial", 13, FontStyle.Bold);
            Font      subHeadingFont = new Font("Arial", 10, FontStyle.Bold);
            int       yPos           = bounds.Top;
            int       center         = bounds.X + bounds.Width / 2;

            #region printHeading
            if (!headingPrinted)
            {
                text = Lan.g(this, "Claim History");
                g.DrawString(text, headingFont, Brushes.Black, center - g.MeasureString(text, headingFont).Width / 2, yPos);
                yPos += (int)g.MeasureString(text, headingFont).Height;
                text  = textDateFrom.Text + " " + Lan.g(this, "to") + " " + textDateTo.Text;
                g.DrawString(text, subHeadingFont, Brushes.Black, center - g.MeasureString(text, subHeadingFont).Width / 2, yPos);
                yPos          += 20;
                headingPrinted = true;
                headingPrintH  = yPos;
            }
            #endregion
            int totalPages = gridHistory.GetNumberOfPages(bounds, headingPrintH);
            yPos = gridHistory.PrintPage(g, pagesPrinted, bounds, headingPrintH);
            pagesPrinted++;
            if (pagesPrinted < totalPages)
            {
                e.HasMorePages = true;
            }
            else
            {
                e.HasMorePages = false;
            }
        }
Ejemplo n.º 2
0
        private void pd_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
        {
            Rectangle bounds = e.MarginBounds;
            //new Rectangle(50,40,800,1035);//Some printers can handle up to 1042
            Graphics g = e.Graphics;
            string   text;
            Font     headingFont    = new Font("Arial", 13, FontStyle.Bold);
            Font     subHeadingFont = new Font("Arial", 10, FontStyle.Bold);
            int      yPos           = bounds.Top;
            int      center         = bounds.X + bounds.Width / 2;

            #region printHeading
            if (!headingPrinted)
            {
                text = Lan.g(this, "Lab Cases");
                g.DrawString(text, headingFont, Brushes.Black, center - g.MeasureString(text, headingFont).Width / 2, yPos);
                yPos          += (int)g.MeasureString(text, headingFont).Height;
                headingPrinted = true;
                headingPrintH  = yPos;
            }
            #endregion
            yPos = gridMain.PrintPage(g, pagesPrinted, bounds, headingPrintH);
            pagesPrinted++;
            if (yPos == -1)
            {
                e.HasMorePages = true;
            }
            else
            {
                e.HasMorePages = false;
            }
            g.Dispose();
        }
Ejemplo n.º 3
0
        private void pd_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
        {
            Rectangle bounds = e.MarginBounds;
            Graphics  g      = e.Graphics;
            string    text;
            Font      headingFont    = new Font("Arial", 13, FontStyle.Bold);
            Font      subHeadingFont = new Font("Arial", 10, FontStyle.Bold);
            int       yPos           = bounds.Top;
            int       center         = bounds.X + bounds.Width / 2;

            #region printHeading
            if (!headingPrinted)
            {
                text = Lan.g(this, "Payroll Benefits Report");
                StringFormat sf = StringFormat.GenericDefault;
                sf.Alignment = StringAlignment.Center;
                g.DrawString(text, headingFont, Brushes.Black, center, yPos, sf);
                yPos += (int)g.MeasureString(text, headingFont).Height;
                g.DrawString(_dtNow.ToString(), subHeadingFont, Brushes.Black, center, yPos, sf);
                yPos          += 20;
                headingPrinted = true;
            }
            #endregion
            yPos = gridMain.PrintPage(g, pagesPrinted, bounds, yPos);
            pagesPrinted++;
            if (yPos == -1)
            {
                e.HasMorePages = true;
            }
            else
            {
                e.HasMorePages = false;
            }
            g.Dispose();
        }
Ejemplo n.º 4
0
        private void pd_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
        {
            Rectangle bounds = e.MarginBounds;
            //new Rectangle(50,40,800,1035);//Some printers can handle up to 1042
            Graphics g = e.Graphics;
            string   text;
            Font     headingFont    = new Font("Arial", 13, FontStyle.Bold);
            Font     subHeadingFont = new Font("Arial", 10, FontStyle.Bold);
            int      yPos           = bounds.Top;
            int      center         = bounds.X + bounds.Width / 2;

            #region printHeading
            if (!headingPrinted)
            {
                text = Lan.g(this, "Outstanding Insurance Claims");
                g.DrawString(text, headingFont, Brushes.Black, center - g.MeasureString(text, headingFont).Width / 2, yPos);
                yPos += (int)g.MeasureString(text, headingFont).Height;
                if (isPreauth)
                {
                    text = "Including Preauthorization";
                }
                else
                {
                    text = "Not Including Preauthorization";
                }
                g.DrawString(text, subHeadingFont, Brushes.Black, center - g.MeasureString(text, subHeadingFont).Width / 2, yPos);
                yPos += 20;
                if (isAllProv)
                {
                    text = "For All Providers";
                }
                else
                {
                    text = "For Providers: ";
                    for (int i = 0; i < provNumList.Count; i++)
                    {
                        text += Providers.GetFormalName(provNumList[i]);
                    }
                }
                g.DrawString(text, subHeadingFont, Brushes.Black, center - g.MeasureString(text, subHeadingFont).Width / 2, yPos);
                yPos          += 20;
                headingPrinted = true;
                headingPrintH  = yPos;
            }
            #endregion
            yPos = gridMain.PrintPage(g, pagesPrinted, bounds, headingPrintH);
            pagesPrinted++;
            if (yPos == -1)
            {
                e.HasMorePages = true;
            }
            else
            {
                e.HasMorePages = false;
                text           = "Total: $" + total.ToString("F");
                g.DrawString(text, subHeadingFont, Brushes.Black, center + gridMain.Width / 2 - g.MeasureString(text, subHeadingFont).Width - 10, yPos);
            }
            g.Dispose();
        }
Ejemplo n.º 5
0
        ///<summary>Transitions the printing state, and sets _yPosCur after finishing printing to save next header/grid starting point.</summary>
        private void PrintGridHelper(ODGrid grid, Rectangle bounds, Graphics g, PrintPageEventArgs e)
        {
            int y = grid.PrintPage(g, _gridPageCur, bounds, _yPosCur);

            if (y == -1)               //Additional page needed to print the rest of the grid.
            {
                e.HasMorePages = true; //Triggers pd_PrintPage(...) to fire again.
                _gridPageCur++;
            }
            else              //Done printing grid
            {
                _yPosCur = y;
                TransitionPrintState();
            }
        }
Ejemplo n.º 6
0
        private void pd_PrintPage(object sender, PrintPageEventArgs e)
        {
            Rectangle bounds = e.MarginBounds;
            Graphics  g      = e.Graphics;
            int       y      = bounds.Top;
            int       midX   = bounds.X + bounds.Width / 2;

            #region printHeading
            if (_gridPrintProgress == EraProcPrintingProgress.DocumentHeader)           //Only print the document heading on the first page.
            {
                string text;
                using (Font font = new Font("Arial", 13, FontStyle.Bold)) {
                    _yPosCur = 0;
                    text     = Lan.g(this, "835 Procedure:") + ((_proc.ProcNum == 0) ? "" : " " + _proc.ProcNum);
                    g.DrawString(text, font, Brushes.Black, midX - g.MeasureString(text, font).Width / 2, y);
                    y   += 25;
                    text = Lan.g(this, "Patient:") + " " + _proc.ClaimPaid.PatientName;
                    g.DrawString(text, font, Brushes.Black, midX - g.MeasureString(text, font).Width / 2, y);
                    y += 25;
                }
                using (Font font = new Font("Arial", 9, FontStyle.Bold)) {
                    text = Lan.g(this, "Proc Adjudicated:") + " " + textProcAdjudicated.Text + "\t\t" + Lan.g(this, "Date Service:") + " " + textDateService.Text;
                    g.DrawString(text, font, Brushes.Black, midX - g.MeasureString(text, font).Width / 2, y);
                    y   += 20;
                    text = Lan.g(this, "Proc Submitted:") + " " + textProcSubmitted.Text + "\t\t" + Lan.g(this, "Ins Paid:") + " " + textInsPaid.Text;
                    g.DrawString(text, font, Brushes.Black, midX - g.MeasureString(text, font).Width / 2, y);
                    y   += 25;                  //Extra 5 pixels to visually group grid header with grid.
                    text = groupBalancing.Text; //Translated
                    g.DrawString(text, font, Brushes.Black, midX - g.MeasureString(text, font).Width / 2, y);
                    y += 20;
                }
                #region In memory balancing grid
                //int colWidth=gridProcedureAdjustments.WidthAllColumns/6;
                ODGrid grid = new ODGrid();
                grid.Width = gridProcedureAdjustments.Width;
                grid.BeginUpdate();
                grid.ListGridColumns.Add(new GridColumn(Lan.g(this, "Proc Fee") + " -", -1));
                grid.ListGridColumns.Add(new GridColumn(Lan.g(this, "Patient Resp Sum") + " -", -1));
                grid.ListGridColumns.Add(new GridColumn(Lan.g(this, "Contractual Oblig. Sum") + " -", -1));
                grid.ListGridColumns.Add(new GridColumn(Lan.g(this, "Payor Reduction Sum") + " -", -1));
                grid.ListGridColumns.Add(new GridColumn(Lan.g(this, "Other Adjustment Sum") + " =", -1));
                grid.ListGridColumns.Add(new GridColumn(Lan.g(this, "Ins Paid Calc"), -1));
                //grid.ComputeColumns();
                grid.ListGridRows.Add(new GridRow(textProcFee.Text,
                                                  textPatRespSum.Text,
                                                  textContractualObligSum.Text,
                                                  textPayorReductionSum.Text,
                                                  textOtherAdjustmentSum.Text,
                                                  textInsPaidCalc.Text)
                                      );
                grid.EndUpdate();
                #endregion
                y = grid.PrintPage(g, _gridPageCur, bounds, y, true);
                grid.Dispose();
                TransitionPrintState();
                _yPosCur = y;
            }
            #endregion
            #region GridProcedureAdjustments
            if (_gridPrintProgress == EraProcPrintingProgress.GridProcAdjHeader)           //Only draw header once.
            {
                PrintGridHeaderHelper(midX, g, gridProcedureAdjustments.Title);
            }
            if (_gridPrintProgress == EraProcPrintingProgress.GridProcAdj)
            {
                PrintGridHelper(gridProcedureAdjustments, bounds, g, e);
            }
            #endregion
            #region GridRemarks
            if (_gridPrintProgress == EraProcPrintingProgress.GridRemarksHeader)           //Only draw header once
            {
                PrintGridHeaderHelper(midX, g, gridRemarks.Title);
            }
            if (_gridPrintProgress == EraProcPrintingProgress.GridRemarks)
            {
                PrintGridHelper(gridRemarks, bounds, g, e);
            }
            #endregion
            #region GridSupplementalInfo
            if (_gridPrintProgress == EraProcPrintingProgress.GridSupplementalHeader)           //Only draw header once
            {
                PrintGridHeaderHelper(midX, g, gridSupplementalInfo.Title);
            }
            if (_gridPrintProgress == EraProcPrintingProgress.GridSupplemental)
            {
                PrintGridHelper(gridSupplementalInfo, bounds, g, e);
            }
            #endregion
            //g.Dispose();//dg System provided object which will be disposed by the system.
        }