protected override object[][] m_objGetRecordsValueArr(clsTransDataInfo p_objTransDataInfo) { #region 显示记录到DataGrid try { // #region 处理产次 // m_txtDiseaseID.Text = ""; // //m_dtpCreateDate.Value = System.DateTime.Now; // #endregion if (p_objTransDataInfo == null) { return(null); } object[] objData; ArrayList objReturnData = new ArrayList(); clsICUACAD_POSTPARTUMSEERECORDContentDataInfo objICUInfo = new clsICUACAD_POSTPARTUMSEERECORDContentDataInfo(); //(需要改动) clsDSTRichTextBoxValue objclsDSTRichTextBoxValue; string strText, strXml; objICUInfo = (clsICUACAD_POSTPARTUMSEERECORDContentDataInfo)p_objTransDataInfo; //(需要改动) if (objICUInfo.m_objRecordArr == null) { return(null); } int intRecordCount = objICUInfo.m_objRecordArr.Length; int intRowOfCurrentDetail = 0; #region 获取修改限定时间 int intCanModifyTime = 0; try { intCanModifyTime = int.Parse(m_strCanModifyTime); } catch { intCanModifyTime = 6; } #endregion for (int i = 0; i < intRecordCount; i++) { objData = new object[17]; //(需要改动) DataTable的列数 clsIcuACAD_PostPartumseeRecord_VO objCurrent = objICUInfo.m_objRecordArr[i]; //(需要改动) clsIcuACAD_PostPartumseeRecord_VO objNext = new clsIcuACAD_PostPartumseeRecord_VO(); //下一条记录//(需要改动) if (i < intRecordCount - 1) { objNext = objICUInfo.m_objRecordArr[i + 1]; } ////如果该护理记录是修改前的记录且是在指定时间内修改的,则不显示 //if(objNext != null && objNext.m_dtmCreateDate == objCurrent.m_dtmCreateDate) //{ // TimeSpan tsModify = objNext.m_dtmModifyDate-objCurrent.m_dtmModifyDate; // if((int)tsModify.TotalHours < intCanModifyTime) // continue; //} //如果该护理记录是修改前的记录且是在指定时间内修改的,修改者与创建者为同一人,则不显示 if (objNext != null && objNext.m_dtmCreateDate == objCurrent.m_dtmCreateDate && objNext.m_strModifyUserID.Trim() == objCurrent.m_strCreateUserID.Trim() && objNext.m_dtmOpenDate == objCurrent.m_dtmOpenDate) { TimeSpan tsModify = objNext.m_dtmModifyDate - objCurrent.m_dtmModifyDate; if ((int)tsModify.TotalHours < intCanModifyTime) { // blnPreIsHide = true; continue; } } #region 存放关键字段 if (objCurrent.m_dtmCreateDate != DateTime.MinValue) { objData[0] = objCurrent.m_dtmCreateDate; //存放记录时间的字符串 objData[1] = (int)enmRecordsType.PostartumSeeRecord; //存放记录类型的int值 //(需要改动) objData[2] = objCurrent.m_dtmCreateDate; //存放记录的OpenDate字符串 objData[3] = objCurrent.m_dtmModifyDate; //存放记录的ModifyDate字符串,不考虑痕迹时 //objData[3] = objICUInfo.m_objRecordArr[objICUInfo.m_objRecordArr.Length-1].m_dtmModifyDate;//存放记录的ModifyDate字符串 //同一个则只在第一行显示日期 if (objCurrent.m_dtmCreateDate.Date.ToString() != m_dtmPreRecordDate.Date.ToString()) //m_dtmRECORDDATE { objData[4] = objCurrent.m_dtmRecordDate.Date.ToString("yyyy-MM-dd");; //日期字符串 } //修改后带有痕迹的记录不再显示时间 if (m_dtmPreRecordDate != objCurrent.m_dtmCreateDate) { objData[5] = objCurrent.m_dtmRecordDate.ToString("HH:mm");//时间字符串 } } m_dtmPreRecordDate = objCurrent.m_dtmCreateDate; #endregion ; // //产次处理 // m_txtDiseaseID.Text = objCurrent.m_strLayCount_chr; // if(objCurrent.m_strBeforehand_chr.Trim() != "") // m_dtpCreateDate.Value = Convert.ToDateTime(objCurrent.m_strBeforehand_chr.ToString().Trim()); // // #region 存放单项信息 //血压 strText = objCurrent.m_strBLOODPRESSURE_CHR_RIGHT; strXml = "<root />"; if (objNext != null && objNext.m_dtmCreateDate == objCurrent.m_dtmCreateDate && objNext.m_strBLOODPRESSURE_CHR_RIGHT != objCurrent.m_strBLOODPRESSURE_CHR_RIGHT) /*objNext的记录内容与objCurrent的记录内容不一致,文本需要加双划线*/ { strXml = m_strGetDSTTextXML(objCurrent.m_strBLOODPRESSURE_CHR_RIGHT, objCurrent.m_strModifyUserID, objCurrent.m_strModifyUserName); } objclsDSTRichTextBoxValue = new clsDSTRichTextBoxValue(); objclsDSTRichTextBoxValue.m_strText = strText; objclsDSTRichTextBoxValue.m_strDSTXml = strXml; objData[6] = objclsDSTRichTextBoxValue; //血压 //体温 strText = objCurrent.m_strBODYTEMPARTURE_CHR_RIGHT; strXml = "<root />"; //if(objNext != null && objNext.m_dtmCreateDate == objCurrent.m_dtmCreateDate && objNext.m_strBODYTEMPARTURE_CHR_RIGHT != objCurrent.m_strBODYTEMPARTURE_CHR_RIGHT)/*objNext的记录内容与objCurrent的记录内容不一致,文本需要加双划线*/ //{ // strXml = m_strGetDSTTextXML(objCurrent.m_strBODYTEMPARTURE_CHR_RIGHT ,objCurrent.m_strModifyUserID,objCurrent.m_strModifyUserName); //} objclsDSTRichTextBoxValue = new clsDSTRichTextBoxValue(); objclsDSTRichTextBoxValue.m_strText = strText; objclsDSTRichTextBoxValue.m_strDSTXml = strXml; objData[7] = objclsDSTRichTextBoxValue; //体温 //脉搏 strText = objCurrent.m_strPULSE_CHR_RIGHT; strXml = "<root />"; //if(objNext != null && objNext.m_dtmCreateDate == objCurrent.m_dtmCreateDate && objNext.m_strPULSE_CHR_RIGHT != objCurrent.m_strPULSE_CHR_RIGHT)/*objNext的记录内容与objCurrent的记录内容不一致,文本需要加双划线*/ //{ // strXml = m_strGetDSTTextXML(objCurrent.m_strPULSE_CHR_RIGHT,objCurrent.m_strModifyUserID,objCurrent.m_strModifyUserName); //} objclsDSTRichTextBoxValue = new clsDSTRichTextBoxValue(); objclsDSTRichTextBoxValue.m_strText = strText; objclsDSTRichTextBoxValue.m_strDSTXml = strXml; objData[8] = objclsDSTRichTextBoxValue; //脉搏 //宫缩 strText = objCurrent.m_strUTERUS_CHR_RIGHT; strXml = "<root />"; //if(objNext != null && objNext.m_dtmCreateDate == objCurrent.m_dtmCreateDate && objNext.m_strUTERUS_CHR_RIGHT != objCurrent.m_strUTERUS_CHR_RIGHT)/*objNext的记录内容与objCurrent的记录内容不一致,文本需要加双划线*/ //{ // strXml = m_strGetDSTTextXML(objCurrent.m_strUTERUS_CHR_RIGHT,objCurrent.m_strModifyUserID,objCurrent.m_strModifyUserName); //} objclsDSTRichTextBoxValue = new clsDSTRichTextBoxValue(); objclsDSTRichTextBoxValue.m_strText = strText; objclsDSTRichTextBoxValue.m_strDSTXml = strXml; objData[9] = objclsDSTRichTextBoxValue; //宫缩 //出血 strText = objCurrent.m_strBLOODED_CHR_RIGHT; strXml = "<root />"; //if(objNext != null && objNext.m_dtmCreateDate == objCurrent.m_dtmCreateDate && objNext.m_strBLOODED_CHR_RIGHT != objCurrent.m_strBLOODED_CHR_RIGHT)/*objNext的记录内容与objCurrent的记录内容不一致,文本需要加双划线*/ //{ // strXml = m_strGetDSTTextXML(objCurrent.m_strBLOODED_CHR_RIGHT,objCurrent.m_strModifyUserID,objCurrent.m_strModifyUserName); //} objclsDSTRichTextBoxValue = new clsDSTRichTextBoxValue(); objclsDSTRichTextBoxValue.m_strText = strText; objclsDSTRichTextBoxValue.m_strDSTXml = strXml; objData[10] = objclsDSTRichTextBoxValue; //出血 //破水 strText = objCurrent.m_strBREAKWATER_CHR_RIGHT; strXml = "<root />"; //if(objNext != null && objNext.m_dtmCreateDate == objCurrent.m_dtmCreateDate && objNext.m_strBREAKWATER_CHR_RIGHT != objCurrent.m_strBREAKWATER_CHR_RIGHT)/*objNext的记录内容与objCurrent的记录内容不一致,文本需要加双划线*/ //{ // strXml = m_strGetDSTTextXML(objCurrent.m_strBREAKWATER_CHR_RIGHT,objCurrent.m_strModifyUserID,objCurrent.m_strModifyUserName); //} objclsDSTRichTextBoxValue = new clsDSTRichTextBoxValue(); objclsDSTRichTextBoxValue.m_strText = strText; objclsDSTRichTextBoxValue.m_strDSTXml = strXml; objData[11] = objclsDSTRichTextBoxValue; //破水 //胎心 strText = objCurrent.m_strEMBRYO_CHR_RIGHT; strXml = "<root />"; //if(objNext != null && objNext.m_dtmCreateDate == objCurrent.m_dtmCreateDate && objNext.m_strEMBRYO_CHR_RIGHT != objCurrent.m_strEMBRYO_CHR_RIGHT)/*objNext的记录内容与objCurrent的记录内容不一致,文本需要加双划线*/ //{ // strXml = m_strGetDSTTextXML(objCurrent.m_strEMBRYO_CHR_RIGHT,objCurrent.m_strModifyUserID,objCurrent.m_strModifyUserName); //} objclsDSTRichTextBoxValue = new clsDSTRichTextBoxValue(); objclsDSTRichTextBoxValue.m_strText = strText; objclsDSTRichTextBoxValue.m_strDSTXml = strXml; objData[12] = objclsDSTRichTextBoxValue; //胎心 //宫口大小 strText = objCurrent.m_strUTERUSSIZE_CHR_RIGHT; strXml = "<root />"; //if(objNext != null && objNext.m_dtmCreateDate == objCurrent.m_dtmCreateDate && objNext.m_strUTERUSSIZE_CHR_RIGHT != objCurrent.m_strUTERUSSIZE_CHR_RIGHT)/*objNext的记录内容与objCurrent的记录内容不一致,文本需要加双划线*/ //{ // strXml = m_strGetDSTTextXML(objCurrent.m_strUTERUSSIZE_CHR_RIGHT,objCurrent.m_strModifyUserID,objCurrent.m_strModifyUserName); //} objclsDSTRichTextBoxValue = new clsDSTRichTextBoxValue(); objclsDSTRichTextBoxValue.m_strText = strText; objclsDSTRichTextBoxValue.m_strDSTXml = strXml; objData[13] = objclsDSTRichTextBoxValue; //宫口大小 //签名 if (objCurrent.objSignerArr != null || objCurrent.objSignerArr.Length > 0) { string str = string.Empty; if (objCurrent.objSignerArr[0].objEmployee != null) { str = objCurrent.objSignerArr[0].objEmployee.m_strGetTechnicalRankAndName; } for (int w1 = 1; w1 < objCurrent.objSignerArr.Length; w1++) { if (objCurrent.objSignerArr[w1].objEmployee != null) { str += ";" + objCurrent.objSignerArr[w1].objEmployee.m_strGetTechnicalRankAndName; } } objclsDSTRichTextBoxValue = new clsDSTRichTextBoxValue(); objclsDSTRichTextBoxValue.m_strText = str; objclsDSTRichTextBoxValue.m_strDSTXml = strXml; objData[14] = objclsDSTRichTextBoxValue;//签名 } // objData[15] = objCurrent.m_strRecordUserID; // objData[16] = objCurrent.m_strCreateUserID; // objReturnData.Add(objData); #endregion } object[][] m_objRe = new object[objReturnData.Count][]; for (int m = 0; m < objReturnData.Count; m++) { m_objRe[m] = (object[])objReturnData[m]; } return(m_objRe); } catch (Exception ex) { MessageBox.Show(ex.Message); return(null); } #endregion }
// private int intPageSize =3; private void m_mthPrintAllPage(System.Drawing.Printing.PrintPageEventArgs e, ref float p_objLocationY) { string print = ""; if (m_objResultArr.Length <= 0) { return; } int intPrintCount = 0; //计算第一页还能打印出多少条记录 int intRowCount = Convert.ToInt32((float.Parse(e.MarginBounds.Height.ToString()) - p_objLocationY) / m_ftlRowHeight); intRowCount--; //因为留出一行位置来打印页脚,打印 附注 ,所以显示总行数为减1 //intRowCount--; //因为留出一行位置来打印"特殊记录" if (m_intCurrentPageIndex == 1) { for (i = 0; i < m_objResultArr.Length; i++) { clsICUACAD_POSTPARTUMSEERECORDContentDataInfo objRecord = m_objResultArr[i]; for (intSub = 0; intSub < objRecord.m_objRecordArr.Length; intSub++) { #region draw one row float fltRealHeight = 0f; print = objRecord.m_objRecordArr[intSub].m_dtmRecordDate.ToString("yy-MM-dd"); float fltHeight = m_fltDrawStrAtRectangle(false, this.m_fltFirstColLeft, this.m_fltSeconColLeft, print, p_objLocationY, e); fltRealHeight = m_fltGetMaxValue(fltRealHeight, fltHeight); print = objRecord.m_objRecordArr[intSub].m_dtmRecordDate.ToString("HH:mm"); fltHeight = m_fltDrawStrAtRectangle(false, this.m_fltSeconColLeft, this.m_fltthColLeft, print, p_objLocationY, e); fltRealHeight = m_fltGetMaxValue(fltRealHeight, fltHeight); print = objRecord.m_objRecordArr[intSub].m_strBLOODPRESSURE_CHR; fltHeight = m_fltDrawStrAtRectangle(true, this.m_fltthColLeft, this.m_fltthirColLeft, print, p_objLocationY, e); fltRealHeight = m_fltGetMaxValue(fltRealHeight, fltHeight); print = objRecord.m_objRecordArr[intSub].m_strBODYTEMPARTURE_CHR; fltHeight = m_fltDrawStrAtRectangle(true, this.m_fltthirColLeft, this.m_fltFiveColLeft, print, p_objLocationY, e); fltRealHeight = m_fltGetMaxValue(fltRealHeight, fltHeight); print = objRecord.m_objRecordArr[intSub].m_strPULSE_CHR; fltHeight = m_fltDrawStrAtRectangle(true, this.m_fltFiveColLeft, this.m_fltSixColLeft, print, p_objLocationY, e); fltRealHeight = m_fltGetMaxValue(fltRealHeight, fltHeight); print = objRecord.m_objRecordArr[intSub].m_strUTERUS_CHR; fltHeight = m_fltDrawStrAtRectangle(true, this.m_fltSixColLeft, this.m_fltSenColLeft, print, p_objLocationY, e); fltRealHeight = m_fltGetMaxValue(fltRealHeight, fltHeight); print = objRecord.m_objRecordArr[intSub].m_strBLOODED_CHR; fltHeight = m_fltDrawStrAtRectangle(true, this.m_fltSenColLeft, this.m_fltNigColLeft, print, p_objLocationY, e); fltRealHeight = m_fltGetMaxValue(fltRealHeight, fltHeight); print = objRecord.m_objRecordArr[intSub].m_strBREAKWATER_CHR; fltHeight = m_fltDrawStrAtRectangle(true, this.m_fltNigColLeft, this.m_fltNiNeColLeft, print, p_objLocationY, e); fltRealHeight = m_fltGetMaxValue(fltRealHeight, fltHeight); print = objRecord.m_objRecordArr[intSub].m_strEMBRYO_CHR; fltHeight = m_fltDrawStrAtRectangle(true, this.m_fltNiNeColLeft, this.m_fltColLeft10, print, p_objLocationY, e); fltRealHeight = m_fltGetMaxValue(fltRealHeight, fltHeight); print = objRecord.m_objRecordArr[intSub].m_strUTERUSSIZE_CHR; fltHeight = m_fltDrawStrAtRectangle(true, this.m_fltColLeft10, this.m_fltColLeft11, print, p_objLocationY, e); fltRealHeight = m_fltGetMaxValue(fltRealHeight, fltHeight); print = ""; if (objRecord.m_objRecordArr[intSub].objSignerArr != null && objRecord.m_objRecordArr[intSub].objSignerArr.Length > 0) { print = objRecord.m_objRecordArr[intSub].objSignerArr[0].objEmployee.m_strGetTechnicalRankAndName; for (int w1 = 1; w1 < objRecord.m_objRecordArr[intSub].objSignerArr.Length; w1++) { print += ";" + objRecord.m_objRecordArr[intSub].objSignerArr[w1].objEmployee.m_strGetTechnicalRankAndName; } } fltHeight = m_fltDrawStrAtRectangle(true, this.m_fltColLeft11, this.m_fltColLeft12, print, p_objLocationY, e); fltRealHeight = m_fltGetMaxValue(fltRealHeight, fltHeight); fltRealHeight = m_fltGetMaxValue(fltRealHeight, m_ftlRowHeight); m_mthPrintHLine(e.Graphics, p_objLocationY, fltRealHeight); m_mthDrawLines(e, fltRealHeight); p_objLocationY += fltRealHeight; intPrintCount++; #endregion //判断是否多页 if (intPrintCount >= intRowCount) { intPrintCount = 0; m_intCurrentPageIndex++; e.HasMorePages = true; m_mthPrintFoot(e); return; } } intSub = 0; } } else { int temp = i; #region draw one row m_mthPrintFormHeader(e, ref p_objLocationY); //画表头 for ( ; i < m_objResultArr.Length; i++) { clsICUACAD_POSTPARTUMSEERECORDContentDataInfo objRecord = m_objResultArr[i]; for (; intSub < objRecord.m_objRecordArr.Length; intSub++) { #region draw one row float fltRealHeight = 0f; print = objRecord.m_objRecordArr[intSub].m_dtmCreateDate.ToString("yy-MM-dd"); float fltHeight = m_fltDrawStrAtRectangle(false, this.m_fltFirstColLeft, this.m_fltSeconColLeft, print, p_objLocationY, e); fltRealHeight = m_fltGetMaxValue(fltRealHeight, fltHeight); print = objRecord.m_objRecordArr[intSub].m_dtmCreateDate.ToString("HH:mm"); fltHeight = m_fltDrawStrAtRectangle(false, this.m_fltSeconColLeft, this.m_fltthColLeft, print, p_objLocationY, e); fltRealHeight = m_fltGetMaxValue(fltRealHeight, fltHeight); print = objRecord.m_objRecordArr[intSub].m_strBLOODPRESSURE_CHR; fltHeight = m_fltDrawStrAtRectangle(true, this.m_fltthColLeft, this.m_fltthirColLeft, print, p_objLocationY, e); fltRealHeight = m_fltGetMaxValue(fltRealHeight, fltHeight); print = objRecord.m_objRecordArr[intSub].m_strBODYTEMPARTURE_CHR; fltHeight = m_fltDrawStrAtRectangle(true, this.m_fltthirColLeft, this.m_fltFiveColLeft, print, p_objLocationY, e); fltRealHeight = m_fltGetMaxValue(fltRealHeight, fltHeight); print = objRecord.m_objRecordArr[intSub].m_strPULSE_CHR; fltHeight = m_fltDrawStrAtRectangle(true, this.m_fltFiveColLeft, this.m_fltSixColLeft, print, p_objLocationY, e); fltRealHeight = m_fltGetMaxValue(fltRealHeight, fltHeight); print = objRecord.m_objRecordArr[intSub].m_strUTERUS_CHR; fltHeight = m_fltDrawStrAtRectangle(true, this.m_fltSixColLeft, this.m_fltSenColLeft, print, p_objLocationY, e); fltRealHeight = m_fltGetMaxValue(fltRealHeight, fltHeight); print = objRecord.m_objRecordArr[intSub].m_strBLOODED_CHR; fltHeight = m_fltDrawStrAtRectangle(true, this.m_fltSenColLeft, this.m_fltNigColLeft, print, p_objLocationY, e); fltRealHeight = m_fltGetMaxValue(fltRealHeight, fltHeight); print = objRecord.m_objRecordArr[intSub].m_strBREAKWATER_CHR; fltHeight = m_fltDrawStrAtRectangle(true, this.m_fltNigColLeft, this.m_fltNiNeColLeft, print, p_objLocationY, e); fltRealHeight = m_fltGetMaxValue(fltRealHeight, fltHeight); print = objRecord.m_objRecordArr[intSub].m_strEMBRYO_CHR; fltHeight = m_fltDrawStrAtRectangle(true, this.m_fltNiNeColLeft, this.m_fltColLeft10, print, p_objLocationY, e); fltRealHeight = m_fltGetMaxValue(fltRealHeight, fltHeight); print = objRecord.m_objRecordArr[intSub].m_strUTERUSSIZE_CHR; fltHeight = m_fltDrawStrAtRectangle(true, this.m_fltColLeft10, this.m_fltColLeft11, print, p_objLocationY, e); fltRealHeight = m_fltGetMaxValue(fltRealHeight, fltHeight); print = ""; if (objRecord.m_objRecordArr[intSub].objSignerArr != null && objRecord.m_objRecordArr[intSub].objSignerArr.Length > 0) { print = objRecord.m_objRecordArr[intSub].objSignerArr[0].objEmployee.m_strGetTechnicalRankAndName; for (int w1 = 1; w1 < objRecord.m_objRecordArr[intSub].objSignerArr.Length; w1++) { print += ";" + objRecord.m_objRecordArr[intSub].objSignerArr[w1].objEmployee.m_strGetTechnicalRankAndName; } } fltHeight = m_fltDrawStrAtRectangle(true, this.m_fltColLeft11, this.m_fltColLeft12, print, p_objLocationY, e); fltRealHeight = m_fltGetMaxValue(fltRealHeight, fltHeight); fltRealHeight = m_fltGetMaxValue(fltRealHeight, m_ftlRowHeight); #endregion m_mthPrintHLine(e.Graphics, p_objLocationY, fltRealHeight); m_mthDrawLines(e, fltRealHeight); p_objLocationY += fltRealHeight; intPrintCount++; //判断是否多页 if (intPrintCount >= intRowCount) { intPrintCount = 0; m_intCurrentPageIndex++; e.HasMorePages = true; m_mthPrintFoot(e); return; } } intSub = 0; } #endregion } m_mthPrintFoot(e); }