Commit 768a5e95 authored by 罗显健's avatar 罗显健

增加[功能模块管理]

parent 35866dfb
介绍:
维护系统各功能模块相关的表信息。
使用说明:
1、操作说明:[模块列表][表信息]表格右键増行/删行,[表信息]可下拉批量删除。
2、保存:保存配置信息模块以及表信息。如需删除模块,请先删除表并保存后再删除模块保存。
3、刷新:刷新配置信息和错误消息
......@@ -134,6 +134,12 @@
<Compile Include="UI\wMonitorVisit.Designer.cs">
<DependentUpon>wMonitorVisit.cs</DependentUpon>
</Compile>
<Compile Include="UI\wSysModule.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="UI\wSysModule.Designer.cs">
<DependentUpon>wSysModule.cs</DependentUpon>
</Compile>
<Compile Include="UI\wSysChecker.cs">
<SubType>Form</SubType>
</Compile>
......@@ -187,11 +193,15 @@
<EmbeddedResource Include="UI\wMonitorVisit.resx">
<DependentUpon>wMonitorVisit.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UI\wSysModule.resx">
<DependentUpon>wSysModule.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UI\wSysChecker.resx">
<DependentUpon>wSysChecker.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="wMain.resx">
<DependentUpon>wMain.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
......
......@@ -30,11 +30,23 @@
{
this.components = new System.ComponentModel.Container();
this.toolStrip1 = new System.Windows.Forms.ToolStrip();
this.toolStripDropDownButton1 = new System.Windows.Forms.ToolStripDropDownButton();
this.tsmiExportModel = new System.Windows.Forms.ToolStripMenuItem();
this.tsmiExportSql = new System.Windows.Forms.ToolStripMenuItem();
this.tsmiExportExcel = new System.Windows.Forms.ToolStripMenuItem();
this.tsmiExportWord = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator();
this.tsbLoadTable = new System.Windows.Forms.ToolStripButton();
this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
this.tsbTempSave = new System.Windows.Forms.ToolStripButton();
this.tsbResume = new System.Windows.Forms.ToolStripButton();
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
this.tsbDbLink = new System.Windows.Forms.ToolStripButton();
this.tstbDbLink = new System.Windows.Forms.ToolStripTextBox();
this.toolStripSeparator5 = new System.Windows.Forms.ToolStripSeparator();
this.tsbSysSetting = new System.Windows.Forms.ToolStripButton();
this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator();
this.tsbHelp = new System.Windows.Forms.ToolStripButton();
this.dgvData = new System.Windows.Forms.DataGridView();
this.Column1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column6 = new System.Windows.Forms.DataGridViewTextBoxColumn();
......@@ -51,18 +63,6 @@
this.label2 = new System.Windows.Forms.Label();
this.tbTableName = new System.Windows.Forms.TextBox();
this.tbTableDescription = new System.Windows.Forms.TextBox();
this.toolStripSeparator5 = new System.Windows.Forms.ToolStripSeparator();
this.toolStripDropDownButton1 = new System.Windows.Forms.ToolStripDropDownButton();
this.tsmiExportModel = new System.Windows.Forms.ToolStripMenuItem();
this.tsmiExportSql = new System.Windows.Forms.ToolStripMenuItem();
this.tsmiExportExcel = new System.Windows.Forms.ToolStripMenuItem();
this.tsmiExportWord = new System.Windows.Forms.ToolStripMenuItem();
this.tsbLoadTable = new System.Windows.Forms.ToolStripButton();
this.tsbTempSave = new System.Windows.Forms.ToolStripButton();
this.tsbResume = new System.Windows.Forms.ToolStripButton();
this.tsbDbLink = new System.Windows.Forms.ToolStripButton();
this.tsbSysSetting = new System.Windows.Forms.ToolStripButton();
this.tsbHelp = new System.Windows.Forms.ToolStripButton();
this.toolStrip1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dgvData)).BeginInit();
this.contextMenuStrip1.SuspendLayout();
......@@ -92,21 +92,94 @@
this.toolStrip1.TabIndex = 0;
this.toolStrip1.Text = "toolStrip1";
//
// toolStripDropDownButton1
//
this.toolStripDropDownButton1.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.tsmiExportModel,
this.tsmiExportSql,
this.tsmiExportExcel,
this.tsmiExportWord});
this.toolStripDropDownButton1.Image = global::Tools.Properties.Resources.导出;
this.toolStripDropDownButton1.ImageTransparentColor = System.Drawing.Color.Magenta;
this.toolStripDropDownButton1.Name = "toolStripDropDownButton1";
this.toolStripDropDownButton1.Size = new System.Drawing.Size(85, 21);
this.toolStripDropDownButton1.Text = "导出文件";
//
// tsmiExportModel
//
this.tsmiExportModel.Image = global::Tools.Properties.Resources.类;
this.tsmiExportModel.Name = "tsmiExportModel";
this.tsmiExportModel.Size = new System.Drawing.Size(123, 22);
this.tsmiExportModel.Text = "实体类";
//
// tsmiExportSql
//
this.tsmiExportSql.Image = global::Tools.Properties.Resources.sql;
this.tsmiExportSql.Name = "tsmiExportSql";
this.tsmiExportSql.Size = new System.Drawing.Size(123, 22);
this.tsmiExportSql.Text = "SQL文件";
//
// tsmiExportExcel
//
this.tsmiExportExcel.Image = global::Tools.Properties.Resources.excel;
this.tsmiExportExcel.Name = "tsmiExportExcel";
this.tsmiExportExcel.Size = new System.Drawing.Size(123, 22);
this.tsmiExportExcel.Text = "Excel";
//
// tsmiExportWord
//
this.tsmiExportWord.Image = global::Tools.Properties.Resources.word;
this.tsmiExportWord.Name = "tsmiExportWord";
this.tsmiExportWord.Size = new System.Drawing.Size(123, 22);
this.tsmiExportWord.Text = "Word";
//
// toolStripSeparator4
//
this.toolStripSeparator4.Name = "toolStripSeparator4";
this.toolStripSeparator4.Size = new System.Drawing.Size(6, 23);
//
// tsbLoadTable
//
this.tsbLoadTable.Image = global::Tools.Properties.Resources.加载;
this.tsbLoadTable.ImageTransparentColor = System.Drawing.Color.Magenta;
this.tsbLoadTable.Name = "tsbLoadTable";
this.tsbLoadTable.Size = new System.Drawing.Size(88, 21);
this.tsbLoadTable.Text = "加载表信息";
//
// toolStripSeparator2
//
this.toolStripSeparator2.Name = "toolStripSeparator2";
this.toolStripSeparator2.Size = new System.Drawing.Size(6, 23);
//
// tsbTempSave
//
this.tsbTempSave.Image = global::Tools.Properties.Resources.暂存;
this.tsbTempSave.ImageTransparentColor = System.Drawing.Color.Magenta;
this.tsbTempSave.Name = "tsbTempSave";
this.tsbTempSave.Size = new System.Drawing.Size(52, 21);
this.tsbTempSave.Text = "暂存";
//
// tsbResume
//
this.tsbResume.Image = global::Tools.Properties.Resources.恢复;
this.tsbResume.ImageTransparentColor = System.Drawing.Color.Magenta;
this.tsbResume.Name = "tsbResume";
this.tsbResume.Size = new System.Drawing.Size(76, 21);
this.tsbResume.Text = "恢复暂存";
//
// toolStripSeparator1
//
this.toolStripSeparator1.Name = "toolStripSeparator1";
this.toolStripSeparator1.Size = new System.Drawing.Size(6, 23);
//
// tsbDbLink
//
this.tsbDbLink.Image = global::Tools.Properties.Resources.数据库;
this.tsbDbLink.ImageTransparentColor = System.Drawing.Color.Magenta;
this.tsbDbLink.Name = "tsbDbLink";
this.tsbDbLink.Size = new System.Drawing.Size(88, 21);
this.tsbDbLink.Text = "数据库配置";
//
// tstbDbLink
//
this.tstbDbLink.Enabled = false;
......@@ -114,11 +187,32 @@
this.tstbDbLink.Name = "tstbDbLink";
this.tstbDbLink.Size = new System.Drawing.Size(100, 21);
//
// toolStripSeparator5
//
this.toolStripSeparator5.Name = "toolStripSeparator5";
this.toolStripSeparator5.Size = new System.Drawing.Size(6, 23);
//
// tsbSysSetting
//
this.tsbSysSetting.Image = global::Tools.Properties.Resources.设置;
this.tsbSysSetting.ImageTransparentColor = System.Drawing.Color.Magenta;
this.tsbSysSetting.Name = "tsbSysSetting";
this.tsbSysSetting.Size = new System.Drawing.Size(76, 21);
this.tsbSysSetting.Text = "系统配置";
//
// toolStripSeparator3
//
this.toolStripSeparator3.Name = "toolStripSeparator3";
this.toolStripSeparator3.Size = new System.Drawing.Size(6, 23);
//
// tsbHelp
//
this.tsbHelp.Image = global::Tools.Properties.Resources.使用说明;
this.tsbHelp.ImageTransparentColor = System.Drawing.Color.Magenta;
this.tsbHelp.Name = "tsbHelp";
this.tsbHelp.Size = new System.Drawing.Size(76, 21);
this.tsbHelp.Text = "使用说明";
//
// dgvData
//
this.dgvData.BackgroundColor = System.Drawing.SystemColors.Window;
......@@ -289,100 +383,6 @@
this.tbTableDescription.Size = new System.Drawing.Size(152, 23);
this.tbTableDescription.TabIndex = 5;
//
// toolStripSeparator5
//
this.toolStripSeparator5.Name = "toolStripSeparator5";
this.toolStripSeparator5.Size = new System.Drawing.Size(6, 23);
//
// toolStripDropDownButton1
//
this.toolStripDropDownButton1.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.tsmiExportModel,
this.tsmiExportSql,
this.tsmiExportExcel,
this.tsmiExportWord});
this.toolStripDropDownButton1.Image = global::Tools.Properties.Resources.导出;
this.toolStripDropDownButton1.ImageTransparentColor = System.Drawing.Color.Magenta;
this.toolStripDropDownButton1.Name = "toolStripDropDownButton1";
this.toolStripDropDownButton1.Size = new System.Drawing.Size(85, 21);
this.toolStripDropDownButton1.Text = "导出文件";
//
// tsmiExportModel
//
this.tsmiExportModel.Image = global::Tools.Properties.Resources.类;
this.tsmiExportModel.Name = "tsmiExportModel";
this.tsmiExportModel.Size = new System.Drawing.Size(123, 22);
this.tsmiExportModel.Text = "实体类";
//
// tsmiExportSql
//
this.tsmiExportSql.Image = global::Tools.Properties.Resources.sql;
this.tsmiExportSql.Name = "tsmiExportSql";
this.tsmiExportSql.Size = new System.Drawing.Size(123, 22);
this.tsmiExportSql.Text = "SQL文件";
//
// tsmiExportExcel
//
this.tsmiExportExcel.Image = global::Tools.Properties.Resources.excel;
this.tsmiExportExcel.Name = "tsmiExportExcel";
this.tsmiExportExcel.Size = new System.Drawing.Size(123, 22);
this.tsmiExportExcel.Text = "Excel";
//
// tsmiExportWord
//
this.tsmiExportWord.Image = global::Tools.Properties.Resources.word;
this.tsmiExportWord.Name = "tsmiExportWord";
this.tsmiExportWord.Size = new System.Drawing.Size(123, 22);
this.tsmiExportWord.Text = "Word";
//
// tsbLoadTable
//
this.tsbLoadTable.Image = global::Tools.Properties.Resources.加载;
this.tsbLoadTable.ImageTransparentColor = System.Drawing.Color.Magenta;
this.tsbLoadTable.Name = "tsbLoadTable";
this.tsbLoadTable.Size = new System.Drawing.Size(88, 21);
this.tsbLoadTable.Text = "加载表信息";
//
// tsbTempSave
//
this.tsbTempSave.Image = global::Tools.Properties.Resources.暂存;
this.tsbTempSave.ImageTransparentColor = System.Drawing.Color.Magenta;
this.tsbTempSave.Name = "tsbTempSave";
this.tsbTempSave.Size = new System.Drawing.Size(52, 21);
this.tsbTempSave.Text = "暂存";
//
// tsbResume
//
this.tsbResume.Image = global::Tools.Properties.Resources.恢复;
this.tsbResume.ImageTransparentColor = System.Drawing.Color.Magenta;
this.tsbResume.Name = "tsbResume";
this.tsbResume.Size = new System.Drawing.Size(76, 21);
this.tsbResume.Text = "恢复暂存";
//
// tsbDbLink
//
this.tsbDbLink.Image = global::Tools.Properties.Resources.数据库;
this.tsbDbLink.ImageTransparentColor = System.Drawing.Color.Magenta;
this.tsbDbLink.Name = "tsbDbLink";
this.tsbDbLink.Size = new System.Drawing.Size(88, 21);
this.tsbDbLink.Text = "数据库配置";
//
// tsbSysSetting
//
this.tsbSysSetting.Image = global::Tools.Properties.Resources.设置;
this.tsbSysSetting.ImageTransparentColor = System.Drawing.Color.Magenta;
this.tsbSysSetting.Name = "tsbSysSetting";
this.tsbSysSetting.Size = new System.Drawing.Size(76, 21);
this.tsbSysSetting.Text = "系统配置";
//
// tsbHelp
//
this.tsbHelp.Image = global::Tools.Properties.Resources.使用说明;
this.tsbHelp.ImageTransparentColor = System.Drawing.Color.Magenta;
this.tsbHelp.Name = "tsbHelp";
this.tsbHelp.Size = new System.Drawing.Size(76, 21);
this.tsbHelp.Text = "使用说明";
//
// wDBTools
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F);
......
namespace Tools.UI
{
partial class wSysModule
{
/// <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.components = new System.ComponentModel.Container();
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.dgvModule = new System.Windows.Forms.DataGridView();
this.Column3 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column4 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.contextMenu1 = new System.Windows.Forms.ContextMenuStrip(this.components);
this.tsmiAddRow = new System.Windows.Forms.ToolStripMenuItem();
this.tsmiDelRow = new System.Windows.Forms.ToolStripMenuItem();
this.panel1 = new System.Windows.Forms.Panel();
this.label1 = new System.Windows.Forms.Label();
this.splitContainer2 = new System.Windows.Forms.SplitContainer();
this.dgvModuleTable = new System.Windows.Forms.DataGridView();
this.Id = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.ModuleId = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column10 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column11 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column12 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.panel2 = new System.Windows.Forms.Panel();
this.label2 = new System.Windows.Forms.Label();
this.dgvTableColumn = new System.Windows.Forms.DataGridView();
this.序号 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.列名 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.数据类型 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.主键 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.唯一标识 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.索引 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.允许空 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.默认值 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.说明 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.panel4 = new System.Windows.Forms.Panel();
this.label4 = new System.Windows.Forms.Label();
this.toolStrip1 = new System.Windows.Forms.ToolStrip();
this.tsbSave = new System.Windows.Forms.ToolStripButton();
this.tsbRefresh = new System.Windows.Forms.ToolStripButton();
this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
this.tsbDB = new System.Windows.Forms.ToolStripButton();
this.tstbLinkString = new System.Windows.Forms.ToolStripTextBox();
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
this.tsbHelp = new System.Windows.Forms.ToolStripButton();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
this.splitContainer1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dgvModule)).BeginInit();
this.contextMenu1.SuspendLayout();
this.panel1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).BeginInit();
this.splitContainer2.Panel1.SuspendLayout();
this.splitContainer2.Panel2.SuspendLayout();
this.splitContainer2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dgvModuleTable)).BeginInit();
this.panel2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dgvTableColumn)).BeginInit();
this.panel4.SuspendLayout();
this.toolStrip1.SuspendLayout();
this.SuspendLayout();
//
// splitContainer1
//
this.splitContainer1.BackColor = System.Drawing.Color.ForestGreen;
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.dgvModule);
this.splitContainer1.Panel1.Controls.Add(this.panel1);
//
// splitContainer1.Panel2
//
this.splitContainer1.Panel2.BackColor = System.Drawing.SystemColors.Control;
this.splitContainer1.Panel2.Controls.Add(this.splitContainer2);
this.splitContainer1.Size = new System.Drawing.Size(1169, 551);
this.splitContainer1.SplitterDistance = 317;
this.splitContainer1.SplitterWidth = 6;
this.splitContainer1.TabIndex = 0;
//
// dgvModule
//
this.dgvModule.BackgroundColor = System.Drawing.SystemColors.Window;
this.dgvModule.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dgvModule.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.Column3,
this.Column1,
this.Column4,
this.Column2});
this.dgvModule.ContextMenuStrip = this.contextMenu1;
this.dgvModule.Dock = System.Windows.Forms.DockStyle.Fill;
this.dgvModule.Location = new System.Drawing.Point(0, 35);
this.dgvModule.Name = "dgvModule";
this.dgvModule.RowTemplate.Height = 23;
this.dgvModule.Size = new System.Drawing.Size(317, 516);
this.dgvModule.TabIndex = 1;
//
// Column3
//
this.Column3.DataPropertyName = "Id";
this.Column3.HeaderText = "模块ID";
this.Column3.Name = "Column3";
this.Column3.Visible = false;
//
// Column1
//
this.Column1.DataPropertyName = "Name";
this.Column1.HeaderText = "模块名称";
this.Column1.Name = "Column1";
this.Column1.Width = 137;
//
// Column4
//
this.Column4.DataPropertyName = "PreModuleId";
this.Column4.HeaderText = "父级模块";
this.Column4.Name = "Column4";
this.Column4.Visible = false;
//
// Column2
//
this.Column2.DataPropertyName = "Description";
this.Column2.HeaderText = "描述";
this.Column2.Name = "Column2";
this.Column2.Width = 137;
//
// contextMenu1
//
this.contextMenu1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.tsmiAddRow,
this.tsmiDelRow});
this.contextMenu1.Name = "cms1";
this.contextMenu1.Size = new System.Drawing.Size(101, 48);
//
// tsmiAddRow
//
this.tsmiAddRow.Name = "tsmiAddRow";
this.tsmiAddRow.Size = new System.Drawing.Size(100, 22);
this.tsmiAddRow.Text = "増行";
//
// tsmiDelRow
//
this.tsmiDelRow.Name = "tsmiDelRow";
this.tsmiDelRow.Size = new System.Drawing.Size(100, 22);
this.tsmiDelRow.Text = "删行";
//
// panel1
//
this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.panel1.Controls.Add(this.label1);
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(317, 35);
this.panel1.TabIndex = 0;
//
// label1
//
this.label1.Dock = System.Windows.Forms.DockStyle.Left;
this.label1.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label1.Location = new System.Drawing.Point(0, 0);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(121, 33);
this.label1.TabIndex = 0;
this.label1.Text = "模块列表";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// splitContainer2
//
this.splitContainer2.BackColor = System.Drawing.Color.ForestGreen;
this.splitContainer2.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer2.Location = new System.Drawing.Point(0, 0);
this.splitContainer2.Name = "splitContainer2";
this.splitContainer2.Orientation = System.Windows.Forms.Orientation.Horizontal;
//
// splitContainer2.Panel1
//
this.splitContainer2.Panel1.BackColor = System.Drawing.SystemColors.Control;
this.splitContainer2.Panel1.Controls.Add(this.dgvModuleTable);
this.splitContainer2.Panel1.Controls.Add(this.panel2);
//
// splitContainer2.Panel2
//
this.splitContainer2.Panel2.BackColor = System.Drawing.SystemColors.Control;
this.splitContainer2.Panel2.Controls.Add(this.dgvTableColumn);
this.splitContainer2.Panel2.Controls.Add(this.panel4);
this.splitContainer2.Size = new System.Drawing.Size(846, 551);
this.splitContainer2.SplitterDistance = 191;
this.splitContainer2.SplitterWidth = 6;
this.splitContainer2.TabIndex = 2;
//
// dgvModuleTable
//
this.dgvModuleTable.BackgroundColor = System.Drawing.SystemColors.Window;
this.dgvModuleTable.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dgvModuleTable.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.Id,
this.ModuleId,
this.Column10,
this.Column11,
this.Column12});
this.dgvModuleTable.ContextMenuStrip = this.contextMenu1;
this.dgvModuleTable.Dock = System.Windows.Forms.DockStyle.Fill;
this.dgvModuleTable.Location = new System.Drawing.Point(0, 35);
this.dgvModuleTable.Name = "dgvModuleTable";
this.dgvModuleTable.RowTemplate.Height = 23;
this.dgvModuleTable.Size = new System.Drawing.Size(846, 156);
this.dgvModuleTable.TabIndex = 1;
//
// Id
//
this.Id.DataPropertyName = "Id";
this.Id.HeaderText = "Id";
this.Id.Name = "Id";
this.Id.ReadOnly = true;
this.Id.Visible = false;
//
// ModuleId
//
this.ModuleId.DataPropertyName = "ModuleId";
this.ModuleId.HeaderText = "ModuleId";
this.ModuleId.Name = "ModuleId";
this.ModuleId.ReadOnly = true;
this.ModuleId.Visible = false;
//
// Column10
//
this.Column10.DataPropertyName = "TableName";
this.Column10.HeaderText = "表名";
this.Column10.Name = "Column10";
this.Column10.Width = 150;
//
// Column11
//
this.Column11.DataPropertyName = "ParentTableName";
this.Column11.HeaderText = "父级表";
this.Column11.Name = "Column11";
this.Column11.ToolTipText = "对于有多个外键的,取第一个即可";
this.Column11.Width = 150;
//
// Column12
//
this.Column12.DataPropertyName = "Description";
this.Column12.HeaderText = "描述";
this.Column12.Name = "Column12";
this.Column12.Width = 300;
//
// panel2
//
this.panel2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.panel2.Controls.Add(this.label2);
this.panel2.Dock = System.Windows.Forms.DockStyle.Top;
this.panel2.Location = new System.Drawing.Point(0, 0);
this.panel2.Name = "panel2";
this.panel2.Size = new System.Drawing.Size(846, 35);
this.panel2.TabIndex = 2;
//
// label2
//
this.label2.Dock = System.Windows.Forms.DockStyle.Left;
this.label2.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label2.Location = new System.Drawing.Point(0, 0);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(121, 33);
this.label2.TabIndex = 0;
this.label2.Text = "表信息";
this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// dgvTableColumn
//
this.dgvTableColumn.AllowUserToAddRows = false;
this.dgvTableColumn.AllowUserToDeleteRows = false;
this.dgvTableColumn.BackgroundColor = System.Drawing.SystemColors.Window;
this.dgvTableColumn.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dgvTableColumn.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.序号,
this.列名,
this.数据类型,
this.主键,
this.唯一标识,
this.索引,
this.允许空,
this.默认值,
this.说明});
this.dgvTableColumn.Dock = System.Windows.Forms.DockStyle.Fill;
this.dgvTableColumn.Location = new System.Drawing.Point(0, 35);
this.dgvTableColumn.Name = "dgvTableColumn";
this.dgvTableColumn.ReadOnly = true;
this.dgvTableColumn.RowTemplate.Height = 23;
this.dgvTableColumn.Size = new System.Drawing.Size(846, 319);
this.dgvTableColumn.TabIndex = 1;
//
// 序号
//
this.序号.DataPropertyName = "序号";
this.序号.HeaderText = "序号";
this.序号.Name = "序号";
this.序号.ReadOnly = true;
this.序号.Width = 60;
//
// 列名
//
this.列名.DataPropertyName = "列名";
this.列名.HeaderText = "列名";
this.列名.Name = "列名";
this.列名.ReadOnly = true;
this.列名.Width = 150;
//
// 数据类型
//
this.数据类型.DataPropertyName = "数据类型";
this.数据类型.HeaderText = "数据类型";
this.数据类型.Name = "数据类型";
this.数据类型.ReadOnly = true;
this.数据类型.Width = 120;
//
// 主键
//
this.主键.DataPropertyName = "主键";
this.主键.HeaderText = "主键";
this.主键.Name = "主键";
this.主键.ReadOnly = true;
this.主键.Width = 60;
//
// 唯一标识
//
this.唯一标识.DataPropertyName = "唯一标识";
this.唯一标识.HeaderText = "唯一标识";
this.唯一标识.Name = "唯一标识";
this.唯一标识.ReadOnly = true;
this.唯一标识.Width = 80;
//
// 索引
//
this.索引.DataPropertyName = "索引";
this.索引.HeaderText = "索引";
this.索引.Name = "索引";
this.索引.ReadOnly = true;
this.索引.Width = 60;
//
// 允许空
//
this.允许空.DataPropertyName = "允许空";
this.允许空.HeaderText = "允许空";
this.允许空.Name = "允许空";
this.允许空.ReadOnly = true;
this.允许空.Width = 70;
//
// 默认值
//
this.默认值.DataPropertyName = "默认值";
this.默认值.HeaderText = "默认值";
this.默认值.Name = "默认值";
this.默认值.ReadOnly = true;
//
// 说明
//
this.说明.DataPropertyName = "说明";
this.说明.HeaderText = "说明";
this.说明.Name = "说明";
this.说明.ReadOnly = true;
this.说明.Width = 150;
//
// panel4
//
this.panel4.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.panel4.Controls.Add(this.label4);
this.panel4.Dock = System.Windows.Forms.DockStyle.Top;
this.panel4.Location = new System.Drawing.Point(0, 0);
this.panel4.Name = "panel4";
this.panel4.Size = new System.Drawing.Size(846, 35);
this.panel4.TabIndex = 2;
//
// label4
//
this.label4.Dock = System.Windows.Forms.DockStyle.Left;
this.label4.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label4.Location = new System.Drawing.Point(0, 0);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(121, 33);
this.label4.TabIndex = 0;
this.label4.Text = "列信息";
this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// toolStrip1
//
this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.tsbSave,
this.tsbRefresh,
this.toolStripSeparator2,
this.tsbDB,
this.tstbLinkString,
this.toolStripSeparator1,
this.tsbHelp});
this.toolStrip1.Location = new System.Drawing.Point(0, 0);
this.toolStrip1.Name = "toolStrip1";
this.toolStrip1.Size = new System.Drawing.Size(1169, 25);
this.toolStrip1.TabIndex = 1;
this.toolStrip1.Text = "toolStrip1";
//
// 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 = "保存";
//
// tsbRefresh
//
this.tsbRefresh.Image = global::Tools.Properties.Resources.更新;
this.tsbRefresh.ImageTransparentColor = System.Drawing.Color.Magenta;
this.tsbRefresh.Name = "tsbRefresh";
this.tsbRefresh.Size = new System.Drawing.Size(52, 22);
this.tsbRefresh.Text = "刷新";
//
// toolStripSeparator2
//
this.toolStripSeparator2.Name = "toolStripSeparator2";
this.toolStripSeparator2.Size = new System.Drawing.Size(6, 25);
//
// tsbDB
//
this.tsbDB.Image = global::Tools.Properties.Resources.数据库;
this.tsbDB.ImageTransparentColor = System.Drawing.Color.Magenta;
this.tsbDB.Name = "tsbDB";
this.tsbDB.Size = new System.Drawing.Size(64, 22);
this.tsbDB.Text = "数据库";
//
// tstbLinkString
//
this.tstbLinkString.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F);
this.tstbLinkString.ForeColor = System.Drawing.Color.Green;
this.tstbLinkString.Name = "tstbLinkString";
this.tstbLinkString.ReadOnly = true;
this.tstbLinkString.Size = new System.Drawing.Size(150, 25);
//
// toolStripSeparator1
//
this.toolStripSeparator1.Name = "toolStripSeparator1";
this.toolStripSeparator1.Size = new System.Drawing.Size(6, 25);
//
// tsbHelp
//
this.tsbHelp.Image = global::Tools.Properties.Resources.使用说明;
this.tsbHelp.ImageTransparentColor = System.Drawing.Color.Magenta;
this.tsbHelp.Name = "tsbHelp";
this.tsbHelp.Size = new System.Drawing.Size(76, 22);
this.tsbHelp.Text = "使用说明";
//
// wSysModule
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1169, 576);
this.Controls.Add(this.splitContainer1);
this.Controls.Add(this.toolStrip1);
this.Name = "wSysModule";
this.Text = "模块管理";
this.Load += new System.EventHandler(this.wSysChecker_Load);
this.splitContainer1.Panel1.ResumeLayout(false);
this.splitContainer1.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
this.splitContainer1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.dgvModule)).EndInit();
this.contextMenu1.ResumeLayout(false);
this.panel1.ResumeLayout(false);
this.splitContainer2.Panel1.ResumeLayout(false);
this.splitContainer2.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).EndInit();
this.splitContainer2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.dgvModuleTable)).EndInit();
this.panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.dgvTableColumn)).EndInit();
this.panel4.ResumeLayout(false);
this.toolStrip1.ResumeLayout(false);
this.toolStrip1.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.SplitContainer splitContainer1;
private System.Windows.Forms.ToolStrip toolStrip1;
private System.Windows.Forms.ToolStripButton tsbSave;
private System.Windows.Forms.ToolStripButton tsbRefresh;
private System.Windows.Forms.ToolStripButton tsbHelp;
private System.Windows.Forms.DataGridView dgvModule;
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.DataGridView dgvModuleTable;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.ContextMenuStrip contextMenu1;
private System.Windows.Forms.ToolStripMenuItem tsmiAddRow;
private System.Windows.Forms.ToolStripMenuItem tsmiDelRow;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator2;
private System.Windows.Forms.ToolStripButton tsbDB;
private System.Windows.Forms.ToolStripTextBox tstbLinkString;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
private System.Windows.Forms.Panel panel2;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.DataGridViewTextBoxColumn Id;
private System.Windows.Forms.DataGridViewTextBoxColumn ModuleId;
private System.Windows.Forms.DataGridViewTextBoxColumn Column10;
private System.Windows.Forms.DataGridViewTextBoxColumn Column11;
private System.Windows.Forms.DataGridViewTextBoxColumn Column12;
private System.Windows.Forms.SplitContainer splitContainer2;
private System.Windows.Forms.DataGridView dgvTableColumn;
private System.Windows.Forms.Panel panel4;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.DataGridViewTextBoxColumn 序号;
private System.Windows.Forms.DataGridViewTextBoxColumn 列名;
private System.Windows.Forms.DataGridViewTextBoxColumn 数据类型;
private System.Windows.Forms.DataGridViewTextBoxColumn 主键;
private System.Windows.Forms.DataGridViewTextBoxColumn 唯一标识;
private System.Windows.Forms.DataGridViewTextBoxColumn 索引;
private System.Windows.Forms.DataGridViewTextBoxColumn 允许空;
private System.Windows.Forms.DataGridViewTextBoxColumn 默认值;
private System.Windows.Forms.DataGridViewTextBoxColumn 说明;
private System.Windows.Forms.DataGridViewTextBoxColumn Column3;
private System.Windows.Forms.DataGridViewTextBoxColumn Column1;
private System.Windows.Forms.DataGridViewTextBoxColumn Column4;
private System.Windows.Forms.DataGridViewTextBoxColumn Column2;
}
}
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
//
using Tools.MyCommon;
using Tools.MyData;
using Tools.MyUtils;
namespace Tools.UI
{
/// <summary>
/// 功能模块管理:维护功能模块与表的对应关系
/// </summary>
public partial class wSysModule : wEditBasic
{
DataTable _dtModuleTable = null;
bool _IsFirstLoad = true;
List<TQuery> tableList = null;
/// <summary>
/// 模块
/// </summary>
private string T_Module => "Sys_Module";
/// <summary>
/// 模块-表
/// </summary>
private string T_ModuleTable => "Sys_ModuleTable";
/// <summary>
/// 上下文菜单-源控件名称
/// </summary>
private string SrcCtrlName => this.contextMenu1.SourceControl.Name;
public wSysModule()
{
InitializeComponent();
dgvModule.MultiSelect = false; // 模块禁止多选,要删除只能挨个删除
dgvModuleTable.MultiSelect = true;// 明细表允许多选删除
}
private void wSysChecker_Load(object sender, EventArgs e)
{
this.SetConfig();
this.InitData();
this.InitUI();
this._IsFirstLoad = false;
}
public override void InitData()
{
//第一次不加载
if (this._IsFirstLoad) return;
//获取数据
if (this._db == null)
{
Utils.Tip("请先选择目标数据库!");
return;
}
try
{
tableList = new List<TQuery> {
new TQuery(this.T_Module, $"select * from {this.T_Module}") ,
new TQuery(this.T_ModuleTable, $"select * from {this.T_ModuleTable}")
};
this._ds = this._db.GetData(tableList, true);
}
catch (Exception ex)
{
Utils.Tip($"获取数据出错:\r\n{ex.Message}");
return;
}
//设置数据源;子表格在父表格之前绑定,可以更好的利用父表格绑定时出发的行改变事件,进行子表格的数据的过滤
this.dgvModuleTable.DataSource = this._dtModuleTable = this._ds.Tables[this.T_ModuleTable];
this.dgvModule.DataSource = this._ds.Tables[this.T_Module];
}
public override void InitUI()
{
//初始化数据表格
this.InitGridView(this.dgvModule);
this.InitGridView(this.dgvModuleTable);
this.InitGridView(this.dgvTableColumn);
//工具栏-事件
this.tsbSave.Click += TsbSave_Click;
this.tsbRefresh.Click += TsbRefresh_Click;
this.tsbDB.Click += TsbDB_Click;
this.tsbHelp.Click += TsbHelp_Click;
//数据表格-事件
dgvModule.SelectionChanged += DgvModule_SelectionChanged;
dgvModule.DataError += DgvModule_DataError;
dgvModuleTable.SelectionChanged += DgvModuleTable_SelectionChanged;
dgvModuleTable.DataError += DgvModuleTable_DataError;
//上下文菜单-事件
this.tsmiAddRow.Click += TsmiAddRow_Click;
this.tsmiDelRow.Click += TsmiDelRow_Click;
}
public override bool Save()
{
//结束编辑
this.EndEdit();
//保存配置信息
bool b = false;
if (this._ds.HasChanges())
{
b = this._db.SaveData(this._ds, this.tableList);
}
return b;
}
/// <summary>
/// 设置配置信息
/// </summary>
private void SetConfig()
{
//读取配置信息
var dtSetting = new DataTable("AppSetting");
dtSetting.ReadXml(Utils.SysConfigFilePath);
var dicConfig = dtSetting.Rows.Cast<DataRow>().ToDictionary(x => x["Name"].ToString(), x => x["Value"].ToString());
//初始化数据库链接
var link = dicConfig["DefaultLink"];
if (!string.IsNullOrEmpty(link))
{
this.tstbLinkString.Text = Utils.GetDbItemModel(link).ToString();
this.InitDBHelper(link); //初始化数据访问对象
}
}
#region 工具栏-事件
private void TsbSave_Click(object sender, EventArgs e)
{
if (!this.CheckDataSource())
return;
try
{
this.Save();
Utils.Tip($"保存成功!");
}
catch (Exception ex)
{
Utils.Tip($"保存失败!\r\n{ex.Message}\r\n{ex.StackTrace}");
return;
}
}
private void TsbRefresh_Click(object sender, EventArgs e)
{
this.InitData();
}
private void TsbDB_Click(object sender, EventArgs e)
{
//数据库
var frm = new wDbSetting(this.tstbLinkString);
if (frm.ShowDialog() == DialogResult.OK)
{
//初始化数据访问对象
this.InitDBHelper(frm.LinkModel);
//刷新界面
this.TsbRefresh_Click(null, null);
}
}
private void TsbHelp_Click(object sender, EventArgs e)
{
Utils.ShowHelp("sysmodule");
}
#endregion
#region 数据表格-事件
/// <summary>
/// 选中行改变事件,需配合 SelectionMode = DataGridViewSelectionMode.FullRowSelect.
/// RowEnter 会触发多次
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void DgvModule_SelectionChanged(object sender, EventArgs e)
{
var selectRows = dgvModule.SelectedRows;
if (selectRows.Count == 1)
{
var rowIndex = selectRows[0].Index;
var moduleId = this._ds.Tables[this.T_Module].DefaultView[rowIndex]["Id"];
if (this._dtModuleTable != null) this._dtModuleTable.DefaultView.RowFilter = $"ModuleId = '{moduleId}'";
}
}
/// <summary>
/// 选中行改变事件,需配合 SelectionMode = DataGridViewSelectionMode.FullRowSelect.
/// RowEnter 会触发多次
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void DgvModuleTable_SelectionChanged(object sender, EventArgs e)
{
var selectRows = dgvModuleTable.SelectedRows;
if (selectRows.Count == 1)
{
var rowIndex = selectRows[0].Index;
var tabName = this._ds.Tables[this.T_ModuleTable].DefaultView[rowIndex]["TableName"].ToString();
dgvTableColumn.DataSource = GetTableColumnFromSystem(tabName);
}
else if (selectRows.Count == 0) // 在模块未维护表信息的时候,列信息需刷新
{
dgvTableColumn.DataSource = GetTableColumnFromSystem("");
}
}
private DataTable GetTableColumnFromSystem(string tabName)
{
var sqlTableColun = $@"Select 序号, 列名, 数据类型, 主键, 唯一标识, 索引, 允许空, 默认值, 说明
From
(Select d.name As 表名, a.colid As '序号', a.name As '列名',
Case When b.name In ('varchar', 'nvarchar', 'varbinary', 'decimal', 'numeric') Then
b.name + '(' + Cast(IsNull(Case b.name When 'int' Then Null When 'text' Then Null When 'datetime' Then Null Else ColumnProperty(a.id, a.name, 'PRECISION')End, '') As Varchar(5))
+ Case When b.name In ('decimal', 'numeric') Then ',' + Cast(ColumnProperty(a.id, a.name, 'Scale') As Varchar(5))Else '' End + ')' Else b.name End As '数据类型', Case ix.is_primary_key When 1 Then '√' Else '' End As '主键',
Case ix.is_unique When 1 Then '√' Else '' End As '唯一标识', Case When ix.name Is Null Then '' Else '√' End As '索引', (Case When a.isnullable = 1 Then '√' Else '' End) As '允许空',
Case When e.text Is Null Then ''
When Left(e.text, 2) = '((' Then Substring(e.text, 3, Len(e.text) - 4)
When Left(e.text, 1) = '(' Then Substring(e.text, 2, Len(e.text) - 2)Else e.text End As '默认值', Case ix.is_primary_key When 1 Then '自增主键' Else IsNull(f.value, '')End As '说明'
From sys.syscolumns a
Left Join sys.types b On a.xtype = b.user_type_id
Inner Join sys.sysobjects d On a.id = d.id And d.xtype = 'U' And d.name != 'dtproperties'
Left Join sys.syscomments e On a.cdefault = e.id
Left Join sys.extended_properties f On f.major_id = d.id And f.minor_id = a.colid
Left Join sys.extended_properties ft On ft.major_id = d.id And ft.minor_id = 0
Left Join sys.index_columns ixc On ixc.object_id = a.id And ixc.column_id = a.colid
Left Join sys.indexes ix On ix.object_id = ixc.object_id And ix.index_id = ixc.index_id) t
Where 表名 = '{tabName}'
Order By
表名, 序号;";
return _db.GetDataTable(sqlTableColun, "TableColumn");
}
// 必填列未填写时会报错,需要处理
private void DgvModuleTable_DataError(object sender, DataGridViewDataErrorEventArgs e)
{
MessageBox.Show(e.Exception.Message);
}
private void DgvModule_DataError(object sender, DataGridViewDataErrorEventArgs e)
{
MessageBox.Show(e.Exception.Message);
}
#endregion
#region 上下文菜单-事件
private void TsmiAddRow_Click(object sender, EventArgs e)
{
if (!this.CheckDataSource())
return;
//
if (this.SrcCtrlName == this.dgvModule.Name)
{
this.AddRow(this.T_Module);
}
else if (this.SrcCtrlName == this.dgvModuleTable.Name)
{
this.AddRow(this.T_ModuleTable);
}
}
private void TsmiDelRow_Click(object sender, EventArgs e)
{
if (!this.CheckDataSource())
return;
//
if (this.SrcCtrlName == this.dgvModule.Name)
{
this.DelCurrentRow(this.T_Module, this.dgvModule);
}
else if (this.SrcCtrlName == this.dgvModuleTable.Name)
{
this.DelCurrentRow(this.T_ModuleTable, this.dgvModuleTable);
}
}
/// <summary>
/// 増行
/// </summary>
/// <param name="tableName"></param>
private void AddRow(string tableName)
{
if (!this._ds.Tables.Contains(tableName))
return;
//
var dt = this._ds.Tables[tableName];
dt.Rows.Add(dt.GetNewRow());
}
/// <summary>
/// 删行
/// </summary>
/// <param name="tableName"></param>
/// <param name="rowIndex"></param>
private void DelCurrentRow(string tableName, DataGridView dgv)
{
if (!this._ds.Tables.Contains(tableName) || dgv.CurrentRow == null)
return;
//
var dt = this._ds.Tables[tableName];
var rowIndex = dgv.CurrentRow.Index;
if (rowIndex >= 0 && rowIndex < dt.DefaultView.Count)
{
dt.DefaultView[rowIndex].Delete();
}
}
#endregion
/// <summary>
/// 初始化数据表格
/// </summary>
/// <param name="dgv"></param>
private void InitGridView(DataGridView dgv)
{
dgv.AllowUserToAddRows = false;
dgv.AutoGenerateColumns = false;
dgv.RowHeadersVisible = false;
dgv.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
}
/// <summary>
/// 检查数据源
/// </summary>
/// <returns></returns>
private bool CheckDataSource()
{
var result = true;
if (this._ds == null || this._dtModuleTable == null)
{
Utils.Tip("数据源为空,请刷新试试!");
result = false;
}
return result;
}
/// <summary>
/// 结束编辑
/// </summary>
/// <param name="ds"></param>
private void EndEdit()
{
if (this._ds == null)
return;
//数据表格界面提交
this.dgvModule.CommitEdit(DataGridViewDataErrorContexts.Display);
this.dgvModuleTable.CommitEdit(DataGridViewDataErrorContexts.Display);
//数据源结束编辑
foreach (DataTable dt in this._ds.Tables)
{
foreach (DataRow r in dt.Rows)
{
if (r.RowState != DataRowState.Deleted && r.RowState != DataRowState.Detached)
{
r.EndEdit();
}
}
}
}
}
}
<?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="Column3.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column4.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column2.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="contextMenu1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>127, 17</value>
</metadata>
<metadata name="Id.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="ModuleId.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column10.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column11.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column12.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="序号.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="列名.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="数据类型.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="主键.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="唯一标识.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="索引.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="允许空.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="默认值.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="说明.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="toolStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>
\ No newline at end of file
......@@ -27,6 +27,7 @@ namespace Tools
this.CreateModule(typeof(UI.wSysChecker), "系统检查配置工具"),
this.CreateModule(typeof(UI.wMonitorVisit), "APP模块访问监控"),
this.CreateModule(typeof(UI.wAppModel), "APP模块管理"),
this.CreateModule(typeof(UI.wSysModule), "功能模块管理"),
};
}
......
......@@ -125,7 +125,7 @@
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAACg
CwAAAk1TRnQBSQFMAgEBAgEAARABAAEQAQABIAEAASABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
CwAAAk1TRnQBSQFMAgEBAgEAARgBAAEYAQABIAEAASABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
AwABgAMAASADAAEBAQABCAYAARAYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA
AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5
AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA
......
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