using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using AIMS.OremrUserControl; using DocumentManagement; namespace AIMS.DocManager { public partial class frmDocumentSingle : Form { //患者信息 private PatientRecord patient = new PatientRecord(); //文档 private PrintDocument model; public int ApplyId; public int PatientId; public string TempName; private ucDocument doc; public frmDocumentSingle() { InitializeComponent(); } private void frmDocumentSingle_Load(object sender, EventArgs e) { this.Text = TempName; model = DocumentDAL.GetDocumentbyName(TempName, PatientId); if (model.XmlFile == null) { MessageBox.Show("无效的文档名!"); this.Close(); } #region 患者信息赋值 this.patient = PatientRecord.GetPatientRecord(PatientId); StringBuilder sb = new StringBuilder(); string t = " "; sb.Append("患者:" + patient.PatientName + t); sb.Append("住院号:" + patient.MdrecNo + t); sb.Append("性别:" + patient.Sex + t); sb.Append("手术名称:" + patient.OperationInfoName + t); sb.Append("状态:" + patient.State + t); this.lblPatient.Text = sb.ToString(); #endregion this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.frmDocumentSingle_FormClosing); doc = new ucDocument(model, patient); doc.ModifyT += new ucDocument.ModifyTitle(ModifyTitle); doc.ClearT += new ucDocument.ClearTitle(this.ClearTitle); doc.CloseP += new ucDocument.CloseParent(Close); doc.Parent = panel3; doc.Dock = DockStyle.Fill; doc.Show(); } private void frmDocumentSingle_FormClosing(object sender, FormClosingEventArgs e) { bool result = false; doc.CloseMsg(this.Text, ref result); e.Cancel = result; } private void CloseThis() { Close(); } private void ModifyTitle() { if (!this.Text.EndsWith("*")) { this.Text += "*"; } } private void ClearTitle() { this.Text = this.Text.Replace("*", ""); } } }