From 4cd6f49734933cf7f1eba4994b6b71eb449d1753 Mon Sep 17 00:00:00 2001 From: leomo Date: Tue, 25 Oct 2022 21:24:59 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=87=E4=B9=A6=E8=AE=BE=E8=AE=A1=E5=99=A8?= =?UTF-8?q?=E7=A7=BB=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AIMS.sln | 34 +-- AIMS/AIMS.csproj | 2 +- .../DrawGraphManagement.csproj | 19 ++ DrawGraphManagement/Main.Designer.cs | 61 +++-- DrawGraphManagement/Main.cs | 16 ++ DrawGraphManagement/Program.cs | 16 +- .../Properties/Resources.Designer.cs | 11 +- DrawGraphManagement/Properties/Resources.resx | 16 +- DrawGraphManagement/frmTemplateD.cs | 254 ++++++++++++++++++ DrawGraphManagement/frmTemplateD.designer.cs | 75 ++++++ DrawGraphManagement/frmTemplateD.resx | 120 +++++++++ 11 files changed, 575 insertions(+), 49 deletions(-) create mode 100644 DrawGraphManagement/frmTemplateD.cs create mode 100644 DrawGraphManagement/frmTemplateD.designer.cs create mode 100644 DrawGraphManagement/frmTemplateD.resx diff --git a/AIMS.sln b/AIMS.sln index d4c2e68..ffddf67 100644 --- a/AIMS.sln +++ b/AIMS.sln @@ -3,8 +3,6 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.3.32819.101 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DocumentManagement", "DocumentManagement\DocumentManagement.csproj", "{80E69D05-8436-4342-B0B1-5ADAA8E83D41}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AIMS", "AIMS\AIMS.csproj", "{84990F58-F973-4EDB-BE7B-437A2419DEF0}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DrawGraph", "DrawGraph\DrawGraph.csproj", "{6E0E5EAF-4814-46C9-ADD9-0C9462E2A147}" @@ -23,6 +21,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "UpdateTools", "UpdateTools" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BeginScreen", "BeginScreen\BeginScreen.csproj", "{E7B10062-4B19-4542-B46D-D103CF1D7BA3}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DocumentManagement", "DocumentManagement\DocumentManagement.csproj", "{80E69D05-8436-4342-B0B1-5ADAA8E83D41}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -35,20 +35,6 @@ Global Release|x86 = Release|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {80E69D05-8436-4342-B0B1-5ADAA8E83D41}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {80E69D05-8436-4342-B0B1-5ADAA8E83D41}.Debug|Any CPU.Build.0 = Debug|Any CPU - {80E69D05-8436-4342-B0B1-5ADAA8E83D41}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {80E69D05-8436-4342-B0B1-5ADAA8E83D41}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {80E69D05-8436-4342-B0B1-5ADAA8E83D41}.Debug|x64.ActiveCfg = Debug|Any CPU - {80E69D05-8436-4342-B0B1-5ADAA8E83D41}.Debug|x64.Build.0 = Debug|Any CPU - {80E69D05-8436-4342-B0B1-5ADAA8E83D41}.Debug|x86.ActiveCfg = Debug|Any CPU - {80E69D05-8436-4342-B0B1-5ADAA8E83D41}.Release|Any CPU.ActiveCfg = Release|Any CPU - {80E69D05-8436-4342-B0B1-5ADAA8E83D41}.Release|Any CPU.Build.0 = Release|Any CPU - {80E69D05-8436-4342-B0B1-5ADAA8E83D41}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {80E69D05-8436-4342-B0B1-5ADAA8E83D41}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {80E69D05-8436-4342-B0B1-5ADAA8E83D41}.Release|x64.ActiveCfg = Release|Any CPU - {80E69D05-8436-4342-B0B1-5ADAA8E83D41}.Release|x64.Build.0 = Release|Any CPU - {80E69D05-8436-4342-B0B1-5ADAA8E83D41}.Release|x86.ActiveCfg = Release|Any CPU {84990F58-F973-4EDB-BE7B-437A2419DEF0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {84990F58-F973-4EDB-BE7B-437A2419DEF0}.Debug|Any CPU.Build.0 = Debug|Any CPU {84990F58-F973-4EDB-BE7B-437A2419DEF0}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU @@ -169,6 +155,22 @@ Global {E7B10062-4B19-4542-B46D-D103CF1D7BA3}.Release|x64.Build.0 = Release|Any CPU {E7B10062-4B19-4542-B46D-D103CF1D7BA3}.Release|x86.ActiveCfg = Release|Any CPU {E7B10062-4B19-4542-B46D-D103CF1D7BA3}.Release|x86.Build.0 = Release|Any CPU + {80E69D05-8436-4342-B0B1-5ADAA8E83D41}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {80E69D05-8436-4342-B0B1-5ADAA8E83D41}.Debug|Any CPU.Build.0 = Debug|Any CPU + {80E69D05-8436-4342-B0B1-5ADAA8E83D41}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {80E69D05-8436-4342-B0B1-5ADAA8E83D41}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {80E69D05-8436-4342-B0B1-5ADAA8E83D41}.Debug|x64.ActiveCfg = Debug|Any CPU + {80E69D05-8436-4342-B0B1-5ADAA8E83D41}.Debug|x64.Build.0 = Debug|Any CPU + {80E69D05-8436-4342-B0B1-5ADAA8E83D41}.Debug|x86.ActiveCfg = Debug|Any CPU + {80E69D05-8436-4342-B0B1-5ADAA8E83D41}.Debug|x86.Build.0 = Debug|Any CPU + {80E69D05-8436-4342-B0B1-5ADAA8E83D41}.Release|Any CPU.ActiveCfg = Release|Any CPU + {80E69D05-8436-4342-B0B1-5ADAA8E83D41}.Release|Any CPU.Build.0 = Release|Any CPU + {80E69D05-8436-4342-B0B1-5ADAA8E83D41}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {80E69D05-8436-4342-B0B1-5ADAA8E83D41}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {80E69D05-8436-4342-B0B1-5ADAA8E83D41}.Release|x64.ActiveCfg = Release|Any CPU + {80E69D05-8436-4342-B0B1-5ADAA8E83D41}.Release|x64.Build.0 = Release|Any CPU + {80E69D05-8436-4342-B0B1-5ADAA8E83D41}.Release|x86.ActiveCfg = Release|Any CPU + {80E69D05-8436-4342-B0B1-5ADAA8E83D41}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/AIMS/AIMS.csproj b/AIMS/AIMS.csproj index f8aa025..aab4017 100644 --- a/AIMS/AIMS.csproj +++ b/AIMS/AIMS.csproj @@ -1567,6 +1567,6 @@ - rd /s /q zh-TW zh-cn en + rd /s /q zh-TW zh-cn en ar \ No newline at end of file diff --git a/DrawGraphManagement/DrawGraphManagement.csproj b/DrawGraphManagement/DrawGraphManagement.csproj index d63d027..bba5ec4 100644 --- a/DrawGraphManagement/DrawGraphManagement.csproj +++ b/DrawGraphManagement/DrawGraphManagement.csproj @@ -66,6 +66,12 @@ aims.ico + + ..\AIMS\Extensions\DCSoft.ORM.dll + + + ..\AIMS\Extensions\DCSoft.Writer.dll + False @@ -90,6 +96,12 @@ AreaManageForm.cs + + Form + + + frmTemplateD.cs + Form @@ -117,6 +129,9 @@ AreaManageForm.cs + + frmTemplateD.cs + Main.cs @@ -168,6 +183,10 @@ {5238713c-29c6-4e22-be4c-6e568fe87fa8} AIMSExtension + + {80e69d05-8436-4342-b0b1-5adaa8e83d41} + DocumentManagement + {6e0e5eaf-4814-46c9-add9-0c9462e2a147} DrawGraph diff --git a/DrawGraphManagement/Main.Designer.cs b/DrawGraphManagement/Main.Designer.cs index 43940e3..b351908 100644 --- a/DrawGraphManagement/Main.Designer.cs +++ b/DrawGraphManagement/Main.Designer.cs @@ -50,6 +50,7 @@ this.button8 = new System.Windows.Forms.Button(); this.button7 = new System.Windows.Forms.Button(); this.button6 = new System.Windows.Forms.Button(); + this.button10 = new System.Windows.Forms.Button(); this.button2 = new System.Windows.Forms.Button(); this.label3 = new System.Windows.Forms.Label(); this.txtProjectName = new System.Windows.Forms.TextBox(); @@ -69,9 +70,9 @@ this.label5 = new System.Windows.Forms.Label(); this.txtAreaX = new System.Windows.Forms.TextBox(); this.label4 = new System.Windows.Forms.Label(); + this.button11 = new System.Windows.Forms.Button(); this.myPanel1 = new DrawGraphManagement.MyPanel(); this.zedGraphMain = new DrawGraph.ZedGraphControl(); - this.button10 = new System.Windows.Forms.Button(); this.panel1.SuspendLayout(); this.panel4.SuspendLayout(); this.pnlManageList.SuspendLayout(); @@ -154,7 +155,7 @@ this.panel1.Dock = System.Windows.Forms.DockStyle.Top; this.panel1.Location = new System.Drawing.Point(0, 0); this.panel1.Name = "panel1"; - this.panel1.Size = new System.Drawing.Size(1356, 46); + this.panel1.Size = new System.Drawing.Size(1350, 46); this.panel1.TabIndex = 6; // // panel4 @@ -178,12 +179,12 @@ this.panel4.Dock = System.Windows.Forms.DockStyle.Bottom; this.panel4.Location = new System.Drawing.Point(0, 4); this.panel4.Name = "panel4"; - this.panel4.Size = new System.Drawing.Size(1356, 42); + this.panel4.Size = new System.Drawing.Size(1350, 42); this.panel4.TabIndex = 9; // // button5 // - this.button5.Location = new System.Drawing.Point(1166, 5); + this.button5.Location = new System.Drawing.Point(1394, 15); this.button5.Name = "button5"; this.button5.Size = new System.Drawing.Size(75, 23); this.button5.TabIndex = 16; @@ -194,7 +195,7 @@ // // button4 // - this.button4.Location = new System.Drawing.Point(1085, 5); + this.button4.Location = new System.Drawing.Point(1313, 15); this.button4.Name = "button4"; this.button4.Size = new System.Drawing.Size(75, 23); this.button4.TabIndex = 15; @@ -205,7 +206,7 @@ // // button3 // - this.button3.Location = new System.Drawing.Point(1026, 4); + this.button3.Location = new System.Drawing.Point(1136, 4); this.button3.Name = "button3"; this.button3.Size = new System.Drawing.Size(112, 23); this.button3.TabIndex = 14; @@ -216,7 +217,7 @@ // // txtFontSize // - this.txtFontSize.Location = new System.Drawing.Point(958, 5); + this.txtFontSize.Location = new System.Drawing.Point(1186, 15); this.txtFontSize.Name = "txtFontSize"; this.txtFontSize.Size = new System.Drawing.Size(62, 21); this.txtFontSize.TabIndex = 13; @@ -224,7 +225,7 @@ // // button1 // - this.button1.Location = new System.Drawing.Point(1221, 8); + this.button1.Location = new System.Drawing.Point(1211, 4); this.button1.Name = "button1"; this.button1.Size = new System.Drawing.Size(75, 23); this.button1.TabIndex = 12; @@ -299,6 +300,16 @@ this.button6.UseVisualStyleBackColor = true; this.button6.Click += new System.EventHandler(this.button6_Click); // + // button10 + // + this.button10.Location = new System.Drawing.Point(283, 8); + this.button10.Name = "button10"; + this.button10.Size = new System.Drawing.Size(109, 23); + this.button10.TabIndex = 6; + this.button10.Text = "加载麻醉记录单2"; + this.button10.UseVisualStyleBackColor = true; + this.button10.Click += new System.EventHandler(this.button10_Click); + // // button2 // this.button2.Location = new System.Drawing.Point(182, 8); @@ -349,7 +360,7 @@ this.pnlManageList.Dock = System.Windows.Forms.DockStyle.Left; this.pnlManageList.Location = new System.Drawing.Point(0, 46); this.pnlManageList.Name = "pnlManageList"; - this.pnlManageList.Size = new System.Drawing.Size(208, 666); + this.pnlManageList.Size = new System.Drawing.Size(208, 683); this.pnlManageList.TabIndex = 7; // // treeView1 @@ -357,7 +368,7 @@ this.treeView1.Dock = System.Windows.Forms.DockStyle.Fill; this.treeView1.Location = new System.Drawing.Point(0, 0); this.treeView1.Name = "treeView1"; - this.treeView1.Size = new System.Drawing.Size(208, 666); + this.treeView1.Size = new System.Drawing.Size(208, 683); this.treeView1.TabIndex = 1; this.treeView1.NodeMouseClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.treeView1_NodeMouseClick); // @@ -394,9 +405,9 @@ this.panel3.Controls.Add(this.txtAreaX); this.panel3.Controls.Add(this.label4); this.panel3.Dock = System.Windows.Forms.DockStyle.Right; - this.panel3.Location = new System.Drawing.Point(1133, 46); + this.panel3.Location = new System.Drawing.Point(1127, 46); this.panel3.Name = "panel3"; - this.panel3.Size = new System.Drawing.Size(223, 666); + this.panel3.Size = new System.Drawing.Size(223, 683); this.panel3.TabIndex = 9; // // cmbPageType @@ -479,6 +490,16 @@ this.label4.TabIndex = 0; this.label4.Text = "区域管理器位置X"; // + // button11 + // + this.button11.Location = new System.Drawing.Point(1010, 12); + this.button11.Name = "button11"; + this.button11.Size = new System.Drawing.Size(75, 23); + this.button11.TabIndex = 12; + this.button11.Text = "文书加载"; + this.button11.UseVisualStyleBackColor = true; + this.button11.Click += new System.EventHandler(this.button11_Click); + // // myPanel1 // this.myPanel1.AutoScroll = true; @@ -486,7 +507,7 @@ this.myPanel1.Dock = System.Windows.Forms.DockStyle.Fill; this.myPanel1.Location = new System.Drawing.Point(208, 46); this.myPanel1.Name = "myPanel1"; - this.myPanel1.Size = new System.Drawing.Size(925, 666); + this.myPanel1.Size = new System.Drawing.Size(919, 683); this.myPanel1.TabIndex = 10; this.myPanel1.Scroll += new System.Windows.Forms.ScrollEventHandler(this.myPanel1_Scroll); // @@ -509,25 +530,16 @@ this.zedGraphMain.KeyUp += new System.Windows.Forms.KeyEventHandler(this.zedGraphMain_KeyUp); this.zedGraphMain.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.zedGraphMain_MouseDoubleClick); // - // button10 - // - this.button10.Location = new System.Drawing.Point(283, 8); - this.button10.Name = "button10"; - this.button10.Size = new System.Drawing.Size(109, 23); - this.button10.TabIndex = 6; - this.button10.Text = "加载麻醉记录单2"; - this.button10.UseVisualStyleBackColor = true; - this.button10.Click += new System.EventHandler(this.button10_Click); - // // Main // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScroll = true; - this.ClientSize = new System.Drawing.Size(1356, 712); + this.ClientSize = new System.Drawing.Size(1350, 729); this.Controls.Add(this.myPanel1); this.Controls.Add(this.panel3); this.Controls.Add(this.pnlManageList); + this.Controls.Add(this.button11); this.Controls.Add(this.panel1); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.Name = "Main"; @@ -591,5 +603,6 @@ private System.Windows.Forms.Button button8; private System.Windows.Forms.Button button9; private System.Windows.Forms.Button button10; + private System.Windows.Forms.Button button11; } } \ No newline at end of file diff --git a/DrawGraphManagement/Main.cs b/DrawGraphManagement/Main.cs index 9685f41..00e24bc 100644 --- a/DrawGraphManagement/Main.cs +++ b/DrawGraphManagement/Main.cs @@ -28,6 +28,16 @@ namespace DrawGraphManagement { HospitalInfo hospital = BHospitalInfo.SelectSingle(1); txtHospitalName.Text = hospital.HospitalName; + Person PersonObj = BPerson.GetModelByNo("admin"); + AIMSExtension.PublicMethod.OperatorId = PersonObj.Id.Value; + AIMSExtension.PublicMethod.OperatorNo = PersonObj.No; + AIMSExtension.PublicMethod.OperatorName = PersonObj.Name; + AIMSExtension.PublicMethod.RoleId = PersonObj.RoleId.Value; + AIMSExtension.PublicMethod.DepId = PersonObj.DepId.Value; + AIMSExtension.PublicMethod.DeptName = BDepartment.GetModel(PersonObj.DepId.Value).Name; + Role role = BRole.GetModel(PersonObj.RoleId.Value); + AIMSExtension.PublicMethod.PermissionLevel = role.PermissionLevel == null ? 0 : role.PermissionLevel.Value; + AIMSExtension.PublicMethod.RoleName = BMenu.GetMenuRootListManageStr(AIMSExtension.PublicMethod.RoleId, "功能权限"); myPanel1.MouseWheel += new System.Windows.Forms.MouseEventHandler(panel1_MouseWheel); LoadManageList(); } @@ -741,5 +751,11 @@ namespace DrawGraphManagement } } + + private void button11_Click(object sender, EventArgs e) + { + frmTemplateD frmTemplateD = new frmTemplateD(); + frmTemplateD.ShowDialog(); + } } } diff --git a/DrawGraphManagement/Program.cs b/DrawGraphManagement/Program.cs index 7ac7186..46070a4 100644 --- a/DrawGraphManagement/Program.cs +++ b/DrawGraphManagement/Program.cs @@ -1,6 +1,5 @@ using System; -using System.Collections.Generic; -using System.Linq; +using System.Threading.Tasks; using System.Windows.Forms; namespace DrawGraphManagement @@ -15,7 +14,20 @@ namespace DrawGraphManagement { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); + Task.Factory.StartNew(() => { PreLoad(); }); Application.Run(new Main()); } + static void PreLoad() + { + string msg = DCSoft.Writer.Controls.WriterControl.CheckSystemEnvironment(false); + if (msg != null) + { + MessageBox.Show(null, msg, "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + // 预先初始化一些数据 + DCSoft.Writer.WriterAppHost.PreloadSystem(); + DCSoft.Writer.Controls.WriterControl.StaticSetRegisterCode(AIMSExtension.PublicMethod.Decrypt(Properties.Resources.C)); + } } } diff --git a/DrawGraphManagement/Properties/Resources.Designer.cs b/DrawGraphManagement/Properties/Resources.Designer.cs index 65dde60..9d2008e 100644 --- a/DrawGraphManagement/Properties/Resources.Designer.cs +++ b/DrawGraphManagement/Properties/Resources.Designer.cs @@ -19,7 +19,7 @@ namespace DrawGraphManagement.Properties { // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。 // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen // (以 /str 作为命令选项),或重新生成 VS 项目。 - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class Resources { @@ -59,5 +59,14 @@ namespace DrawGraphManagement.Properties { resourceCulture = value; } } + + /// + /// 查找类似 1sxPF07zNVfxmn1DZSYj8Y9tROX4XWuSkOfyUPCTQ2+ohh1vlKDq6JtzJvEGtNJZkwcxiB1DBhM68bIWFJ2LSg==K??????q[d?zY? 的本地化字符串。 + /// + internal static string C { + get { + return ResourceManager.GetString("C", resourceCulture); + } + } } } diff --git a/DrawGraphManagement/Properties/Resources.resx b/DrawGraphManagement/Properties/Resources.resx index af7dbeb..4bad478 100644 --- a/DrawGraphManagement/Properties/Resources.resx +++ b/DrawGraphManagement/Properties/Resources.resx @@ -46,7 +46,7 @@ mimetype: application/x-microsoft.net.object.binary.base64 value : The object must be serialized with - : System.Serialization.Formatters.Binary.BinaryFormatter + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter : and then encoded with base64 encoding. mimetype: application/x-microsoft.net.object.soap.base64 @@ -60,6 +60,7 @@ : and then encoded with base64 encoding. --> + @@ -68,9 +69,10 @@ - + + @@ -85,9 +87,10 @@ - + + @@ -109,9 +112,12 @@ 2.0 - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 1sxPF07zNVfxmn1DZSYj8Y9tROX4XWuSkOfyUPCTQ2+ohh1vlKDq6JtzJvEGtNJZkwcxiB1DBhM68bIWFJ2LSg==K??????q[d?zY? + \ No newline at end of file diff --git a/DrawGraphManagement/frmTemplateD.cs b/DrawGraphManagement/frmTemplateD.cs new file mode 100644 index 0000000..9514e6f --- /dev/null +++ b/DrawGraphManagement/frmTemplateD.cs @@ -0,0 +1,254 @@ +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 DocumentManagement; +using DCSoft.Writer.Controls; +using System.CodeDom.Compiler; +using System.Reflection; +using Microsoft.CSharp; +using DCSoft.Writer; +using DCSoft.Writer.Dom; +using System.Xml; + +namespace DrawGraphManagement +{ + public partial class frmTemplateD : Form + { + private WriterControl myEditControl; + + private frmTemplate temp; + + private ucClassify ucClassify; + + //private CompilerResults cr; + + //private Type type; + + private EventCodeCompiler codeCompiler; + + public frmTemplateD() + { + InitializeComponent(); + ucClassify = new DocumentManagement.ucClassify(); + this.panel1.Controls.Add(ucClassify); + ucClassify.Dock = DockStyle.Fill; + ucClassify.IsReadOnly = false; + ucClassify.tv.NodeMouseClick += new TreeNodeMouseClickEventHandler(tv_NodeMouseClick); + ucClassify.ms.Items["添加同级目录ToolStripMenuItem"].Click += new EventHandler(添加同级目录ToolStripMenuItem_Click); + ucClassify.ms.Items["添加子目录ToolStripMenuItem"].Click += new EventHandler(添加子目录ToolStripMenuItem_Click); + ucClassify.ms.Items["重命名当前节点ToolStripMenuItem"].Click += new EventHandler(重命名当前节点ToolStripMenuItem_Click); + ucClassify.ms.Items["删除当前节点ToolStripMenuItem"].Click += new EventHandler(删除当前节点ToolStripMenuItem_Click); + ucClassify.RefreshTree(); + + temp = new frmTemplate(); + myEditControl = temp.editControl; + + //codeCompiler = new EventCodeCompiler(myEditControl,"",""); + + temp.TopLevel = false; + temp.Parent = panel2; + temp.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; + temp.Dock = DockStyle.Fill; + temp.Show(); + + this.FormClosing += temp.frmTemplate_FormClosing; + } +#if debug + private void SetValueById(string Id, string type, object value) + { + var element = myEditControl.Document.GetElementsById(Id).FirstElement; + if (element != null) + { + var pChecked = element.GetType().GetProperty(type); + pChecked.SetValue(element, value, null); + element.EditorRefreshView(); + } + } + + private void SetValueByName(string name, string type,object value) + { + var element = myEditControl.Document.GetElementsByName(name).FirstElement; + if (element != null) + { + var pChecked = element.GetType().GetProperty(type); + pChecked.SetValue(element, value, null); + element.EditorRefreshView(); + } + } + + private bool GetCheckedValueByName(string name) + { + bool? result = null; + var element = myEditControl.Document.GetElementsByName(name).FirstElement; + if (element != null) + { + var pChecked = element.GetType().GetProperty("Checked"); + result = Convert.ToBoolean(pChecked.GetValue(element, null)); + } + return result.Value; + } +#endif + void tv_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e) + { + TreeNode node = e.Node; + if (e.Button == System.Windows.Forms.MouseButtons.Left && node != ucClassify.tv.SelectedNode) + { + try + { + if (myEditControl.Document.Modified) + { + DialogResult result = MessageBox.Show("文件已经修改,尚未保存,是否保存文件?" + , "系统提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question, + MessageBoxDefaultButton.Button1); + switch (result) + { + case DialogResult.Yes: + codeCompiler = new EventCodeCompiler(ref myEditControl, temp.RTB_Click.Text, temp.RTB_Content.Text); + if (codeCompiler.Errors.Count > 0) + { + throw new Exception(codeCompiler.Errors[0].ErrorText); + } + temp.InsertOrUpdate(); + break; + case DialogResult.No: + break; + default: + break; + } + } + temp.model = DocumentDAL.GetTemplatebyId(int.Parse(node.Name)); + this.Text = temp.model.XmlFileName; + if (temp.model.XmlStatic != string.Empty) + { + XmlDocument doc = new XmlDocument(); + doc.LoadXml(temp.model.XmlStatic); + temp.RTB_Click.Text = doc.GetElementsByTagName("ClickEvent")[0].InnerText; + temp.RTB_Content.Text = doc.GetElementsByTagName("ContentChangedEnvent")[0].InnerText; + } + else + { + temp.RTB_Click.Text = ""; + temp.RTB_Content.Text = ""; + } + if (temp.model.XmlFile != string.Empty) + { + myEditControl.LoadDocumentFromString(temp.model.XmlFile, "xml"); + this.codeCompiler = new EventCodeCompiler(ref myEditControl, temp.RTB_Click.Text, temp.RTB_Content.Text); + } + else + { + myEditControl.ExecuteCommand("FileNew", true, null); + } + + } + catch (Exception ex) + { + MessageBox.Show(ex.Message); + } + } + } + + private void 添加同级目录ToolStripMenuItem_Click(object sender, EventArgs e) + { + TreeNode node = ucClassify.tv.SelectedNode; + frmTitle f = new frmTitle(); + f.model = new PrintTemplate() + { + ParentId = node.Parent == null ? 0 : int.Parse(node.Parent.Name), + OperatorNo = AIMSExtension.PublicMethod.OperatorNo + }; + if (f.ShowDialog() != DialogResult.OK) + { + return; + } + DocumentDAL.InsertTemplate(f.model); + ucClassify.RefreshTree(f.model.Id.ToString()); + } + + private void 添加子目录ToolStripMenuItem_Click(object sender, EventArgs e) + { + frmTitle f = new frmTitle(); + f.model = new PrintTemplate() + { + ParentId = int.Parse(ucClassify.tv.SelectedNode.Name), + OperatorNo = AIMSExtension.PublicMethod.OperatorNo + }; + if (f.ShowDialog() != DialogResult.OK) + { + return; + } + DocumentDAL.InsertTemplate(f.model); + ucClassify.RefreshTree(f.model.Id.ToString()); + //myEditControl.ExecuteCommand("FileNew", true, null); + } + + private void 重命名当前节点ToolStripMenuItem_Click(object sender, EventArgs e) + { + frmTitle f = new frmTitle(); + TreeNode node = ucClassify.tv.SelectedNode; + f.model = new PrintTemplate() + { + Id = int.Parse(node.Name), + XmlFileName = node.Text, + OperatorNo = AIMSExtension.PublicMethod.OperatorNo + }; + f.ShowDialog(); + if (f.DialogResult == DialogResult.OK) + { + DocumentDAL.UpdateTemplateName(f.model); + node.Text = f.model.XmlFileName; + this.Text = f.model.XmlFileName; + } + } + + private void 删除当前节点ToolStripMenuItem_Click(object sender, EventArgs e) + { + try + { + TreeNode node = ucClassify.tv.SelectedNode; + if (node == null) + { + return; + } + //else if (node.Parent == null) + //{ + // MessageBox.Show("根节点不可删除!"); + // return; + //} + string text1 = "是否删除当前文档[" + node.Text + "]?"; + //string text2 = "是否删除当前节点[" + node.Text + "]及其子文档?"; + DialogResult result = MessageBox.Show( text1, "系统提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question, + MessageBoxDefaultButton.Button1); + if (result == System.Windows.Forms.DialogResult.Yes) + { + DocumentDAL.DeleteTemplate(temp.model); + ucClassify.RefreshTree(); + if (ucClassify.tv.Nodes.Count > 0) + { + ucClassify.tv.SelectedNode = ucClassify.tv.Nodes[0]; + this.Text = ucClassify.tv.SelectedNode.Text; + temp.model = DocumentDAL.GetTemplatebyId(int.Parse(ucClassify.tv.SelectedNode.Name)); + if (temp.model.XmlFile != string.Empty) + { + myEditControl.LoadDocumentFromString(temp.model.XmlFile, "xml"); + this.codeCompiler = new EventCodeCompiler(ref myEditControl, temp.RTB_Click.Text, temp.RTB_Content.Text); + } + else + { + myEditControl.ExecuteCommand("FileNew", true, null); + } + } + } + } + catch (Exception ex) + { + MessageBox.Show(ex.Message); + } + } + } +} diff --git a/DrawGraphManagement/frmTemplateD.designer.cs b/DrawGraphManagement/frmTemplateD.designer.cs new file mode 100644 index 0000000..2ebe64a --- /dev/null +++ b/DrawGraphManagement/frmTemplateD.designer.cs @@ -0,0 +1,75 @@ +namespace DrawGraphManagement +{ + partial class frmTemplateD + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.panel1 = new System.Windows.Forms.Panel(); + this.panel2 = new System.Windows.Forms.Panel(); + this.SuspendLayout(); + // + // panel1 + // + this.panel1.Dock = System.Windows.Forms.DockStyle.Left; + this.panel1.Location = new System.Drawing.Point(0, 0); + this.panel1.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); + this.panel1.MaximumSize = new System.Drawing.Size(225, 0); + this.panel1.MinimumSize = new System.Drawing.Size(165, 0); + this.panel1.Name = "panel1"; + this.panel1.Size = new System.Drawing.Size(165, 474); + this.panel1.TabIndex = 7; + // + // panel2 + // + this.panel2.Dock = System.Windows.Forms.DockStyle.Fill; + this.panel2.Location = new System.Drawing.Point(165, 0); + this.panel2.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); + this.panel2.Name = "panel2"; + this.panel2.Size = new System.Drawing.Size(762, 474); + this.panel2.TabIndex = 8; + // + // frmTemplateD + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(927, 474); + this.Controls.Add(this.panel2); + this.Controls.Add(this.panel1); + this.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); + this.Name = "frmTemplateD"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; + this.WindowState = System.Windows.Forms.FormWindowState.Maximized; + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.Panel panel1; + private System.Windows.Forms.Panel panel2; + } +} \ No newline at end of file diff --git a/DrawGraphManagement/frmTemplateD.resx b/DrawGraphManagement/frmTemplateD.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/DrawGraphManagement/frmTemplateD.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file