575 lines
26 KiB
C#
575 lines
26 KiB
C#
using AIMS.PublicUI.UI;
|
|
using AIMSModel;
|
|
using CCIS.Shared;
|
|
using DCSoft.Writer;
|
|
using DCSoft.Writer.Data;
|
|
using DCSoft.Writer.Dom;
|
|
using DocumentManagement;
|
|
using DrawGraph;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
using Microsoft.Extensions.Logging;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Data;
|
|
using System.Linq;
|
|
using System.Reflection;
|
|
using System.Windows.Forms;
|
|
using System.Xml;
|
|
using System.Xml.Linq;
|
|
|
|
namespace AIMS.OremrUserControl
|
|
{
|
|
public partial class ucDocument : UserControl
|
|
{
|
|
ILogger<ucDocument> logger = SharedContext.StaticInstance.ServiceProvider.GetService<ILoggerFactory>().CreateLogger<ucDocument>();
|
|
//模板Model
|
|
private PrintTemplate TModel = new PrintTemplate();
|
|
//文档Model
|
|
public PrintDocument DModel = new PrintDocument();
|
|
//患者Id
|
|
public PatientRecord Patient = new PatientRecord();
|
|
//刷新文档目录
|
|
public delegate void RefreshUcClassify(int patientId);
|
|
public RefreshUcClassify RefreshUc;
|
|
//文档标题
|
|
public delegate void ModifyTitle();
|
|
public ModifyTitle ModifyT;
|
|
public delegate void ClearTitle();
|
|
public ClearTitle ClearT;
|
|
//关闭
|
|
public delegate void CloseParent();
|
|
public CloseParent CloseP;
|
|
//容器tab
|
|
//public TabItem Tb;
|
|
//文档事件
|
|
private EventCodeCompiler codeCompiler;
|
|
private string strClick, strContentChanged;
|
|
|
|
public ucDocument(int tempId, int docId, PatientRecord patient)
|
|
{
|
|
|
|
InitializeComponent();
|
|
|
|
Patient = patient;
|
|
TModel.Id = tempId;
|
|
DModel.Id = docId;
|
|
DModel.TemplateId = tempId;
|
|
}
|
|
|
|
public ucDocument(PrintDocument model, PatientRecord patient)
|
|
{
|
|
InitializeComponent();
|
|
|
|
Patient = patient;
|
|
DModel = model;
|
|
}
|
|
|
|
private void ucDocument_Load(object sender, EventArgs e)
|
|
{
|
|
//myEditControl初始化
|
|
myEditControl.MoveFocusHotKey = MoveFocusHotKeys.Tab;
|
|
myEditControl.HeaderFooterReadonly = true;
|
|
myEditControl.CommandControler = this.writerCommandControler1;
|
|
writerCommandControler1.Start();
|
|
//表单视图模式
|
|
myEditControl.FormView = DCSoft.Writer.Controls.FormViewMode.Strict;
|
|
//加载知识库
|
|
//DocumentDAL.LoadKBLibaray();
|
|
myEditControl.ExecuteCommand("LoadKBLibrary", false, DocumentDAL.Lib);
|
|
// 注册自定义的输入域下拉列表提供者
|
|
myEditControl.AppHost.Services.AddService(
|
|
typeof(IListItemsProvider),
|
|
new MyListItemsProvider());
|
|
//// 设置文档处于调试模式
|
|
//myEditControl.DocumentOptions.BehaviorOptions.DebugMode = true;
|
|
//myEditControl.DocumentOptions.BehaviorOptions.InsertCommentBindingUserTrack = true;
|
|
//启用逻辑删除、权限控制
|
|
myEditControl.Document.Options.SecurityOptions.EnablePermission = true;
|
|
myEditControl.Document.Options.SecurityOptions.EnableLogicDelete = true;
|
|
myEditControl.Document.Options.SecurityOptions.ShowLogicDeletedContent = true;
|
|
myEditControl.Document.Options.SecurityOptions.ShowPermissionMark = true;
|
|
myEditControl.Document.Options.SecurityOptions.ShowPermissionTip = true;
|
|
//文档事件
|
|
myEditControl.DocumentContentChanged += new WriterEventHandler(myEditControl_DocumentContentChanged);
|
|
myEditControl.AfterExecuteCommand += new DCSoft.Writer.Commands.WriterCommandEventHandler(myEditControl_AfterExecuteCommand);
|
|
|
|
|
|
if (DModel.Id > 0)
|
|
{
|
|
//加载文档
|
|
DModel = DocumentDAL.GetDocumentbyId(DModel.Id);
|
|
myEditControl.LoadDocumentFromString(DModel.XmlFile, "xml");
|
|
|
|
//患者基本信息二次赋值
|
|
var query = from XTextElement in myEditControl.Document.Fields.ToArray()
|
|
where XTextElement is XTextInputFieldElement
|
|
&& (XTextElement as XTextInputFieldElement).FieldSettings != null
|
|
&& (XTextElement as XTextInputFieldElement).FieldSettings.EditStyle != InputFieldEditStyle.Date
|
|
&& (XTextElement as XTextInputFieldElement).FieldSettings.ListSource != null
|
|
select XTextElement as XTextInputFieldElement;
|
|
DataRow[] dr = DocumentDAL.GetReflectionList("V_OperationRecordALL").Select("KB_SEQ <> '' and Reload=1");
|
|
var p = typeof(PatientRecord).GetProperties();
|
|
for (int i = 0; i < dr.Count(); i++)
|
|
{
|
|
var name = dr[i].ItemArray[0].ToString();
|
|
var value = dr[i].ItemArray[1].ToString();
|
|
List<XTextInputFieldElement> elements = query.Where(x => x.FieldSettings.ListSource.SourceName == value).ToList();
|
|
PropertyInfo info = p.Where(px => px.Name == name).FirstOrDefault();
|
|
if (elements != null && info != null)
|
|
{
|
|
foreach (var element in elements)
|
|
{
|
|
element.Text = info.GetValue(Patient, null).ToString();
|
|
}
|
|
}
|
|
}
|
|
DocumentExtension.SetSpecialDocumentValue(TModel.XmlFileName, myEditControl.Document, Patient);
|
|
}
|
|
else
|
|
{
|
|
//无文档则加载模板
|
|
TModel = DocumentDAL.GetTemplatebyId(DModel.TemplateId);
|
|
if (TModel.XmlFile == null || TModel.XmlFile.Trim().Equals(string.Empty))
|
|
{
|
|
myEditControl.ExecuteCommand("FileNew", true, null);
|
|
}
|
|
else
|
|
{
|
|
myEditControl.LoadDocumentFromString(TModel.XmlFile, "xml");
|
|
}
|
|
DModel.XmlFileName = TModel.XmlFileName;
|
|
DModel.TemplateId = TModel.Id;
|
|
//患者基本信息赋值
|
|
var query = from XTextElement in myEditControl.Document.Fields.ToArray()
|
|
where XTextElement is XTextInputFieldElement
|
|
&& (XTextElement as XTextInputFieldElement).FieldSettings != null
|
|
&& (XTextElement as XTextInputFieldElement).FieldSettings.EditStyle != InputFieldEditStyle.Date
|
|
&& (XTextElement as XTextInputFieldElement).FieldSettings.ListSource != null
|
|
select XTextElement as XTextInputFieldElement;
|
|
DataRow[] dr = DocumentDAL.GetReflectionList("V_OperationRecordALL").Select("KB_SEQ <> ''");
|
|
var p = typeof(PatientRecord).GetProperties();
|
|
for (int i = 0; i < dr.Count(); i++)
|
|
{
|
|
var name = dr[i].ItemArray[0].ToString();
|
|
var value = dr[i].ItemArray[1].ToString();
|
|
List<XTextInputFieldElement> elements = query.Where(x => x.FieldSettings.ListSource.SourceName == value).ToList();
|
|
PropertyInfo info = p.Where(px => px.Name == name).FirstOrDefault();
|
|
if (elements != null && info != null)
|
|
{
|
|
foreach (var element in elements)
|
|
{
|
|
element.Text = info.GetValue(Patient, null).ToString();
|
|
}
|
|
}
|
|
}
|
|
|
|
if (Patient.LisResult != null && Patient.LisResult.PATIENT_ID != null)
|
|
{
|
|
DataRow[] drr = DocumentDAL.GetReflectionList("V_LisResult").Select("KB_SEQ <> ''");
|
|
var lis = typeof(PatientLisResult).GetProperties();
|
|
for (int i = 0; i < drr.Count(); i++)
|
|
{
|
|
var name = drr[i].ItemArray[0].ToString();
|
|
var value = drr[i].ItemArray[1].ToString();
|
|
XTextInputFieldElement element = query.Where(x => x.FieldSettings.ListSource.SourceName == value).FirstOrDefault();
|
|
PropertyInfo info = lis.Where(px => px.Name == name).FirstOrDefault();
|
|
if (element != null && info != null)
|
|
{
|
|
element.Text = info.GetValue(Patient.LisResult, null).ToString();
|
|
}
|
|
}
|
|
}
|
|
DocumentExtension.SetDocumentDefaultValue(TModel.XmlFileName, myEditControl.Document, Patient);
|
|
DocumentExtension.SetSpecialDocumentValue(TModel.XmlFileName, myEditControl.Document, Patient);
|
|
|
|
}
|
|
string xmlStatic = DocumentDAL.GetEventXml(DModel.TemplateId);
|
|
if (xmlStatic != string.Empty)
|
|
{
|
|
XmlDocument doc = new XmlDocument();
|
|
doc.LoadXml(xmlStatic);
|
|
strClick = doc.GetElementsByTagName("ClickEvent")[0].InnerText;
|
|
strContentChanged = doc.GetElementsByTagName("ContentChangedEnvent")[0].InnerText;
|
|
}
|
|
string XmlFileName = TModel.XmlFileName;
|
|
codeCompiler = new EventCodeCompiler(ref this.myEditControl, strClick, strContentChanged);
|
|
|
|
//文档用户信息
|
|
myEditControl.UserLoginByParameter(
|
|
AIMSExtension.PublicMethod.OperatorNo,
|
|
AIMSExtension.PublicMethod.OperatorName,
|
|
AIMSExtension.PublicMethod.PermissionLevel);
|
|
//隐藏痕迹先
|
|
myEditControl.ExecuteCommand(StandardCommandNames.CleanViewMode, false, true);
|
|
codeCompiler.IsLoad = true;
|
|
|
|
if (Patient.MedicalRecord != null && Patient.MedicalRecord != "")
|
|
{
|
|
tsbSave.Visible = false;
|
|
tsbSaveAndPrint.Text = "打印";
|
|
}
|
|
|
|
if (DModel != null) XmlFileName = DModel.XmlFileName;
|
|
if (XmlFileName == "压疮风险评估表" || XmlFileName == "不计费耗材使用清单")
|
|
{
|
|
toolStripButton1.Visible = true;
|
|
}
|
|
else if (XmlFileName == "自费项目治疗同意书" || XmlFileName == "自费项目治疗同意书2" || XmlFileName == "特需医疗服务项目医患协议书")
|
|
{
|
|
toolStripButton1.Text = "选择药品";
|
|
toolStripButton1.Visible = true;
|
|
}
|
|
else if (XmlFileName == "医保患者自费项目知情同意书")
|
|
{
|
|
toolStripButton1.Text = "选择自费项目";
|
|
toolStripButton1.Visible = true;
|
|
}
|
|
else if (XmlFileName == "麻醉术前访视评估单")
|
|
{
|
|
toolStripButton1.Text = "提取检验数据";
|
|
toolStripButton1.Visible = true;
|
|
}
|
|
}
|
|
|
|
void myEditControl_AfterExecuteCommand(object eventSender, DCSoft.Writer.Commands.WriterCommandEventArgs args)
|
|
{
|
|
if (args.Name == "Undo" && !myEditControl.Document.Modified && ClearT != null)
|
|
{
|
|
ClearT();
|
|
}
|
|
}
|
|
|
|
void myEditControl_DocumentContentChanged(object eventSender, WriterEventArgs args)
|
|
{
|
|
if (myEditControl.Document.Modified && ModifyT != null)
|
|
{
|
|
ModifyT();
|
|
}
|
|
}
|
|
|
|
private void tsbSave_Click(object sender, EventArgs e)
|
|
{
|
|
try
|
|
{
|
|
SaveDocument();
|
|
}
|
|
catch (Exception exp)
|
|
{
|
|
logger.LogError(exp,"保存文档出错");
|
|
MessageBox.Show(exp.Message, "提示");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 关闭文档
|
|
/// </summary>
|
|
/// <param name="text">文档标题</param>
|
|
/// <param name="isCancel">是否取消关闭</param>
|
|
public void CloseMsg(string text, ref bool isCancel)
|
|
{
|
|
if (text.EndsWith("*"))
|
|
{
|
|
DialogResult result = MessageBox.Show("文档【"
|
|
+ DModel.XmlFileName +
|
|
"】已经修改,尚未保存,是否保存文件?", "系统提示", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question,
|
|
MessageBoxDefaultButton.Button1);
|
|
switch (result)
|
|
{
|
|
case DialogResult.Yes:
|
|
try
|
|
{
|
|
SaveDocument();
|
|
}
|
|
catch (Exception exp)
|
|
{
|
|
MessageBox.Show(exp.Message, "提示");
|
|
isCancel = true;
|
|
}
|
|
break;
|
|
case DialogResult.No:
|
|
break;
|
|
case DialogResult.Cancel:
|
|
isCancel = true;
|
|
return;
|
|
//break;
|
|
default:
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 保存文档
|
|
/// </summary>
|
|
public void SaveDocument()
|
|
{
|
|
try
|
|
{
|
|
//输入域校验
|
|
ValueValidateResultList listR = myEditControl.Document.ValueValidate();
|
|
string vMsg = "";
|
|
foreach (var item in listR)
|
|
{
|
|
vMsg += item.Message + System.Environment.NewLine;
|
|
}
|
|
if (vMsg.Length > 0)
|
|
{
|
|
throw new Exception(vMsg);
|
|
}
|
|
//model赋值
|
|
DModel.XmlFile = myEditControl.Document.XMLText;
|
|
DModel.PatientId = this.Patient.PatientId;
|
|
DModel.OperatorNo = AIMSExtension.PublicMethod.OperatorNo;
|
|
XmlDocument doc = new XmlDocument();
|
|
XmlElement rootNode = doc.CreateElement("Root");
|
|
doc.AppendChild(rootNode);
|
|
var query = from XTextElement in myEditControl.Document.Fields.ToArray()
|
|
where (XTextElement is XTextInputFieldElement && (XTextElement as XTextInputFieldElement).ToolTip != "")
|
|
|| XTextElement is XTextCheckBoxElement && ((XTextElement as XTextCheckBoxElement).ToolTip != "")
|
|
select XTextElement;
|
|
foreach (var element in query)
|
|
{
|
|
XmlElement itemNode = doc.CreateElement("Item");
|
|
|
|
if (element is XTextInputFieldElement)
|
|
{
|
|
itemNode.SetAttribute("Name", (element as XTextInputFieldElement).ToolTip);
|
|
itemNode.InnerText = element.Text;
|
|
rootNode.AppendChild(itemNode);
|
|
}
|
|
else if (element is XTextCheckBoxElement)
|
|
{
|
|
itemNode.SetAttribute("Name", (element as XTextCheckBoxElement).ToolTip);
|
|
itemNode.SetAttribute("Checked", ((XTextCheckBoxElement)element).Checked == true ? "1" : "0");
|
|
itemNode.InnerText = (element as XTextCheckBoxElement).Value;
|
|
rootNode.AppendChild(itemNode);
|
|
}
|
|
}
|
|
DModel.XmlStatic = doc.OuterXml;
|
|
if (DModel.Id > 0)
|
|
{
|
|
DocumentDAL.UpdatePrintDocument(this.DModel);
|
|
//MessageBox.Show("修改成功!");
|
|
}
|
|
else
|
|
{
|
|
DocumentDAL.InsertPrintDocument(this.DModel);
|
|
//new frmMessageBox().Show();
|
|
}
|
|
if (RefreshUc != null)
|
|
{
|
|
RefreshUc(this.Patient.PatientId);
|
|
}
|
|
if (ClearT != null)
|
|
{
|
|
ClearT();
|
|
}
|
|
myEditControl.Document.Modified = false;
|
|
DocumentExtension.SaveCocumentValue(DModel.XmlFileName, myEditControl.Document, ref Patient);
|
|
|
|
new frmMessageBox().Show();
|
|
}
|
|
catch
|
|
{
|
|
//MessageBox.Show(ex.Message, "错误");
|
|
throw;
|
|
}
|
|
}
|
|
|
|
public void tsbSaveAndPrint_Click(object sender, EventArgs e)
|
|
{
|
|
if (tsbCheckout.Text == " 隐藏痕迹")
|
|
{
|
|
tsbCheckout_Click(null, null);
|
|
}
|
|
if (tsbSaveAndPrint.Text == "打印")
|
|
{
|
|
myEditControl.ExecuteCommand("FilePrint", true, null);
|
|
|
|
ControlExtension.UPDocument(Patient.PatientId, Patient.ApplyId, DModel.Id, 3, DModel.TemplateId.ToString(), DModel.XmlFileName);
|
|
}
|
|
else
|
|
{
|
|
tsbSave_Click(null, null);
|
|
myEditControl.ExecuteCommand("FilePrint", true, null);
|
|
|
|
ControlExtension.UPDocument(Patient.PatientId, Patient.ApplyId, DModel.Id, 3, DModel.TemplateId.ToString(), DModel.XmlFileName);
|
|
}
|
|
}
|
|
|
|
private void tsbPreview_Click(object sender, EventArgs e)
|
|
{
|
|
if (tsbCheckout.Text == " 隐藏痕迹")
|
|
{
|
|
tsbCheckout_Click(null, null);
|
|
}
|
|
myEditControl.ExecuteCommand("FilePrintPreview", true, null);
|
|
}
|
|
|
|
private void tsbExit_Click(object sender, EventArgs e)
|
|
{
|
|
CloseP();
|
|
}
|
|
|
|
private void toolStripButton1_Click(object sender, EventArgs e)
|
|
{
|
|
string XmlFileName = TModel.XmlFileName;
|
|
if (DModel != null) XmlFileName = DModel.XmlFileName;
|
|
DocumentExtension.GetDocumentValue(DModel.XmlFileName, myEditControl.Document, Patient);
|
|
|
|
if (DModel.XmlFileName == "自费项目治疗同意书")
|
|
{
|
|
frmDrugSel drugSel = new frmDrugSel();
|
|
drugSel.IsLoad = true;
|
|
drugSel.loadString = "自费用药,自费耗材";
|
|
drugSel.ShowDialog();
|
|
int num = 1;
|
|
int a = 71;
|
|
int j = 42;
|
|
for (int i = 13; i < 42; i++)
|
|
{
|
|
if (num > drugSel.FactDrugList.Count)
|
|
return;
|
|
var item = drugSel.FactDrugList[num - 1];
|
|
var field12 = myEditControl.Document.Fields.ToArray().Where(x => x is XTextInputFieldElement
|
|
&& (x as XTextInputFieldElement).ID == "field" + i).FirstOrDefault();
|
|
if (field12 != null) field12.Text = num + "." + item.DrugName + " " + item.Dosage + "元"; ;
|
|
var field13 = myEditControl.Document.Fields.ToArray().Where(x => x is XTextInputFieldElement
|
|
&& (x as XTextInputFieldElement).ID == "field" + j).FirstOrDefault();
|
|
if (field13 != null) field13.Text = " " + item.DrugKind + item.DosageUnit;
|
|
var field14 = myEditControl.Document.Fields.ToArray().Where(x => x is XTextInputFieldElement
|
|
&& (x as XTextInputFieldElement).ID == "field" + a).FirstOrDefault();
|
|
if (field14 != null) field14.Text = " " + item.DensityUnit;
|
|
j++;
|
|
a++;
|
|
num++;
|
|
}
|
|
}
|
|
else if (DModel.XmlFileName == "医保患者自费项目知情同意书")
|
|
{
|
|
frmDrugSel drugSel = new frmDrugSel();
|
|
drugSel.IsLoad = true;
|
|
drugSel.loadString = "自费用药,自费耗材";
|
|
drugSel.ShowDialog();
|
|
int num = 1;
|
|
int a = 71;
|
|
int j = 42;
|
|
for (int i = 13; i < 42; i++)
|
|
{
|
|
if (num > drugSel.FactDrugList.Count)
|
|
return;
|
|
var item = drugSel.FactDrugList[num - 1];
|
|
var field12 = myEditControl.Document.Fields.ToArray().Where(x => x is XTextInputFieldElement
|
|
&& (x as XTextInputFieldElement).ID == "field" + i).FirstOrDefault();
|
|
if (field12 != null) field12.Text = num + "." + item.DrugName + " " + item.Dosage + "元"; ;
|
|
var field13 = myEditControl.Document.Fields.ToArray().Where(x => x is XTextInputFieldElement
|
|
&& (x as XTextInputFieldElement).ID == "field" + j).FirstOrDefault();
|
|
if (field13 != null) field13.Text = " " + item.DrugKind + item.DosageUnit;
|
|
var field14 = myEditControl.Document.Fields.ToArray().Where(x => x is XTextInputFieldElement
|
|
&& (x as XTextInputFieldElement).ID == "field" + a).FirstOrDefault();
|
|
if (field14 != null) field14.Text = " " + item.DensityUnit;
|
|
j++;
|
|
a++;
|
|
num++;
|
|
}
|
|
}
|
|
else if (DModel.XmlFileName == "特需医疗服务项目医患协议书")
|
|
{
|
|
string Result = "";
|
|
string Result2 = "";
|
|
frmDrugSel drugSel = new frmDrugSel();
|
|
drugSel.IsLoad = true;
|
|
drugSel.loadString = "特需用药,特需耗材";
|
|
drugSel.ShowDialog();
|
|
int i = 1;
|
|
foreach (var item in drugSel.FactDrugList)
|
|
{
|
|
if (i < 7)
|
|
{
|
|
Result += i + "." + item.DrugName + " " + item.Dosage + "元 " + item.DrugKind + item.DosageUnit + " " + item.DensityUnit + " \r\n";
|
|
i++;
|
|
}
|
|
else
|
|
{
|
|
Result2 += i + "." + item.DrugName + " " + item.Dosage + "元 " + item.DrugKind + item.DosageUnit + " " + item.DensityUnit + "\r\n";
|
|
i++;
|
|
}
|
|
}
|
|
var field12 = myEditControl.Document.Fields.ToArray().Where(x => x is XTextInputFieldElement
|
|
&& (x as XTextInputFieldElement).ID == "field8").FirstOrDefault();
|
|
if (Result != "") field12.Text = Result.ToString();
|
|
var field13 = myEditControl.Document.Fields.ToArray().Where(x => x is XTextInputFieldElement
|
|
&& (x as XTextInputFieldElement).ID == "field11").FirstOrDefault();
|
|
if (Result2 != "") field13.Text = Result2.ToString();
|
|
|
|
}
|
|
else if (DModel.XmlFileName == "自费项目治疗同意书2")
|
|
{
|
|
string Result = "";
|
|
string Result2 = "";
|
|
frmDrugSel drugSel = new frmDrugSel();
|
|
drugSel.IsLoad = false;
|
|
drugSel.ShowDialog();
|
|
int i = 1;
|
|
foreach (var item in drugSel.FactDrugList)
|
|
{
|
|
Result += i + "." + item.DrugName + " " + item.Dosage + "元 " + item.DrugKind + item.DosageUnit + " \r\n";
|
|
Result2 += i + "." + item.DensityUnit + " ";
|
|
i++;
|
|
}
|
|
var field12 = myEditControl.Document.Fields.ToArray().Where(x => x is XTextInputFieldElement
|
|
&& (x as XTextInputFieldElement).ID == "field15").FirstOrDefault();
|
|
if (Result != "") field12.Text = Result.ToString();
|
|
var field13 = myEditControl.Document.Fields.ToArray().Where(x => x is XTextInputFieldElement
|
|
&& (x as XTextInputFieldElement).ID == "field16").FirstOrDefault();
|
|
if (Result2 != "") field13.Text = Result2.ToString();
|
|
|
|
}
|
|
else if (DModel.XmlFileName == "麻醉术前访视评估单")
|
|
{
|
|
if (Patient.LisResult != null && Patient.LisResult.PATIENT_ID != null)
|
|
{
|
|
//患者基本信息赋值
|
|
var query = from XTextElement in myEditControl.Document.Fields.ToArray()
|
|
where XTextElement is XTextInputFieldElement
|
|
&& (XTextElement as XTextInputFieldElement).FieldSettings != null
|
|
&& (XTextElement as XTextInputFieldElement).FieldSettings.EditStyle != InputFieldEditStyle.Date
|
|
&& (XTextElement as XTextInputFieldElement).FieldSettings.ListSource != null
|
|
select XTextElement as XTextInputFieldElement;
|
|
DataRow[] drr = DocumentDAL.GetReflectionList("V_LisResult").Select("KB_SEQ <> ''");
|
|
var lis = typeof(PatientLisResult).GetProperties();
|
|
for (int i = 0; i < drr.Count(); i++)
|
|
{
|
|
var name = drr[i].ItemArray[0].ToString();
|
|
var value = drr[i].ItemArray[1].ToString();
|
|
XTextInputFieldElement element = query.Where(x => x.FieldSettings.ListSource.SourceName == value).FirstOrDefault();
|
|
PropertyInfo info = lis.Where(px => px.Name == name).FirstOrDefault();
|
|
if (element != null && info != null)
|
|
{
|
|
element.Text = info.GetValue(Patient.LisResult, null).ToString();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
private void tsbCheckout_Click(object sender, EventArgs e)
|
|
{
|
|
if (tsbCheckout.Text == " 查看痕迹")
|
|
{
|
|
myEditControl.ExecuteCommand(StandardCommandNames.ComplexViewMode, false, true);
|
|
myEditControl.RefreshDocument();
|
|
tsbCheckout.Text = " 隐藏痕迹";
|
|
}
|
|
else
|
|
{
|
|
myEditControl.ExecuteCommand(StandardCommandNames.CleanViewMode, false, true);
|
|
myEditControl.RefreshDocument();
|
|
tsbCheckout.Text = " 查看痕迹";
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|