Example #1
0
        /// <summary>
        /// 装换对象RecordPrintView
        /// </summary>
        /// <param name="printInCommonView"></param>
        /// <returns></returns>
        RecordPrintView ConvertPrintView(PrintInCommonView printInCommonView)
        {
            RecordPrintView recordPrintView = new RecordPrintView();
            string          fileName        = AppDomain.CurrentDomain.BaseDirectory + @"Report\" + printInCommonView.PrintFileName + ".xml";

            recordPrintView.PrintFileName        = fileName;
            recordPrintView.RecordName           = printInCommonView.RecordName;
            recordPrintView.PrintInpatientView   = printInCommonView.PrintInpatientView;
            recordPrintView.PrintInCommonTabView = printInCommonView.PrintInCommonTabViewList1;
            if (printInCommonView.PrintInCommonTabViewList2 != null &&
                printInCommonView.PrintInCommonTabViewList2.PrintInCommonItemViewList != null &&
                printInCommonView.PrintInCommonTabViewList2.PrintInCommonItemViewList.Count > 0)
            {
                recordPrintView.PrintInCommonItemViewOther = printInCommonView.PrintInCommonTabViewList2.PrintInCommonItemViewList[0];
            }
            if (recordPrintView.PrintInCommonItemViewList == null)
            {
                recordPrintView.PrintInCommonItemViewList = new List <PrintInCommonItemView>();
            }
            if (recordPrintView.PrintInCommonItemViewOther == null)
            {
                recordPrintView.PrintInCommonItemViewOther = new PrintInCommonItemView();
            }

            return(recordPrintView);
        }
Example #2
0
 /// <summary>
 /// 打印全部事件
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 void printDocumentPre_PrintPage(object sender, PrintPageEventArgs e)
 {
     try
     {
         if (m_printInCommonView == null ||
             m_printInCommonView.PrintInCommonTabViewList1 == null)
         {
             return;
         }
         if (m_printInCommonView.PrintInCommonTabViewList1.PrintInCommonItemViewList == null)
         {
             m_printInCommonView.PrintInCommonTabViewList1.PrintInCommonItemViewList = new List <PrintInCommonItemView>();
         }
         int PageRecordCount           = iPrintNurse.PageRecordCount; //每张的行数
         var PrintInCommonItemViewList = m_printInCommonView.PrintInCommonTabViewList1.PrintInCommonItemViewList;
         int allcount  = PrintInCommonItemViewList.Count;
         int pageCount = (allcount + PageRecordCount - 1) / PageRecordCount;  //总页数
         if (pageCount == 0)
         {
             pageCount = 1;
         }
         List <PrintInCommonItemView> printInCommonItemViewEven = new List <PrintInCommonItemView>();
         for (int j = printPageNowPer * PageRecordCount; j < ((printPageNowPer + 1) * PageRecordCount); j++)
         {
             if (j < allcount)
             {
                 PrintInCommonItemViewList[j].RowNum = j + 1;
                 InCommonNoteBiz.ConvertForImgRec(PrintInCommonItemViewList[j]);
                 printInCommonItemViewEven.Add(PrintInCommonItemViewList[j]);
             }
         }
         InCommonNoteBiz.ConvertForDateTime(printInCommonItemViewEven);
         InCommonNoteBiz.SetRowEnd(printInCommonItemViewEven, m_printInCommonView.PrintFileName);
         RecordPrintView recordPrintView = ConvertPrintView(m_printInCommonView);
         recordPrintView.PrintInpatientView.ListCount = printInCommonItemViewEven.Count.ToString();
         int Addpage = Convert.ToInt32(speNum.Value);
         recordPrintView.PrintInpatientView.CurrPage = (printPageNowPer + Addpage).ToString();
         recordPrintView.PrintInCommonItemViewList   = printInCommonItemViewEven;
         iPrintNurse.GetPreview(recordPrintView, e.Graphics);
         if (printPageNowPer < pageCount - 1 && printPageNowPer < printEnd - 1)
         {
             e.HasMorePages             = true;
             printPreviewControl1.Rows += 1;
             printPageNowPer++;
             return;
         }
         else
         {
             spinEditPage.Properties.MinValue = (int)speNum.Value;
             spinEditPage.Properties.MaxValue = pageCount + (int)speNum.Value - 1;
             printPageNowPer = 0;
             e.HasMorePages  = false;
         }
     }
     catch (Exception ex)
     {
         DrectSoft.Common.Ctrs.DLG.MyMessageBox.Show(ex.Message + ex.StackTrace);
     }
 }
