/// <summary>
        /// 爱婴区婴儿评估表-特殊记录
        /// </summary>
        /// <param name="e"></param>
        private void m_mthPrintAYQBabyEspRecord(PrintPageEventArgs e)
        {
            System.Drawing.Graphics p_objGrp = e.Graphics;
            com.digitalwave.controls.clsPrintRichTextContext m_objPrintContext = new com.digitalwave.controls.clsPrintRichTextContext(Color.Black, m_fontBody);

            RectangleF m_rtgF = new RectangleF((float)m_objPrintSize.LeftX + 20, m_intPosY, m_intPrintWidth, m_intRowHeight);

            // 打印格式
            StringFormat m_strFormat = new StringFormat();

            m_strFormat.LineAlignment = StringAlignment.Center;
            m_strFormat.Alignment     = StringAlignment.Near;

            p_objGrp.DrawString("特殊记录", m_fontBody, m_objBrush, m_rtgF, m_strFormat);
            m_intPosY += m_intRowHeight;

            if (m_objPrintMainInfo == null || m_objPrintMainInfo.m_objAYQEspRecord == null)
            {
                return;
            }

            m_objPrintContext.m_mthSetContextWithCorrectBefore(m_objPrintMainInfo.m_objAYQEspRecord.m_strEspRecord, m_objPrintMainInfo.m_objAYQEspRecord.m_strEspRecordXML, DateTime.Now);


            int m_intRealHeight = m_objPrintContext.m_intMeasureBlockHeightBySimSun(m_fontBody.Size, m_intPrintWidth - 50, p_objGrp);

            if (m_intPosY + m_intRealHeight > m_intPrintHeight + (int)m_objPrintSize.TopY)
            {
                e.HasMorePages = true;
                // 打印页脚
                m_mthPrintFoot(e);
                return;
            }

            Rectangle m_rtg = new Rectangle((int)m_objPrintSize.LeftX + 50, m_intPosY, m_intPrintWidth - 50, m_intRowHeight);

            m_objPrintContext.m_blnPrintAllBySimSun(m_fontBody.Size, m_rtg, p_objGrp, out m_intRealHeight, false);

            if (m_intRealHeight > m_intRowHeight)
            {
                m_intPosY += m_intRealHeight;
            }
            else
            {
                m_intPosY += m_intRowHeight;
            }

            // 打印页脚
            m_mthPrintFoot(e);

            m_strFormat.Dispose();

            e.HasMorePages = false;
        }
