Commit caf3243d authored by tr's avatar tr

1、模块管理:基本功能实现(复制和新增暂未实现)

parent 37fd764b
......@@ -54,7 +54,7 @@ namespace Tools.MyCommon
/// <summary>
/// 窗体对象
/// </summary>
public Type FrmView { get; set; }
public Type ViewFormType { get; set; }
/// <summary>
/// 显示名称
/// </summary>
......
......@@ -23,6 +23,10 @@ namespace Tools.MyCommon
/// 全局数据集:应该在InitData()中进行初始化
/// </summary>
DataSet _ds { get; set; }
/// <summary>
/// 模块表集合:通用保存必须初始化该项
/// </summary>
List<TQuery> ModuleTableList { get; set; }
/// <summary>
/// 初始化数据库访问对象
......
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
......@@ -27,6 +28,10 @@ namespace Tools.MyCommon
/// 全局数据集
/// </summary>
public DataSet _ds { get; set; }
/// <summary>
/// 模块表集合-用于保存
/// </summary>
public List<TQuery> ModuleTableList { get; set; }
/// <summary>
/// 构造函数
......@@ -88,7 +93,11 @@ namespace Tools.MyCommon
/// <returns></returns>
public virtual bool SaveCheck()
{
//保存之前的检查,全部放到此方法处理
//结束编辑
this.BaseInfoEndEdit();
this.DataGridViewCommitEditCell(this);
this.DataSetEndEdit(this._ds);
return true;
}
/// <summary>
......@@ -97,8 +106,79 @@ namespace Tools.MyCommon
/// <returns></returns>
public virtual bool Save()
{
//保存的逻辑放到此方法内实现
//保存检查
if (this._ds == null || !this.SaveCheck())
return false;
//未修改提示
if (!this._ds.HasChanges())
{
Utils.Tip("数据未修改!");
return true;
}
//保存数据
if (this._db.SaveData(this._ds.GetChanges(), this.ModuleTableList))
{
Utils.Tip("保存成功!");
}
return true;
}
/// <summary>
/// 基本信息-结束编辑
/// </summary>
private void BaseInfoEndEdit()
{
BindingManagerBase bm;
foreach (DictionaryEntry item in this.BindingContext)
{
bm = (item.Value as WeakReference).Target as BindingManagerBase;
if (bm != null)
{
bm.EndCurrentEdit();
}
}
}
/// <summary>
/// 数据表格-提交编辑单元格
/// </summary>
/// <param name="root"></param>
private void DataGridViewCommitEditCell(Control root)
{
foreach (Control c in root.Controls)
{
if (c is DataGridView dgv)
{
dgv.CommitEdit(DataGridViewDataErrorContexts.Display);
continue;
}
//递归子控件
if (c.Controls.Count > 0)
{
this.DataGridViewCommitEditCell(c);
}
}
}
/// <summary>
/// 数据集-结束编辑
/// </summary>
/// <param name="ds"></param>
private void DataSetEndEdit(DataSet ds)
{
if (ds == null)
return;
foreach (DataTable dt in ds.Tables)
{
foreach (DataRow r in dt.Rows)
{
if (r.RowState != DataRowState.Deleted
&& r.RowState != DataRowState.Detached)
{
r.EndEdit();
}
}
}
}
}
}
......@@ -160,6 +160,16 @@ namespace Tools.Properties {
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap 复制 {
get {
object obj = ResourceManager.GetObject("复制", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
......@@ -200,6 +210,16 @@ namespace Tools.Properties {
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap 新增 {
get {
object obj = ResourceManager.GetObject("新增", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
......
......@@ -148,6 +148,9 @@
<data name="加载" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\加载.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="复制" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\复制.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="实体类" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\实体类.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
......@@ -160,6 +163,9 @@
<data name="数据库" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\数据库.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="新增" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\新增.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="暂存" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\暂存.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
......
......@@ -160,6 +160,12 @@
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="UI\wModuleManager.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="UI\wModuleManager.Designer.cs">
<DependentUpon>wModuleManager.cs</DependentUpon>
</Compile>
<Compile Include="UI\wMonitorVisit.cs">
<SubType>Form</SubType>
</Compile>
......@@ -243,6 +249,9 @@
<EmbeddedResource Include="UI\wDBTools.resx">
<DependentUpon>wDBTools.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UI\wModuleManager.resx">
<DependentUpon>wModuleManager.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UI\wMonitorVisit.resx">
<DependentUpon>wMonitorVisit.cs</DependentUpon>
</EmbeddedResource>
......@@ -343,5 +352,11 @@
<ItemGroup>
<None Include="Resources\node_audit.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\新增.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\复制.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
\ No newline at end of file
namespace Tools.UI
{
partial class wModuleManager
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.toolStrip1 = new System.Windows.Forms.ToolStrip();
this.tsbAdd = new System.Windows.Forms.ToolStripButton();
this.tsbCopy = new System.Windows.Forms.ToolStripButton();
this.tsbDbSetting = new System.Windows.Forms.ToolStripButton();
this.tslDbLinkString = new System.Windows.Forms.ToolStripLabel();
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.tvModules = new System.Windows.Forms.TreeView();
this.panelMHeader = new System.Windows.Forms.Panel();
this.tbSearch = new System.Windows.Forms.TextBox();
this.label13 = new System.Windows.Forms.Label();
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.dgvDetail = new System.Windows.Forms.DataGridView();
this.tsFuncInfo = new System.Windows.Forms.ToolStrip();
this.toolStripLabel2 = new System.Windows.Forms.ToolStripLabel();
this.tsBaseInfo = new System.Windows.Forms.ToolStrip();
this.toolStripLabel3 = new System.Windows.Forms.ToolStripLabel();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
this.label6 = new System.Windows.Forms.Label();
this.label7 = new System.Windows.Forms.Label();
this.label8 = new System.Windows.Forms.Label();
this.label9 = new System.Windows.Forms.Label();
this.label10 = new System.Windows.Forms.Label();
this.label11 = new System.Windows.Forms.Label();
this.label12 = new System.Windows.Forms.Label();
this.tbName = new System.Windows.Forms.TextBox();
this.tbBusinessName = new System.Windows.Forms.TextBox();
this.tbStringID = new System.Windows.Forms.TextBox();
this.tbDocType = new System.Windows.Forms.TextBox();
this.tbLevelNum = new System.Windows.Forms.TextBox();
this.tbIndex = new System.Windows.Forms.TextBox();
this.tbIcoIndex = new System.Windows.Forms.TextBox();
this.tbType = new System.Windows.Forms.TextBox();
this.tbProductBarCodeType = new System.Windows.Forms.TextBox();
this.ckCanPassLevelReport = new System.Windows.Forms.CheckBox();
this.tbSysCode = new System.Windows.Forms.TextBox();
this.tbPrevID = new System.Windows.Forms.TextBox();
this.tsbSave = new System.Windows.Forms.ToolStripButton();
this.toolStrip1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
this.splitContainer1.SuspendLayout();
this.panelMHeader.SuspendLayout();
this.tableLayoutPanel1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dgvDetail)).BeginInit();
this.tsFuncInfo.SuspendLayout();
this.tsBaseInfo.SuspendLayout();
this.SuspendLayout();
//
// toolStrip1
//
this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.tsbAdd,
this.tsbCopy,
this.tsbSave,
this.tsbDbSetting,
this.tslDbLinkString});
this.toolStrip1.Location = new System.Drawing.Point(0, 0);
this.toolStrip1.Name = "toolStrip1";
this.toolStrip1.Size = new System.Drawing.Size(979, 25);
this.toolStrip1.TabIndex = 0;
this.toolStrip1.Text = "toolStrip1";
//
// tsbAdd
//
this.tsbAdd.Image = global::Tools.Properties.Resources.新增;
this.tsbAdd.ImageTransparentColor = System.Drawing.Color.Magenta;
this.tsbAdd.Name = "tsbAdd";
this.tsbAdd.Size = new System.Drawing.Size(52, 22);
this.tsbAdd.Text = "新增";
//
// tsbCopy
//
this.tsbCopy.Image = global::Tools.Properties.Resources.复制;
this.tsbCopy.ImageTransparentColor = System.Drawing.Color.Magenta;
this.tsbCopy.Name = "tsbCopy";
this.tsbCopy.Size = new System.Drawing.Size(52, 22);
this.tsbCopy.Text = "复制";
//
// tsbDbSetting
//
this.tsbDbSetting.Image = global::Tools.Properties.Resources.数据库;
this.tsbDbSetting.ImageTransparentColor = System.Drawing.Color.Magenta;
this.tsbDbSetting.Name = "tsbDbSetting";
this.tsbDbSetting.Size = new System.Drawing.Size(64, 22);
this.tsbDbSetting.Text = "数据库";
//
// tslDbLinkString
//
this.tslDbLinkString.AutoSize = false;
this.tslDbLinkString.Font = new System.Drawing.Font("Microsoft YaHei UI", 7.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.tslDbLinkString.ForeColor = System.Drawing.Color.Green;
this.tslDbLinkString.Name = "tslDbLinkString";
this.tslDbLinkString.Size = new System.Drawing.Size(150, 22);
this.tslDbLinkString.Text = "--请先选择数据库链接--";
this.tslDbLinkString.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// splitContainer1
//
this.splitContainer1.BackColor = System.Drawing.Color.LightSkyBlue;
this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer1.Location = new System.Drawing.Point(0, 25);
this.splitContainer1.Name = "splitContainer1";
//
// splitContainer1.Panel1
//
this.splitContainer1.Panel1.BackColor = System.Drawing.SystemColors.Control;
this.splitContainer1.Panel1.Controls.Add(this.tvModules);
this.splitContainer1.Panel1.Controls.Add(this.panelMHeader);
//
// splitContainer1.Panel2
//
this.splitContainer1.Panel2.BackColor = System.Drawing.SystemColors.Control;
this.splitContainer1.Panel2.Controls.Add(this.tableLayoutPanel1);
this.splitContainer1.Size = new System.Drawing.Size(979, 541);
this.splitContainer1.SplitterDistance = 259;
this.splitContainer1.SplitterWidth = 6;
this.splitContainer1.TabIndex = 1;
//
// tvModules
//
this.tvModules.Dock = System.Windows.Forms.DockStyle.Fill;
this.tvModules.Location = new System.Drawing.Point(0, 39);
this.tvModules.Name = "tvModules";
this.tvModules.Size = new System.Drawing.Size(259, 502);
this.tvModules.TabIndex = 1;
//
// panelMHeader
//
this.panelMHeader.BackColor = System.Drawing.SystemColors.Control;
this.panelMHeader.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.panelMHeader.Controls.Add(this.tbSearch);
this.panelMHeader.Controls.Add(this.label13);
this.panelMHeader.Dock = System.Windows.Forms.DockStyle.Top;
this.panelMHeader.Location = new System.Drawing.Point(0, 0);
this.panelMHeader.Name = "panelMHeader";
this.panelMHeader.Size = new System.Drawing.Size(259, 39);
this.panelMHeader.TabIndex = 0;
//
// tbSearch
//
this.tbSearch.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.tbSearch.Location = new System.Drawing.Point(52, 9);
this.tbSearch.Name = "tbSearch";
this.tbSearch.Size = new System.Drawing.Size(189, 21);
this.tbSearch.TabIndex = 1;
//
// label13
//
this.label13.AutoSize = true;
this.label13.Location = new System.Drawing.Point(5, 12);
this.label13.Name = "label13";
this.label13.Size = new System.Drawing.Size(41, 12);
this.label13.TabIndex = 0;
this.label13.Text = "查询:";
//
// tableLayoutPanel1
//
this.tableLayoutPanel1.ColumnCount = 8;
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 75F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 25F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 75F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 25F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 75F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 25F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 75F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 25F));
this.tableLayoutPanel1.Controls.Add(this.dgvDetail, 0, 5);
this.tableLayoutPanel1.Controls.Add(this.tsFuncInfo, 0, 4);
this.tableLayoutPanel1.Controls.Add(this.tsBaseInfo, 0, 0);
this.tableLayoutPanel1.Controls.Add(this.label1, 0, 1);
this.tableLayoutPanel1.Controls.Add(this.label2, 0, 2);
this.tableLayoutPanel1.Controls.Add(this.label3, 0, 3);
this.tableLayoutPanel1.Controls.Add(this.label4, 2, 1);
this.tableLayoutPanel1.Controls.Add(this.label5, 2, 2);
this.tableLayoutPanel1.Controls.Add(this.label6, 2, 3);
this.tableLayoutPanel1.Controls.Add(this.label7, 4, 1);
this.tableLayoutPanel1.Controls.Add(this.label8, 4, 2);
this.tableLayoutPanel1.Controls.Add(this.label9, 4, 3);
this.tableLayoutPanel1.Controls.Add(this.label10, 6, 1);
this.tableLayoutPanel1.Controls.Add(this.label11, 6, 2);
this.tableLayoutPanel1.Controls.Add(this.label12, 6, 3);
this.tableLayoutPanel1.Controls.Add(this.tbName, 1, 1);
this.tableLayoutPanel1.Controls.Add(this.tbBusinessName, 5, 1);
this.tableLayoutPanel1.Controls.Add(this.tbStringID, 1, 2);
this.tableLayoutPanel1.Controls.Add(this.tbDocType, 7, 1);
this.tableLayoutPanel1.Controls.Add(this.tbLevelNum, 3, 2);
this.tableLayoutPanel1.Controls.Add(this.tbIndex, 5, 2);
this.tableLayoutPanel1.Controls.Add(this.tbIcoIndex, 7, 2);
this.tableLayoutPanel1.Controls.Add(this.tbType, 1, 3);
this.tableLayoutPanel1.Controls.Add(this.tbProductBarCodeType, 3, 3);
this.tableLayoutPanel1.Controls.Add(this.ckCanPassLevelReport, 5, 3);
this.tableLayoutPanel1.Controls.Add(this.tbSysCode, 7, 3);
this.tableLayoutPanel1.Controls.Add(this.tbPrevID, 3, 1);
this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
this.tableLayoutPanel1.RowCount = 8;
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 27F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 27F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 27F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 27F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 27F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 27F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 27F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
this.tableLayoutPanel1.Size = new System.Drawing.Size(714, 541);
this.tableLayoutPanel1.TabIndex = 1;
//
// dgvDetail
//
this.dgvDetail.BackgroundColor = System.Drawing.SystemColors.Window;
this.dgvDetail.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.tableLayoutPanel1.SetColumnSpan(this.dgvDetail, 8);
this.dgvDetail.Dock = System.Windows.Forms.DockStyle.Fill;
this.dgvDetail.Location = new System.Drawing.Point(3, 138);
this.dgvDetail.Name = "dgvDetail";
this.tableLayoutPanel1.SetRowSpan(this.dgvDetail, 3);
this.dgvDetail.RowTemplate.Height = 23;
this.dgvDetail.Size = new System.Drawing.Size(708, 400);
this.dgvDetail.TabIndex = 1;
//
// tsFuncInfo
//
this.tableLayoutPanel1.SetColumnSpan(this.tsFuncInfo, 8);
this.tsFuncInfo.Dock = System.Windows.Forms.DockStyle.Fill;
this.tsFuncInfo.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.toolStripLabel2});
this.tsFuncInfo.Location = new System.Drawing.Point(0, 108);
this.tsFuncInfo.Name = "tsFuncInfo";
this.tsFuncInfo.Size = new System.Drawing.Size(714, 27);
this.tsFuncInfo.TabIndex = 1;
this.tsFuncInfo.Text = "toolStrip3";
//
// toolStripLabel2
//
this.toolStripLabel2.Name = "toolStripLabel2";
this.toolStripLabel2.Size = new System.Drawing.Size(56, 24);
this.toolStripLabel2.Text = "功能信息";
//
// tsBaseInfo
//
this.tableLayoutPanel1.SetColumnSpan(this.tsBaseInfo, 8);
this.tsBaseInfo.Dock = System.Windows.Forms.DockStyle.Fill;
this.tsBaseInfo.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.toolStripLabel3});
this.tsBaseInfo.Location = new System.Drawing.Point(0, 0);
this.tsBaseInfo.Name = "tsBaseInfo";
this.tsBaseInfo.Size = new System.Drawing.Size(714, 27);
this.tsBaseInfo.TabIndex = 0;
this.tsBaseInfo.Text = "toolStrip2";
//
// toolStripLabel3
//
this.toolStripLabel3.Name = "toolStripLabel3";
this.toolStripLabel3.Size = new System.Drawing.Size(56, 24);
this.toolStripLabel3.Text = "基本信息";
//
// label1
//
this.label1.AutoSize = true;
this.label1.Dock = System.Windows.Forms.DockStyle.Fill;
this.label1.Location = new System.Drawing.Point(3, 27);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(69, 27);
this.label1.TabIndex = 2;
this.label1.Text = "模块名称";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// label2
//
this.label2.AutoSize = true;
this.label2.Dock = System.Windows.Forms.DockStyle.Fill;
this.label2.Location = new System.Drawing.Point(3, 54);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(69, 27);
this.label2.TabIndex = 3;
this.label2.Text = "字符串ID";
this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// label3
//
this.label3.AutoSize = true;
this.label3.Dock = System.Windows.Forms.DockStyle.Fill;
this.label3.Location = new System.Drawing.Point(3, 81);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(69, 27);
this.label3.TabIndex = 4;
this.label3.Text = "类 型";
this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// label4
//
this.label4.AutoSize = true;
this.label4.Dock = System.Windows.Forms.DockStyle.Fill;
this.label4.Location = new System.Drawing.Point(181, 27);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(69, 27);
this.label4.TabIndex = 5;
this.label4.Text = "归属目录";
this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// label5
//
this.label5.AutoSize = true;
this.label5.Dock = System.Windows.Forms.DockStyle.Fill;
this.label5.Location = new System.Drawing.Point(181, 54);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(69, 27);
this.label5.TabIndex = 6;
this.label5.Text = "层级编号";
this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// label6
//
this.label6.AutoSize = true;
this.label6.Dock = System.Windows.Forms.DockStyle.Fill;
this.label6.Location = new System.Drawing.Point(181, 81);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(69, 27);
this.label6.TabIndex = 7;
this.label6.Text = "条码类型";
this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// label7
//
this.label7.AutoSize = true;
this.label7.Dock = System.Windows.Forms.DockStyle.Fill;
this.label7.Location = new System.Drawing.Point(359, 27);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(69, 27);
this.label7.TabIndex = 8;
this.label7.Text = "业 务 类";
this.label7.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// label8
//
this.label8.AutoSize = true;
this.label8.Dock = System.Windows.Forms.DockStyle.Fill;
this.label8.Location = new System.Drawing.Point(359, 54);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(69, 27);
this.label8.TabIndex = 9;
this.label8.Text = "序 号";
this.label8.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// label9
//
this.label9.AutoSize = true;
this.label9.Dock = System.Windows.Forms.DockStyle.Fill;
this.label9.Location = new System.Drawing.Point(359, 81);
this.label9.Name = "label9";
this.label9.Size = new System.Drawing.Size(69, 27);
this.label9.TabIndex = 10;
this.label9.Text = "跨级报表";
this.label9.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// label10
//
this.label10.AutoSize = true;
this.label10.Dock = System.Windows.Forms.DockStyle.Fill;
this.label10.Location = new System.Drawing.Point(537, 27);
this.label10.Name = "label10";
this.label10.Size = new System.Drawing.Size(69, 27);
this.label10.TabIndex = 11;
this.label10.Text = "枚 举 值";
this.label10.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// label11
//
this.label11.AutoSize = true;
this.label11.Dock = System.Windows.Forms.DockStyle.Fill;
this.label11.Location = new System.Drawing.Point(537, 54);
this.label11.Name = "label11";
this.label11.Size = new System.Drawing.Size(69, 27);
this.label11.TabIndex = 12;
this.label11.Text = "图标编号";
this.label11.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// label12
//
this.label12.AutoSize = true;
this.label12.Dock = System.Windows.Forms.DockStyle.Fill;
this.label12.Location = new System.Drawing.Point(537, 81);
this.label12.Name = "label12";
this.label12.Size = new System.Drawing.Size(69, 27);
this.label12.TabIndex = 13;
this.label12.Text = "系统归属";
this.label12.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// tbName
//
this.tbName.Dock = System.Windows.Forms.DockStyle.Fill;
this.tbName.Location = new System.Drawing.Point(78, 30);
this.tbName.Name = "tbName";
this.tbName.Size = new System.Drawing.Size(97, 21);
this.tbName.TabIndex = 14;
//
// tbBusinessName
//
this.tbBusinessName.Dock = System.Windows.Forms.DockStyle.Fill;
this.tbBusinessName.Location = new System.Drawing.Point(434, 30);
this.tbBusinessName.Name = "tbBusinessName";
this.tbBusinessName.ReadOnly = true;
this.tbBusinessName.Size = new System.Drawing.Size(97, 21);
this.tbBusinessName.TabIndex = 16;
//
// tbStringID
//
this.tbStringID.Dock = System.Windows.Forms.DockStyle.Fill;
this.tbStringID.Location = new System.Drawing.Point(78, 57);
this.tbStringID.Name = "tbStringID";
this.tbStringID.Size = new System.Drawing.Size(97, 21);
this.tbStringID.TabIndex = 18;
//
// tbDocType
//
this.tbDocType.Dock = System.Windows.Forms.DockStyle.Fill;
this.tbDocType.Location = new System.Drawing.Point(612, 30);
this.tbDocType.Name = "tbDocType";
this.tbDocType.Size = new System.Drawing.Size(99, 21);
this.tbDocType.TabIndex = 19;
//
// tbLevelNum
//
this.tbLevelNum.Dock = System.Windows.Forms.DockStyle.Fill;
this.tbLevelNum.Location = new System.Drawing.Point(256, 57);
this.tbLevelNum.Name = "tbLevelNum";
this.tbLevelNum.Size = new System.Drawing.Size(97, 21);
this.tbLevelNum.TabIndex = 20;
//
// tbIndex
//
this.tbIndex.Dock = System.Windows.Forms.DockStyle.Fill;
this.tbIndex.Location = new System.Drawing.Point(434, 57);
this.tbIndex.Name = "tbIndex";
this.tbIndex.Size = new System.Drawing.Size(97, 21);
this.tbIndex.TabIndex = 21;
//
// tbIcoIndex
//
this.tbIcoIndex.Dock = System.Windows.Forms.DockStyle.Fill;
this.tbIcoIndex.Location = new System.Drawing.Point(612, 57);
this.tbIcoIndex.Name = "tbIcoIndex";
this.tbIcoIndex.Size = new System.Drawing.Size(99, 21);
this.tbIcoIndex.TabIndex = 22;
//
// tbType
//
this.tbType.Dock = System.Windows.Forms.DockStyle.Fill;
this.tbType.Location = new System.Drawing.Point(78, 84);
this.tbType.Name = "tbType";
this.tbType.ReadOnly = true;
this.tbType.Size = new System.Drawing.Size(97, 21);
this.tbType.TabIndex = 23;
//
// tbProductBarCodeType
//
this.tbProductBarCodeType.Dock = System.Windows.Forms.DockStyle.Fill;
this.tbProductBarCodeType.Location = new System.Drawing.Point(256, 84);
this.tbProductBarCodeType.Name = "tbProductBarCodeType";
this.tbProductBarCodeType.ReadOnly = true;
this.tbProductBarCodeType.Size = new System.Drawing.Size(97, 21);
this.tbProductBarCodeType.TabIndex = 24;
//
// ckCanPassLevelReport
//
this.ckCanPassLevelReport.AutoSize = true;
this.ckCanPassLevelReport.Dock = System.Windows.Forms.DockStyle.Fill;
this.ckCanPassLevelReport.Enabled = false;
this.ckCanPassLevelReport.Location = new System.Drawing.Point(434, 84);
this.ckCanPassLevelReport.Name = "ckCanPassLevelReport";
this.ckCanPassLevelReport.Size = new System.Drawing.Size(97, 21);
this.ckCanPassLevelReport.TabIndex = 25;
this.ckCanPassLevelReport.UseVisualStyleBackColor = true;
//
// tbSysCode
//
this.tbSysCode.Dock = System.Windows.Forms.DockStyle.Fill;
this.tbSysCode.Location = new System.Drawing.Point(612, 84);
this.tbSysCode.Name = "tbSysCode";
this.tbSysCode.Size = new System.Drawing.Size(99, 21);
this.tbSysCode.TabIndex = 26;
//
// tbPrevID
//
this.tbPrevID.Dock = System.Windows.Forms.DockStyle.Fill;
this.tbPrevID.Location = new System.Drawing.Point(256, 30);
this.tbPrevID.Name = "tbPrevID";
this.tbPrevID.Size = new System.Drawing.Size(97, 21);
this.tbPrevID.TabIndex = 28;
//
// tsbSave
//
this.tsbSave.Image = global::Tools.Properties.Resources.保存;
this.tsbSave.ImageTransparentColor = System.Drawing.Color.Magenta;
this.tsbSave.Name = "tsbSave";
this.tsbSave.Size = new System.Drawing.Size(52, 22);
this.tsbSave.Text = "保存";
//
// wModuleManager
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(979, 566);
this.Controls.Add(this.splitContainer1);
this.Controls.Add(this.toolStrip1);
this.MinimumSize = new System.Drawing.Size(982, 605);
this.Name = "wModuleManager";
this.Text = "模块管理";
this.Load += new System.EventHandler(this.wModuleManager_Load);
this.toolStrip1.ResumeLayout(false);
this.toolStrip1.PerformLayout();
this.splitContainer1.Panel1.ResumeLayout(false);
this.splitContainer1.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
this.splitContainer1.ResumeLayout(false);
this.panelMHeader.ResumeLayout(false);
this.panelMHeader.PerformLayout();
this.tableLayoutPanel1.ResumeLayout(false);
this.tableLayoutPanel1.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.dgvDetail)).EndInit();
this.tsFuncInfo.ResumeLayout(false);
this.tsFuncInfo.PerformLayout();
this.tsBaseInfo.ResumeLayout(false);
this.tsBaseInfo.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.ToolStrip toolStrip1;
private System.Windows.Forms.SplitContainer splitContainer1;
private System.Windows.Forms.TreeView tvModules;
private System.Windows.Forms.Panel panelMHeader;
private System.Windows.Forms.ToolStripButton tsbAdd;
private System.Windows.Forms.ToolStripButton tsbCopy;
private System.Windows.Forms.ToolStripButton tsbDbSetting;
private System.Windows.Forms.ToolStripLabel tslDbLinkString;
private System.Windows.Forms.TextBox tbSearch;
private System.Windows.Forms.Label label13;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
private System.Windows.Forms.DataGridView dgvDetail;
private System.Windows.Forms.ToolStrip tsFuncInfo;
private System.Windows.Forms.ToolStripLabel toolStripLabel2;
private System.Windows.Forms.ToolStrip tsBaseInfo;
private System.Windows.Forms.ToolStripLabel toolStripLabel3;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.Label label8;
private System.Windows.Forms.Label label9;
private System.Windows.Forms.Label label10;
private System.Windows.Forms.Label label11;
private System.Windows.Forms.Label label12;
private System.Windows.Forms.TextBox tbName;
private System.Windows.Forms.TextBox tbBusinessName;
private System.Windows.Forms.TextBox tbStringID;
private System.Windows.Forms.TextBox tbDocType;
private System.Windows.Forms.TextBox tbLevelNum;
private System.Windows.Forms.TextBox tbIndex;
private System.Windows.Forms.TextBox tbIcoIndex;
private System.Windows.Forms.TextBox tbType;
private System.Windows.Forms.TextBox tbProductBarCodeType;
private System.Windows.Forms.CheckBox ckCanPassLevelReport;
private System.Windows.Forms.TextBox tbSysCode;
private System.Windows.Forms.TextBox tbPrevID;
private System.Windows.Forms.ToolStripButton tsbSave;
}
}
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
//
using Tools.MyCommon;
using Tools.MyUtils;
using Tools.MyData;
using System.Reflection;
namespace Tools.UI
{
public partial class wModuleManager : wEditBasic
{
public wModuleManager()
{
InitializeComponent();
}
private void wModuleManager_Load(object sender, EventArgs e)
{
this.tsbAdd.Click += TsbAdd_Click;
this.tsbCopy.Click += TsbCopy_Click;
this.tsbSave.Click += TsbSave_Click;
this.tsbDbSetting.Click += TsbDbSetting_Click;
}
public override void InitData()
{
base.InitData();
this.ModuleTableList = new List<TQuery> {
new TQuery("SysBusinessModel"),
new TQuery("SysFunction"),
};
this._ds = this._db.GetData(this.ModuleTableList, true);
}
public override void InitUI()
{
base.InitUI();
//绑定明细数据源
this.dgvDetail.AllowUserToAddRows = false;
this.dgvDetail.DataSource = this._ds.Tables["SysFunction"].DefaultView;
//初始化树形图
this.InitTreeView();
//模块查询
this.tbSearch.TextChanged += TbSearch_TextChanged;
}
#region 工具栏事件
private void TsbDbSetting_Click(object sender, EventArgs e)
{
var frm = new wDbSetting(this.tslDbLinkString);
if (frm.ShowDialog() == DialogResult.OK)
{
this.InitDBHelper(frm.LinkModel);
this.InitData();
this.InitUI();
}
}
private void TsbAdd_Click(object sender, EventArgs e)
{
Utils.Tip("功能正在开发中!");
}
private void TsbCopy_Click(object sender, EventArgs e)
{
Utils.Tip("功能正在开发中!");
}
private void TsbSave_Click(object sender, EventArgs e)
{
this.Save();
}
#endregion
#region 树结构处理
/// <summary>
/// 树形图-初始化
/// </summary>
/// <param name="tv"></param>
/// <param name="dt"></param>
private void InitTreeView()
{
//初始化树节点
this.AddTreeNode(this.tvModules.Nodes, "0");
//添加选择后事件
this.tvModules.AfterSelect += Tv_AfterSelect;
//默认展开设置
if (this.tvModules.Nodes.Count > 0)
{
this.tvModules.Nodes[0].Expand();
if (this.tvModules.Nodes[0].Nodes.Count > 0)
{
this.tvModules.Nodes[0].Nodes[0].ExpandAll();
}
}
//首次初始化,触发一下事件
if (this.tvModules.Nodes.Count > 0)
{
this.tvModules.SelectedNode = this.tvModules.Nodes[0]; //选中首节点
}
}
/// <summary>
/// 事件-树节点选择后
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void Tv_AfterSelect(object sender, TreeViewEventArgs e)
{
var ModelID = e.Node.Name;
var drv = this._ds.Tables["SysBusinessModel"].DefaultView
.Cast<DataRowView>()
.FirstOrDefault(r => r["ID"].ToString().Equals(ModelID));
if (drv != null)
{
//绑定基本信息
this.BindBaseInfo(drv);
//筛选明细:明细不需要重复绑定
this._ds.Tables["SysFunction"].DefaultView.RowFilter = $"ModelID = {ModelID}";
}
}
/// <summary>
/// 递归:添加树节点
/// </summary>
/// <param name="nodes"></param>
/// <param name="ParentValue"></param>
private void AddTreeNode(TreeNodeCollection nodes, string ParentValue)
{
DataRow[] rows = this._ds.Tables["SysBusinessModel"].Select($"ISNULL(PrevID, '0') = '{ParentValue}'");
if (rows.Length == 0)
return;
for (int i = 0; i < rows.Length; i++)
{
if (rows[i].RowState == DataRowState.Deleted)
continue;
var key = rows[i]["ID"].ToString();
var text = rows[i]["Name"].ToString();
nodes.Add(key, text, 0, 1);
this.AddTreeNode(nodes[i].Nodes, key);
}
}
#endregion
#region 查询功能相关
/// <summary>
/// (查询)文本改变事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void TbSearch_TextChanged(object sender, EventArgs e)
{
this.SetTreeNodeBackColor(this.tvModules.Nodes, this.tbSearch.Text.Trim());
}
/// <summary>
/// (查询)设置树节点背景色
/// </summary>
/// <param name="nodes">树节点</param>
/// <param name="SearchText">查询字串</param>
private void SetTreeNodeBackColor(TreeNodeCollection nodes, string SearchText)
{
foreach (TreeNode n in nodes)
{
//查询条件不为空并且包含查询字符,则设置背景色
bool IsSearched = !string.IsNullOrEmpty(SearchText) && n.Text.Contains(SearchText);
n.BackColor = IsSearched ? Color.LightBlue : Color.White;
#region 节点展开与折叠
if (IsSearched)
{
//如果父节点未展开,展开父节点
this.SetParentExpanded(n);
//如果当前节点不是叶子节点,则展开
if (n.Nodes.Count > 0)
n.Expand();
}
else if (n.Parent != null)
{
n.Collapse(); //非根节点,全部折叠
}
#endregion
//递归子节点
this.SetTreeNodeBackColor(n.Nodes, SearchText);
}
}
/// <summary>
/// 展开查询节点的父节点
/// </summary>
/// <param name="n"></param>
private void SetParentExpanded(TreeNode n)
{
while (n.Parent != null)
{
n = n.Parent;
if (!n.IsExpanded)
{
n.Expand();
}
}
}
#endregion
#region 数据绑定
/// <summary>
/// 绑定基本信息
/// </summary>
/// <param name="drv"></param>
private void BindBaseInfo(DataRowView drv)
{
foreach (Control c in this.tableLayoutPanel1.Controls)
{
if (c is TextBox)
{
this.Binding(c as TextBox, drv);
}
else if (c is CheckBox)
{
this.Binding(c as CheckBox, drv);
}
}
}
/// <summary>
/// 设置控件绑定信息
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="c"></param>
/// <param name="drv"></param>
private void Binding<T>(T c, DataRowView drv) where T : Control
{
//数据源是否包含该列
var field = c.Name.Substring(2); //去掉前缀
if (!drv.Row.Table.Columns.Contains(field))
return;
//布尔特殊处理
if (drv[field] == DBNull.Value && drv.Row.Table.Columns[field].DataType.Name.Equals("Boolean"))
drv[field] = false;
//设置绑定
var property = this.GetPropertyName(c);
c.DataBindings.Clear();
c.DataBindings.Add(property, drv, field);
}
/// <summary>
/// 获取绑定属性名称
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="c"></param>
/// <returns></returns>
private string GetPropertyName<T>(T c) where T : Control
{
var result = "";
if (c is TextBox)
result = "Text";
else if (c is CheckBox)
result = "Checked";
return result;
}
#endregion
}
}
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="toolStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="tsFuncInfo.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>408, 18</value>
</metadata>
<metadata name="tsBaseInfo.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>521, 18</value>
</metadata>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>41</value>
</metadata>
</root>
\ No newline at end of file
......@@ -32,21 +32,22 @@ namespace Tools
this.CreateModule(typeof(UI.wAuditDemo), "审批示例", "tr"),
this.CreateModule(typeof(UI.wImageSearch), "图片搜索", "tr"),
this.CreateModule(typeof(UI.wXmlGenerator), "XML生成器", "tr"),
this.CreateModule(typeof(UI.wModuleManager), "模块管理", "tr"),
};
}
/// <summary>
/// 生成模块信息
/// </summary>
/// <param name="frm">窗体对象</param>
/// <param name="frmType">窗体对象</param>
/// <param name="text">显示名称</param>
/// <param name="tip">提示信息</param>
/// <param name="imgPath">图片路径</param>
/// <returns></returns>
private ModuleInfo CreateModule(Type frm, string text, string tip = "")
private ModuleInfo CreateModule(Type frmType, string text, string tip = "")
{
return new ModuleInfo {
FrmView = frm,
ViewFormType = frmType,
Text = text,
ToolTipText = tip,
};
......
......@@ -42,7 +42,7 @@ namespace Tools
Text = m.Text,
ToolTipText = m.ToolTipText,
ImageIndex = 1,
Tag = m.FrmView,
Tag = m.ViewFormType,
});
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment