private void dgv_FinishedCaseHistory_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { if (dgv_FinishedCaseHistory.SelectedRows.Count > 0) { var selectedCaseHistory = dgv_FinishedCaseHistory.SelectedRows[0].DataBoundItem as CaseHistory; if (selectedCaseHistory != null) { // 病程 if (selectedCaseHistory.CaseType >= (int)Enums.CaseType.ProgressNote) { OpenActiveEditControlPage(selectedCaseHistory.Id, currentSelectedPatient.Name + "的病程", selectedCaseHistory.FileContent, Enums.TabPageType.ProgressNote); XTextSubDocumentElement record = (XTextSubDocumentElement)selectedCaseHistory.Tag; if (record != null) { record.Focus(); record.SelectFirstLine(); ActiveEditorControl.WriteControl.Focus(); ActiveEditorControl.WriteControl.ScrollToCaretExt(DCSoft.WinForms.ScrollToViewStyle.Top); } } //病历 else if (selectedCaseHistory.CaseType == (int)Enums.CaseType.Common) { OpenActiveEditControlPage(selectedCaseHistory.Id, selectedCaseHistory.FileName, selectedCaseHistory.FileContent, Enums.TabPageType.CaseHistory); } //首日病程 else if (selectedCaseHistory.CaseType == (int)Enums.CaseType.ProgressNoteWithFirstCommon) { } } } }
private XTextSubDocumentElement CreateNewSubDocument(XTextDocument document, string xml) { XTextSubDocumentElement doc = new XTextSubDocumentElement(); doc.OwnerDocument = document; doc.DocumentInfo.Author = System.Environment.UserName; doc.DocumentInfo.Title = DateTime.Now.ToString("病程记录yyyy年MM月dd日 HH时mm分ss秒"); doc.ID = doc.Title; doc.LoadDocumentFromString(xml, "xml"); //doc.SetInnerTextFast(xml); // 新文档不启用权限 doc.EnablePermission = DCBooleanValue.False; // 新文档是不只读的 doc.ContentReadonly = ContentReadonlyState.False; // 打印时背景透明 doc.Style.PrintBackColor = Color.Transparent; //// 设置新的文件名 string fileName = doc.DocumentInfo.Title + ".xml"; doc.FileName = fileName; return(doc); }