文书打包反射
This commit is contained in:
parent
692b93a583
commit
d0012438a0
@ -43,11 +43,11 @@
|
||||
</Reference>
|
||||
<Reference Include="DevComponents.DotNetBar.SuperGrid, Version=12.5.0.2, Culture=neutral, PublicKeyToken=c39c3242a43eee2b, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>Extensions\DevComponents.DotNetBar.SuperGrid.dll</HintPath>
|
||||
<HintPath>..\AIMS\Extensions\DevComponents.DotNetBar.SuperGrid.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DevComponents.DotNetBar2, Version=12.5.0.2, Culture=neutral, PublicKeyToken=c39c3242a43eee2b, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\..\..\Program Files (x86)\DotNetBar for Windows Forms\DevComponents.DotNetBar2.dll</HintPath>
|
||||
<HintPath>..\AIMS\Extensions\DevComponents.DotNetBar2.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Office.Interop.Excel, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
@ -254,12 +254,30 @@
|
||||
<Compile Include="DocManager\frmDocumentSingle.Designer.cs">
|
||||
<DependentUpon>frmDocumentSingle.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="DocManager\frmKB.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="DocManager\frmKB.Designer.cs">
|
||||
<DependentUpon>frmKB.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="DocManager\frmTemplateD.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="DocManager\frmTemplateD.designer.cs">
|
||||
<DependentUpon>frmTemplateD.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="DocManager\frmUserTempPurview.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="DocManager\frmUserTempPurview.Designer.cs">
|
||||
<DependentUpon>frmUserTempPurview.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="DocManager\frmUserTempPurviewDetail.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="DocManager\frmUserTempPurviewDetail.Designer.cs">
|
||||
<DependentUpon>frmUserTempPurviewDetail.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="DrugManagement\frmDosageKind.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
@ -951,10 +969,19 @@
|
||||
<EmbeddedResource Include="DocManager\frmDocumentSingle.resx">
|
||||
<DependentUpon>frmDocumentSingle.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="DocManager\frmKB.resx">
|
||||
<DependentUpon>frmKB.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="DocManager\frmTemplateD.resx">
|
||||
<DependentUpon>frmTemplateD.cs</DependentUpon>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="DocManager\frmUserTempPurview.resx">
|
||||
<DependentUpon>frmUserTempPurview.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="DocManager\frmUserTempPurviewDetail.resx">
|
||||
<DependentUpon>frmUserTempPurviewDetail.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="DrugManagement\frmDosageKind.resx">
|
||||
<DependentUpon>frmDosageKind.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
|
||||
@ -367,19 +367,9 @@ namespace AIMS
|
||||
}
|
||||
public Form GetForm(string Path)
|
||||
{
|
||||
object result = null;
|
||||
if (Path.Contains("AIMS") || Path.Contains("DataDictionary") || Path.Contains("DrugManagement"))
|
||||
{
|
||||
object result = null;
|
||||
Type type = Type.GetType(Path);
|
||||
result = (Form)Activator.CreateInstance(type);
|
||||
}
|
||||
else
|
||||
{
|
||||
Type typeofControl = null;
|
||||
Assembly tempAssembly = Assembly.LoadFrom("" + Path.Split('.')[0].ToString() + ".DLL");
|
||||
typeofControl = tempAssembly.GetType(Path);
|
||||
result = (Form)Activator.CreateInstance(typeofControl);
|
||||
}
|
||||
result = (Form)Activator.CreateInstance(type);
|
||||
return (Form)result;
|
||||
}
|
||||
|
||||
|
||||
@ -116,7 +116,9 @@ namespace AIMS.OperationAfter.UI
|
||||
}
|
||||
private void timerLoadRescue_Tick(object sender, EventArgs e)
|
||||
{
|
||||
timerLoadRescue.Enabled=false;
|
||||
btnFind_Click(null, null);
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// 绑定基础表项目数据 到 ComboBox
|
||||
|
||||
@ -66,20 +66,10 @@ namespace AIMS
|
||||
}
|
||||
}
|
||||
public Form GetForm(string Path)
|
||||
{
|
||||
object result = null;
|
||||
if (Path.Contains("AIMS") ||Path.Contains("DataDictionary") ||Path.Contains("DrugManagement"))
|
||||
{
|
||||
{
|
||||
object result = null;
|
||||
Type type = Type.GetType(Path);
|
||||
result = (Form)Activator.CreateInstance(type);
|
||||
}
|
||||
else
|
||||
{
|
||||
Type typeofControl = null;
|
||||
Assembly tempAssembly = Assembly.LoadFrom("" + Path.Split('.')[0].ToString() + ".DLL");
|
||||
typeofControl = tempAssembly.GetType(Path);
|
||||
result = (Form)Activator.CreateInstance(typeofControl);
|
||||
}
|
||||
result = (Form)Activator.CreateInstance(type);
|
||||
return (Form)result;
|
||||
}
|
||||
|
||||
|
||||
@ -50,7 +50,7 @@ namespace DocumentManagement
|
||||
/// 知识树节点排序
|
||||
/// </summary>
|
||||
/// <param name="ls">节点list</param>
|
||||
internal static void SetOrders(List<string> ls)
|
||||
public static void SetOrders(List<string> ls)
|
||||
{
|
||||
try
|
||||
{
|
||||
@ -366,7 +366,7 @@ namespace DocumentManagement
|
||||
return dt;
|
||||
}
|
||||
|
||||
internal static void InsertEntry(KBEntry entry)
|
||||
public static void InsertEntry(KBEntry entry)
|
||||
{
|
||||
try
|
||||
{
|
||||
@ -418,7 +418,7 @@ namespace DocumentManagement
|
||||
}
|
||||
}
|
||||
|
||||
internal static void UpdateEntry(KBEntry entry)
|
||||
public static void UpdateEntry(KBEntry entry)
|
||||
{
|
||||
try
|
||||
{
|
||||
@ -455,7 +455,7 @@ namespace DocumentManagement
|
||||
}
|
||||
}
|
||||
|
||||
internal static void DeleteEntry(string id)
|
||||
public static void DeleteEntry(string id)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
@ -5,7 +5,7 @@ using System.Text;
|
||||
using System.Data;
|
||||
namespace DocumentManagement.DAL
|
||||
{
|
||||
class PrintTemplateDB
|
||||
public class PrintTemplateDB
|
||||
{
|
||||
public static void Add(Model.PrintTemplate PrintTemplateObj)
|
||||
{
|
||||
|
||||
@ -12,6 +12,8 @@
|
||||
<AssemblyName>DocumentManagement</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<NuGetPackageImportStamp>
|
||||
</NuGetPackageImportStamp>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
@ -40,7 +42,7 @@
|
||||
</Reference>
|
||||
<Reference Include="DevComponents.DotNetBar2, Version=12.5.0.2, Culture=neutral, PublicKeyToken=c39c3242a43eee2b, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\AIMS\DLL\DevComponents.DotNetBar2.dll</HintPath>
|
||||
<HintPath>..\AIMS\Extensions\DevComponents.DotNetBar2.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Office.Interop.Excel, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
@ -140,12 +142,6 @@
|
||||
<Compile Include="UI\ExtWriterControl.designer.cs">
|
||||
<DependentUpon>ExtWriterControl.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="UI\frmKB.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="UI\frmKB.Designer.cs">
|
||||
<DependentUpon>frmKB.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="UI\frmParentSelect.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
@ -170,18 +166,6 @@
|
||||
<Compile Include="UI\frmTitle.designer.cs">
|
||||
<DependentUpon>frmTitle.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="UI\frmUserTempPurview.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="UI\frmUserTempPurview.Designer.cs">
|
||||
<DependentUpon>frmUserTempPurview.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="UI\frmUserTempPurviewDetail.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="UI\frmUserTempPurviewDetail.Designer.cs">
|
||||
<DependentUpon>frmUserTempPurviewDetail.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="UI\frmViewSelect.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
@ -215,9 +199,6 @@
|
||||
<EmbeddedResource Include="UI\ExtWriterControl.zh-TW.resx">
|
||||
<DependentUpon>ExtWriterControl.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="UI\frmKB.resx">
|
||||
<DependentUpon>frmKB.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="UI\frmParentSelect.resx">
|
||||
<DependentUpon>frmParentSelect.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
@ -234,12 +215,6 @@
|
||||
<EmbeddedResource Include="UI\frmTitle.resx">
|
||||
<DependentUpon>frmTitle.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="UI\frmUserTempPurview.resx">
|
||||
<DependentUpon>frmUserTempPurview.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="UI\frmUserTempPurviewDetail.resx">
|
||||
<DependentUpon>frmUserTempPurviewDetail.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="UI\frmViewSelect.resx">
|
||||
<DependentUpon>frmViewSelect.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
|
||||
@ -58,9 +58,9 @@ namespace DocumentManagement
|
||||
|
||||
private FlagXTextRangeProvider provider = new FlagXTextRangeProvider();
|
||||
|
||||
private CompilerResults cr;
|
||||
//private CompilerResults cr;
|
||||
|
||||
private Type type;
|
||||
//private Type type;
|
||||
|
||||
public frmTemplate()
|
||||
{
|
||||
@ -295,96 +295,7 @@ namespace DocumentManagement
|
||||
//}
|
||||
//InitCodeCompiler();
|
||||
|
||||
}
|
||||
|
||||
private void InitCodeCompiler()
|
||||
{
|
||||
var providerOptions = new Dictionary<string, string>();
|
||||
providerOptions.Add("CompilerVersion", "v4.0");
|
||||
CodeDomProvider cdp = new CSharpCodeProvider(providerOptions);
|
||||
CompilerParameters cp = new CompilerParameters();
|
||||
cp.GenerateExecutable = false;
|
||||
cp.GenerateInMemory = true;
|
||||
cp.ReferencedAssemblies.Add("mscorlib.dll");
|
||||
cp.ReferencedAssemblies.Add("System.dll");
|
||||
cp.ReferencedAssemblies.Add("System.Core.dll");
|
||||
cp.ReferencedAssemblies.Add("DCSoft.Writer.dll");
|
||||
cp.ReferencedAssemblies.Add("System.Data.Linq.dll");
|
||||
cp.ReferencedAssemblies.Add("System.Xml.Linq.dll");
|
||||
cp.ReferencedAssemblies.Add("System.Windows.Forms.dll");
|
||||
string source = @"
|
||||
namespace DocumentManagement
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using DCSoft.Writer;
|
||||
using DCSoft.Writer.Dom;
|
||||
using System.Windows.Forms;
|
||||
using System.Reflection;
|
||||
public class BindEvents
|
||||
{
|
||||
private XTextDocument doc;
|
||||
private XTextContainerElement container;
|
||||
public BindEvents(DCSoft.Writer.Controls.WriterControl myEditControl)
|
||||
{
|
||||
doc = myEditControl.Document;
|
||||
container = myEditControl.Document;
|
||||
|
||||
}
|
||||
public static void MouseClickEvent(){
|
||||
// doc.EditorControl.FreezeUI();
|
||||
//
|
||||
// doc.EditorControl.ReleaseFreezeUI();
|
||||
// doc.EditorControl.UpdatePages();
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void SetCheckedValue(string name, bool value)
|
||||
{
|
||||
var element = doc.GetElementsByName(name).FirstElement;
|
||||
if (element != null)
|
||||
{
|
||||
var pChecked = element.GetType().GetProperty(""Checked"");
|
||||
pChecked.SetValue(element, value, null);
|
||||
}
|
||||
}
|
||||
|
||||
private bool GetCheckedValue(string name)
|
||||
{
|
||||
bool? result = null;
|
||||
var element = doc.GetElementsByName(name).FirstElement;
|
||||
if (element != null)
|
||||
{
|
||||
var pChecked = element.GetType().GetProperty(""Checked"");
|
||||
result = Convert.ToBoolean(pChecked.GetValue(element, null));
|
||||
}
|
||||
return result.Value;
|
||||
}
|
||||
}
|
||||
}
|
||||
";
|
||||
cr = cdp.CompileAssemblyFromSource(cp, source);
|
||||
if (cr.Errors.HasErrors)
|
||||
{
|
||||
MessageBox.Show("加载元素事件失败!");
|
||||
}
|
||||
else
|
||||
{
|
||||
Assembly a = cr.CompiledAssembly;
|
||||
type = a.GetTypes().Where(x => x.IsClass).FirstOrDefault();
|
||||
Type[] types = new Type[a.GetTypes().Length];
|
||||
types[0] = typeof(WriterControl);
|
||||
ConstructorInfo ci = type.GetConstructor(types);
|
||||
if (ci != null)
|
||||
{
|
||||
object obj = ci.Invoke(new object[] { this.myEditControl });
|
||||
}
|
||||
//myEditControl.Document.GetElementsByName("").FirstElement;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// Handle after load document
|
||||
/// </summary>
|
||||
|
||||
@ -37,7 +37,7 @@
|
||||
<ItemGroup>
|
||||
<Reference Include="DevComponents.DotNetBar2, Version=12.5.0.2, Culture=neutral, PublicKeyToken=c39c3242a43eee2b, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\AIMS\DLL\DevComponents.DotNetBar2.dll</HintPath>
|
||||
<HintPath>..\AIMS\Extensions\DevComponents.DotNetBar2.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
|
||||
@ -72,7 +72,10 @@
|
||||
<Reference Include="DCSoft.Writer">
|
||||
<HintPath>..\AIMS\Extensions\DCSoft.Writer.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DevComponents.DotNetBar2, Version=12.5.0.2, Culture=neutral, PublicKeyToken=c39c3242a43eee2b, processorArchitecture=MSIL" />
|
||||
<Reference Include="DevComponents.DotNetBar2, Version=12.5.0.2, Culture=neutral, PublicKeyToken=c39c3242a43eee2b, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\AIMS\Extensions\DevComponents.DotNetBar2.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\AIMS\Extensions\Newtonsoft.Json.dll</HintPath>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user