/// <summary> /// 从数据库初始化打印内容。如果没有记录,打印空报表。(当从数据库读取时要调用.) /// </summary> public void m_mthInitPrintContent() { m_blnWantInit = false; // if (m_objPrintInfo == null) { clsPublicFunction.ShowInformationMessageBox("调用m_mthInitPrintContent之前请首先调用m_mthSetPrintInfo函数"); return; } clsTrackRecordContent objContent = new clsTrackRecordContent(); if (m_objPrintInfo.m_strInPatentID == "" || m_objPrintInfo.m_dtmOpenDate == DateTime.MinValue) { m_objRecordContent = null; } else { m_objRecordsDomain = new clsOutHospitalDomain(); long lngRes = m_objRecordsDomain.m_lngGetRecordContent(m_objPrintInfo.m_strInPatentID, m_objPrintInfo.m_dtmInPatientDate.ToString("yyyy-MM-dd HH:mm:ss"), m_objPrintInfo.m_dtmOpenDate.ToString("yyyy-MM-dd HH:mm:ss"), out objContent); if (lngRes <= 0) { return; } m_objRecordContent = (clsOutHospitalRecordContent)objContent; } if (m_objRecordContent != null) { if (m_dtmOutDate == DateTime.MinValue) { m_objRecordContent.m_dtmOutHospitalDate = ((clsOutHospitalRecordContent)objContent).m_dtmOutHospitalDate; } else { m_objRecordContent.m_dtmOutHospitalDate = m_dtmOutDate; } } //设置表单内容到打印中 m_objPrintInfo.m_objRecordContent = m_objRecordContent; m_mthSetPrintValue(); //无论有否打印数据,即使在打印空白表时,此行也必须执行. }
public override void m_mthPrintNextLine(ref int p_intPosY, System.Drawing.Graphics p_objGrp, System.Drawing.Font p_fntNormalText) { //p_objGrp.DrawString("产科出院记录", m_fotItemHead, Brushes.Black, m_intRecBaseX + 290, p_intPosY - 10); //p_intPosY += 20; //p_objGrp.DrawString("姓名:" + m_objPrintInfo.m_strPatientName, p_fntNormalText, Brushes.Black, m_intPatientInfoX + 10, p_intPosY); //p_objGrp.DrawString("住院号:" + m_objPrintInfo.m_strHISInPatientID, p_fntNormalText, Brushes.Black, m_intPatientInfoX + 350, p_intPosY); //出院时间 clsOutHospitalRecordContent m_objRecordOutHost = null; clsOutHospitalDomain m_myOutHosptialDom; DateTime m_dtTmp = DateTime.Now; if (m_objPrintInfo.m_strInPatientID == "" || m_objPrintInfo.m_dtmOpenDate == DateTime.MinValue) { m_myOutHosptialDom = null; } else { m_myOutHosptialDom = new clsOutHospitalDomain(); clsTrackRecordContent objContent = new clsTrackRecordContent(); long lngResm = m_myOutHosptialDom.m_lngGetRecordContent(m_objPrintInfo.m_objContent.m_strInPatientID, m_objPrintInfo.m_dtmInPatientDate.ToString("yyyy-MM-dd HH:mm:ss"), m_objPrintInfo.m_dtmOpenDate.ToString("yyyy-MM-dd HH:mm:ss"), out objContent); if (lngResm > 0) { m_objRecordOutHost = (clsOutHospitalRecordContent)objContent; } if (m_objRecordOutHost != null) { m_dtTmp = m_objRecordOutHost.m_dtmOutHospitalDate; } } //*出院时间 //p_intPosY += 20; if (m_objPrintInfo.m_dtmInPatientDate != DateTime.MinValue) { p_objGrp.DrawString("住院日期:" + m_objPrintInfo.m_dtmInPatientDate.ToString("yyyy年MM月dd日 HH时"), p_fntNormalText, Brushes.Black, m_intPatientInfoX + 10, p_intPosY); } else { p_objGrp.DrawString("住院日期:", p_fntNormalText, Brushes.Black, m_intPatientInfoX + 10, p_intPosY); } DateTime p_dtmOutHospitalDate = new DateTime(1900, 1, 1); string strRegisterID = ""; long lngRes = 0; if (m_dtTmp != DateTime.MinValue) { p_objGrp.DrawString("至:" + m_dtTmp.ToString("yyyy年MM月dd日 HH时"), p_fntNormalText, Brushes.Black, m_intPatientInfoX + 350, p_intPosY); } else { p_objGrp.DrawString("至:" + DateTime.Now.ToString("yyyy年MM月dd日 HH时"), p_fntNormalText, Brushes.Black, m_intPatientInfoX + 350, p_intPosY); } p_intPosY += 20; TimeSpan m_ds_During = m_dtTmp - m_objPrintInfo.m_dtmHISInDate; p_objGrp.DrawString("住院天数:" + m_ds_During.Days.ToString() + "天", p_fntNormalText, Brushes.Black, m_intPatientInfoX + 10, p_intPosY); p_intPosY += 30; m_blnHaveMoreLine = false; }