Example #3
0
 public void GetPreview(RecordPrintView recordPrintView, Graphics g)
 {
     try
     {
         Drawer drawer = new Drawer(g);
         drawer.Draw(recordPrintView);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Example #4
0
        /// <summary>
        /// 打印指定列事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void printDocumentPrintNow_PrintPage(object sender, PrintPageEventArgs e)
        {
            try
            {
                if (m_printInCommonView == null ||
                    m_printInCommonView.PrintInCommonTabViewList1 == null)
                {
                    return;
                }
                if (m_printInCommonView.PrintInCommonTabViewList1.PrintInCommonItemViewList == null)
                {
                    m_printInCommonView.PrintInCommonTabViewList1.PrintInCommonItemViewList = new List <PrintInCommonItemView>();
                }
                var PrintInCommonItemViewList = m_printInCommonView.PrintInCommonTabViewList1.PrintInCommonItemViewList;
                int allcount        = PrintInCommonItemViewList.Count;
                int PageRecordCount = iPrintNurse.PageRecordCount;                     //每张的行数
                int pageIndex       = (int)spinEditPage.Value - (int)speNum.Value + 1; //实际打印页码需要重新计算
                List <PrintInCommonItemView> printInCommonItemViewEven = new List <PrintInCommonItemView>();
                for (int j = (pageIndex - 1) * PageRecordCount; j < (pageIndex * PageRecordCount); j++)
                {
                    if (j < allcount)
                    {
                        PrintInCommonItemViewList[j].RowNum = j + 1;
                        printInCommonItemViewEven.Add(PrintInCommonItemViewList[j]);
                    }
                }
                InCommonNoteBiz.ConvertForDateTime(printInCommonItemViewEven);
                InCommonNoteBiz.SetRowEnd(printInCommonItemViewEven, m_printInCommonView.PrintFileName);
                RecordPrintView recordPrintView = ConvertPrintView(m_printInCommonView);
                recordPrintView.PrintInpatientView.ListCount = printInCommonItemViewEven.Count.ToString();

                int Addpage = Convert.ToInt32(speNum.Value);
                recordPrintView.PrintInpatientView.CurrPage = (pageIndex + Addpage - 1).ToString();

                recordPrintView.PrintInCommonItemViewList = printInCommonItemViewEven;
                iPrintNurse.GetPreview(recordPrintView, e.Graphics);
                e.HasMorePages = false;
            }
            catch (Exception ex)
            {
                DrectSoft.Common.Ctrs.DLG.MyMessageBox.Show(ex.Message + ex.StackTrace);
            }
        }
 /// <summary>
 /// 画护理单表格
 /// </summary>
 /// <param name="_recordPrintView">表格内容</param>
 public void Draw(RecordPrintView _recordPrintView)
 {
     try
     {
         recordPrintView = _recordPrintView;
         doc             = new XmlDocument();
         doc.Load(recordPrintView.PrintFileName);
         PrintPageSizeWidth  = int.Parse(CommonMethods.GetElementAttribute("PrintPageSize", "width", doc));
         PrintPageSizeHeight = int.Parse(CommonMethods.GetElementAttribute("PrintPageSize", "height", doc));
         startY = int.Parse(CommonMethods.GetElementAttribute("ImageSize", "dataRegionStartY", doc));
         f      = new Font(CommonMethods.GetElementAttribute("DataValueStyle", "fontName", doc), float.Parse(CommonMethods.GetElementAttribute("DataValueStyle", "fontSize", doc)), FontStyle.Regular);
         DrawColumns();
         DrawLines();
         FillData(recordPrintView.PrintInCommonItemViewList);
         FillTitle();
         FillPatientInfo(recordPrintView.PrintInpatientView);
         FillOtherInfo(recordPrintView.PrintInCommonItemViewOther);
         DrawSpecialLine();
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Example #6
0
 public void GetPrintimage(RecordPrintView recordPrintView, Graphics g)
 {
     throw new NotImplementedException();
 }
Example #7
0
        public void GetPreview(RecordPrintView recordPrintView, System.Drawing.Graphics g)
        {
            Drawer drawer = new Drawer(g);

            drawer.Draw(recordPrintView);
        }