Exemple #2
0
            public override void m_mthPrintNextLine(ref int p_intPosY, System.Drawing.Graphics p_objGrp, System.Drawing.Font p_fntNormalText)
            {
                Rectangle rtgTitle = new Rectangle(
                    (int)enmRectangleInfo.LeftX,
                    p_intPosY + 10,
                    (int)enmRectangleInfo.ColumnsMark1,
                    0);
                Rectangle rtgDianose = new Rectangle(
                    (int)enmRectangleInfo.LeftX + (int)enmRectangleInfo.ColumnsMark1 + 5,
                    p_intPosY + 10,
                    (int)enmRectangleInfo.RightX - ((int)enmRectangleInfo.LeftX + (int)enmRectangleInfo.ColumnsMark1 + 5) - 5,
                    0);

                int intPosY = p_intPosY;

                //原始固定的高度
                int intPegPosY = 0;

                switch (m_strTitle)
                {
                case " 诊  断":
                    rtgTitle.Height = c_intHeight1 - 5;
                    intPegPosY      = 190;
//						rtgDianose.Height = c_intHeight1-5;
//						p_intPosY += c_intHeight1;
                    break;

                case " 诊断依据":
                    if ((rtgTitle.Height = (c_intHeight2 - 5 - s_intHeightMargin)) < c_intOneRowHeight)
                    {
                        if (rtgTitle.Height < 0)
                        {
                            s_intHeightMargin = Math.Abs(rtgTitle.Height);
                        }
                        rtgTitle.Height = c_intOneRowHeight;
                    }
                    intPegPosY = 300;
//						rtgDianose.Height = c_intHeight1-5;//c_intHeight2-5;
//						p_intPosY += c_intHeight2;
                    break;

                case "手术适应症":
                    if ((rtgTitle.Height = c_intHeight3 - 5 - s_intHeightMargin) < c_intOneRowHeight)
                    {
                        if (rtgTitle.Height < 0)
                        {
                            s_intHeightMargin = Math.Abs(rtgTitle.Height);
                        }
                        rtgTitle.Height = c_intOneRowHeight;
                    }
                    intPegPosY = 400;
//						rtgDianose.Height = c_intHeight1-5;//c_intHeight3-5;
//						p_intPosY += c_intHeight3;
                    break;

                case "拟行手术方式术中注意事项及特殊情况的预防及处理":
                    if ((rtgTitle.Height = c_intHeight4 - 5 - s_intHeightMargin) < c_intHeight4 - 15)
                    {
                        if (rtgTitle.Height < 0)
                        {
                            s_intHeightMargin = Math.Abs(rtgTitle.Height);
                        }
                        rtgTitle.Height = c_intHeight4 - 15;
                    }
                    intPegPosY = 510;
//						rtgDianose.Height = c_intHeight9-15;//c_intHeight4-5;
//						p_intPosY += c_intHeight4;
                    break;

                case " 术前准备":
                    if ((rtgTitle.Height = c_intHeight5 - 5 - s_intHeightMargin) < c_intOneRowHeight)
                    {
                        if (rtgTitle.Height < 0)
                        {
                            s_intHeightMargin = Math.Abs(rtgTitle.Height);
                        }
                        rtgTitle.Height = c_intOneRowHeight;
                    }
                    intPegPosY = 610;
//						rtgDianose.Height = c_intHeight1-5;//c_intHeight5-5;
//						p_intPosY += c_intHeight5;
                    break;

                case "患者及家属单位对手术意见":
                    if ((rtgTitle.Height = c_intHeight6 - 5 - s_intHeightMargin) < c_intHeight6 - 5)
                    {
                        if (rtgTitle.Height < 0)
                        {
                            s_intHeightMargin = Math.Abs(rtgTitle.Height);
                        }
                        rtgTitle.Height = c_intHeight6 - 5;
                    }
                    intPegPosY = 670;
//						rtgDianose.Height = c_intHeight6-15;//c_intHeight6-5;
                    break;

                case " 拟行麻醉":
                    if ((rtgTitle.Height = c_intHeight7 - 5 - s_intHeightMargin) < c_intOneRowHeight)
                    {
                        if (rtgTitle.Height < 0)
                        {
                            s_intHeightMargin = Math.Abs(rtgTitle.Height);
                        }
                        rtgTitle.Height = c_intOneRowHeight;
                    }
                    intPegPosY = 720;
//						rtgDianose.Height = c_intHeight1-5;//c_intHeight7-5;
//						p_intPosY += c_intHeight7;
                    break;

                case " 手术日期":
                    if ((rtgTitle.Height = c_intHeight8 - 5 - s_intHeightMargin) < c_intOneRowHeight)
                    {
                        if (rtgTitle.Height < 0)
                        {
                            s_intHeightMargin = Math.Abs(rtgTitle.Height);
                        }
                        rtgTitle.Height = c_intOneRowHeight;
                    }
                    intPegPosY = 750;
//						rtgDianose.Height = c_intHeight1-5;//c_intHeight8-5;
//						p_intPosY += c_intHeight8;
                    break;

                case " 术后注意":
                    if ((rtgTitle.Height = c_intHeight9 - 5 - s_intHeightMargin) < c_intOneRowHeight)
                    {
                        if (rtgTitle.Height < 0)
                        {
                            s_intHeightMargin = Math.Abs(rtgTitle.Height);
                        }
                        rtgTitle.Height = c_intOneRowHeight;
                    }
                    intPegPosY = 840;
//						rtgDianose.Height = c_intHeight1-5;//c_intHeight9-5;
//						p_intPosY += c_intHeight9;
                    break;

                case "术前讨论意见":
                    if ((rtgTitle.Height = c_intHeight10 - 5 - s_intHeightMargin) < c_intOneRowHeight)
                    {
                        if (rtgTitle.Height < 0)
                        {
                            s_intHeightMargin = Math.Abs(rtgTitle.Height);
                        }
                        rtgTitle.Height = c_intOneRowHeight;
                    }
                    intPegPosY = 900;
//						rtgDianose.Height = 900 - p_intPosY;//c_intHeight10-5;
//						p_intPosY = 900;//c_intHeight10;
                    break;
                }

                StringFormat stfTitle = new StringFormat(StringFormatFlags.FitBlackBox);
                Font         fntTitle = new Font("SimSun", 12);

                p_objGrp.DrawString(m_strTitle, fntTitle, Brushes.Black, rtgTitle, stfTitle);

                int intRealHeight;

                m_objDiagnose.m_blnPrintAllBySimSun(10, rtgDianose, p_objGrp, out intRealHeight, false);

                if (intRealHeight > rtgTitle.Height)
                {
                    p_intPosY += intRealHeight + 10;
                }
                else
                {
                    p_intPosY += rtgTitle.Height + 5;
                }
                if (p_intPosY > intPegPosY)
                {
                    s_intHeightMargin += p_intPosY - intPegPosY;
                }
                else
                {
                    s_intHeightMargin = 0;
                }


                p_objGrp.DrawLine(Pens.Black, (int)enmRectangleInfo.LeftX,
                                  p_intPosY,
                                  (int)enmRectangleInfo.RightX,
                                  p_intPosY);

                fntTitle.Dispose();
                stfTitle.Dispose();

                m_blnHaveMoreLine = false;

                #region old
//				p_intPosY +=5;///////////////////////////////////
//				if(m_blnFirstPrint)
//				{
//					if(m_strTitle=="拟行手术方式术中注意事项及特殊情况的预防及处理 ")
//					{
//						p_objGrp.DrawString(m_strTitle.Substring(m_intTimes*6,6),new Font("SimSun",12) ,Brushes.Black,(int)enmRectangleInfo.LeftX,p_intPosY);
//						if(m_intTimes>=3)
//							m_blnFirstPrint = false;
//					}
//					else if(m_strTitle=="患者及家属单位对手术意见")
//					{
//						p_objGrp.DrawString(m_strTitle.Substring(m_intTimes*6,6),new Font("SimSun",12) ,Brushes.Black,(int)enmRectangleInfo.LeftX,p_intPosY);
//						if(m_intTimes>=1)
//							m_blnFirstPrint = false;
//					}
//					else
//					{
//						p_objGrp.DrawString(m_strTitle,new Font("SimSun",12) ,Brushes.Black,(int)enmRectangleInfo.LeftX,p_intPosY+3);
//						m_blnFirstPrint = false;
//					}
//				}
//
//				if(m_objDiagnose.m_BlnHaveNextLine())
//					m_objDiagnose.m_mthPrintLine((int)enmRectangleInfo.RightX- ((int)enmRectangleInfo.LeftX+(int)enmRectangleInfo.ColumnsMark1+5)-5, (int)enmRectangleInfo.LeftX+(int)enmRectangleInfo.ColumnsMark1+5,p_intPosY,p_objGrp);
//
//				if(m_objDiagnose.m_BlnHaveNextLine())
//				{
//					m_blnHaveMoreLine = true;
//					p_intPosY +=(int)enmRectangleInfo.SmallRowStep+5 ;
//					m_intTimes++;
//				}else
//					if((m_strTitle=="拟行手术方式术中注意事项及特殊情况的预防及处理 " && m_intTimes<3)|| (m_strTitle=="患者及家属单位对手术意见" && m_intTimes<1))
//				{
//					m_blnHaveMoreLine = true;
//					p_intPosY +=(int)enmRectangleInfo.SmallRowStep+5 ;
//					m_intTimes++;
//				}
//				else
//				{
//					m_blnHaveMoreLine = false;
//					p_intPosY += (int)enmRectangleInfo.RowStep+5;
//
//					if(m_strTitle=="诊断依据")
//					{
//						//dick 添加默认的打印宽度
//						if(m_intTimes < 5 && m_intTimes!=0)
//						{
//							p_intPosY += (5-m_intTimes)*(int)enmRectangleInfo.RowStep;
//
//						}
//
//						else if(m_intTimes == 0)
//						{
//							p_intPosY +=5*(int)enmRectangleInfo.RowStep;
//						}
//						if(p_intPosY>=(int)enmRectangleInfo.BottomY)
//						{
//							p_intPosY=(int)enmRectangleInfo.BottomY;
//						}
//						else
//						{
//							p_objGrp.DrawLine(new Pen(Color.Black,1),(int)enmRectangleInfo.LeftX ,
//								p_intPosY,
//								(int)enmRectangleInfo.RightX,
//								p_intPosY);
//						}
//
//					}
//					else if(m_strTitle=="手术适应症")
//					{
//						if(m_intTimes < 5 && m_intTimes!=0)
//						{
//							p_intPosY += (5-m_intTimes)*(int)enmRectangleInfo.RowStep;
//
//						}
//
//						else if(m_intTimes == 0)
//						{
//							p_intPosY +=5*(int)enmRectangleInfo.RowStep;
//						}
//						if(p_intPosY>=(int)enmRectangleInfo.BottomY)
//						{
//							p_intPosY=(int)enmRectangleInfo.BottomY;
//						}
//						else
//						{
//							p_objGrp.DrawLine(new Pen(Color.Black,1),(int)enmRectangleInfo.LeftX ,
//								p_intPosY,
//								(int)enmRectangleInfo.RightX,
//								p_intPosY);
//						}
//
//					}
//					else if(m_strTitle=="拟行手术方式术中注意事项及特殊情况的预防及处理")
//					{
//						if(m_intTimes < 3 && m_intTimes!=0)
//						{
//							p_intPosY += (3-m_intTimes)*(int)enmRectangleInfo.RowStep;
//
//						}
//
//						else if(m_intTimes == 0)
//						{
//							p_intPosY +=3*(int)enmRectangleInfo.RowStep;
//						}
//						if(p_intPosY>=(int)enmRectangleInfo.BottomY)
//						{
//							p_intPosY=(int)enmRectangleInfo.BottomY;
//						}
//						else
//						{
//							p_objGrp.DrawLine(new Pen(Color.Black,1),(int)enmRectangleInfo.LeftX ,
//								p_intPosY,
//								(int)enmRectangleInfo.RightX,
//								p_intPosY);
//						}
//
//					}
//					else if(m_strTitle=="术前准备")
//					{
//						if(m_intTimes < 5 && m_intTimes!=0)
//						{
//							p_intPosY += (5-m_intTimes)*(int)enmRectangleInfo.RowStep;
//
//						}
//
//						else if(m_intTimes == 0)
//						{
//							p_intPosY +=5*(int)enmRectangleInfo.RowStep;
//						}
//						if(p_intPosY>=(int)enmRectangleInfo.BottomY)
//						{
//							p_intPosY=(int)enmRectangleInfo.BottomY;
//						}
//						else
//						{
//							p_objGrp.DrawLine(new Pen(Color.Black,1),(int)enmRectangleInfo.LeftX ,
//								p_intPosY,
//								(int)enmRectangleInfo.RightX,
//								p_intPosY);
//						}
//
//					}
//
//					else if(m_strTitle=="手术日期")
//					{
//						if(m_intTimes < 1 && m_intTimes!=0)
//						{
//							p_intPosY += (1-m_intTimes)*(int)enmRectangleInfo.RowStep;
//
//						}
//
//						else if(m_intTimes == 0)
//						{
//							p_intPosY +=1*(int)enmRectangleInfo.RowStep;
//						}
//						if(p_intPosY>=(int)enmRectangleInfo.BottomY)
//						{
//							p_intPosY=(int)enmRectangleInfo.BottomY;
//						}
//						else
//						{
//							p_objGrp.DrawLine(new Pen(Color.Black,1),(int)enmRectangleInfo.LeftX ,
//								p_intPosY,
//								(int)enmRectangleInfo.RightX,
//								p_intPosY);
//						}
//
//					}
//					else
//					{
//						if(m_intTimes < 2 && m_intTimes!=0)
//						{
//							p_intPosY += (2-m_intTimes)*(int)enmRectangleInfo.RowStep;
//
//						}
//
//						else if(m_intTimes == 0)
//						{
//							p_intPosY +=2*(int)enmRectangleInfo.RowStep;
//						}
//						if(p_intPosY>=(int)enmRectangleInfo.BottomY)
//						{
//							p_intPosY=(int)enmRectangleInfo.BottomY;
//						}
//						else
//						{
//							p_objGrp.DrawLine(new Pen(Color.Black,1),(int)enmRectangleInfo.LeftX ,
//								p_intPosY,
//								(int)enmRectangleInfo.RightX,
//								p_intPosY);
//						}
//
//					}
                //					m_blnHaveMoreLine = false;
                //					p_intPosY += (int)enmRectangleInfo.RowStep;
                //
                //					p_objGrp.DrawLine(new Pen(Color.Black,1),(int)enmRectangleInfo.LeftX ,
                //						p_intPosY,
                //						(int)enmRectangleInfo.RightX,
                //						p_intPosY);
//				}
                #endregion
            }