private void PrintInfo(string ReportName, string strTRANSACTION_ID, string Money) { try { CardAuthorizationData eCardAuthorizationData = new CardAuthorizationData(); CardAuthorizationFacade eCardAuthorizationFacade = new CardAuthorizationFacade(); eCardAuthorizationData = (CardAuthorizationData)eCardAuthorizationFacade.SelectPatientAndCardInfoByCardID(SkyComm.cardInfoStruct.CardNo); string identity = eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_IDENTITYCARD].ToString(); CardSavingFacade cardSavingFacade = new CardSavingFacade(); DataSet cardSavingData = cardSavingFacade.FindByPrimaryKey(strTRANSACTION_ID); cardSavingData.Tables[0].Columns.Add("身份证", typeof(string)); if (cardSavingData.Tables[0].Rows.Count > 0) { cardSavingData.Tables[0].Rows[0]["身份证"] = identity; cardSavingData.WriteXml(Application.StartupPath + @"\\ReportXml\\" + ReportName + SkyComm.DiagnoseID + "_" + strTRANSACTION_ID + ".xml"); if (!File.Exists(Application.StartupPath + @"\\Reports\\" + ReportName + ".frx")) { SkynetMessage.MsgInfo(ReportName + ".frx报表文件不存在,无法打印."); return; } PrintManager print = new PrintManager(); print.InitReport(ReportName); print.AddParam("医院名称", SysOperatorInfo.CustomerName); print.AddParam("收据号", strTRANSACTION_ID); print.AddParam("姓名", SkyComm.eCardAuthorizationData.Tables[0].Rows[0]["PATIENTNAME"].ToString()); print.AddParam("卡余额", SkyComm.cardBlance); print.AddParam("充值金额", Money); print.AddParam("操作员", SysOperatorInfo.OperatorCode); print.AddParam("操作员姓名", SysOperatorInfo.OperatorName); print.AddData(cardSavingData.Tables[0], "report"); PrintManager.CanDesign = true; print.Print(); print.Dispose(); Thread.Sleep(100); } } catch (Exception lex) { // if (lex.Message.IndexOf("灾难性") > 0) // { // SkynetMessage.MsgInfo(lex.Message + ": 打印机连接失败,请检查!"); // } // else // { // SkynetMessage.MsgInfo(lex.Message); // } } }
private void PrintInfo(string ReportName, string strTRANSACTION_ID, string Money) { try { CardSavingFacade cardSavingFacade = new CardSavingFacade(); DataSet cardSavingData = cardSavingFacade.FindByPrimaryKey(strTRANSACTION_ID); if (cardSavingData.Tables[0].Rows.Count > 0) { cardSavingData.WriteXml(Application.StartupPath + @"\\ReportXml\\" + ReportName + SkyComm.DiagnoseID + "_" + strTRANSACTION_ID + ".xml"); if (!File.Exists(Application.StartupPath + @"\\Reports\\" + ReportName + ".frx")) { SkynetMessage.MsgInfo(ReportName + ".frx报表文件不存在,无法打印."); return; } //Common_XH theCamera_XH = new Common_XH(); //theCamera_XH.DoorLightOpen(LightTypeenum.凭条, LightOpenTypeenum.闪烁); PrintManager print = new PrintManager(); print.InitReport(ReportName); print.AddParam("医院名称", SysOperatorInfo.CustomerName); print.AddParam("收据号", strTRANSACTION_ID); print.AddParam("姓名", SkyComm.eCardAuthorizationData.Tables[0].Rows[0]["PATIENTNAME"].ToString()); print.AddParam("卡余额", SkyComm.cardBlance); print.AddParam("充值金额", Money); print.AddParam("操作员", SysOperatorInfo.OperatorCode); print.AddParam("操作员姓名", SysOperatorInfo.OperatorName); print.AddData(cardSavingData.Tables[0], "report"); PrintManager.CanDesign = true; print.Print(); print.Dispose(); Thread.Sleep(100); } } catch (Exception lex) { if (lex.Message.IndexOf("灾难性") > 0) { SkynetMessage.MsgInfo(lex.Message + ": 打印机连接失败,请检查!"); } else { SkynetMessage.MsgInfo(lex.Message); } } }