Commit 26e892ce authored by 朱天博's avatar 朱天博

1.app模块管理

parent d943ccda

namespace Tools
{
/// <summary>
/// app模块
/// </summary>
public class AppModel
{
public string ID { get; set; }
public string Code { get; set; }
public string Name { get; set; }
public string PrevID { get; set; }
public string PrevName { get; set; }
public string ModuleName { get; set; }
public AppModel()
{
}
public AppModel(System.Windows.Forms.DataGridViewRow row)
{
this.ID = row.Cells[0].Value.ToString();
this.Code = row.Cells[1].Value.ToString();
this.Name = row.Cells[2].Value.ToString();
this.PrevID = row.Cells[3].Value.ToString();
this.PrevName = row.Cells[4].Value.ToString();
this.ModuleName = row.Cells[5].Value.ToString();
row.Tag = this;
}
}
}
...@@ -64,6 +64,7 @@ ...@@ -64,6 +64,7 @@
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="AppModel.cs" />
<Compile Include="MyCommon\Common.cs" /> <Compile Include="MyCommon\Common.cs" />
<Compile Include="MyCommon\wBasic.cs"> <Compile Include="MyCommon\wBasic.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
...@@ -93,6 +94,18 @@ ...@@ -93,6 +94,18 @@
<Compile Include="MyUtils\wSysSetting.Designer.cs"> <Compile Include="MyUtils\wSysSetting.Designer.cs">
<DependentUpon>wSysSetting.cs</DependentUpon> <DependentUpon>wSysSetting.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="UI\wAppModel.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="UI\wAppModel.Designer.cs">
<DependentUpon>wAppModel.cs</DependentUpon>
</Compile>
<Compile Include="UI\wAppModelEdit.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="UI\wAppModelEdit.Designer.cs">
<DependentUpon>wAppModelEdit.cs</DependentUpon>
</Compile>
<Compile Include="UI\wDbAnlysis.cs"> <Compile Include="UI\wDbAnlysis.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
...@@ -148,6 +161,12 @@ ...@@ -148,6 +161,12 @@
<DependentUpon>Resources.resx</DependentUpon> <DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime> <DesignTime>True</DesignTime>
</Compile> </Compile>
<EmbeddedResource Include="UI\wAppModel.resx">
<DependentUpon>wAppModel.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UI\wAppModelEdit.resx">
<DependentUpon>wAppModelEdit.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UI\wDbAnlysis.resx"> <EmbeddedResource Include="UI\wDbAnlysis.resx">
<DependentUpon>wDbAnlysis.cs</DependentUpon> <DependentUpon>wDbAnlysis.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
......
This diff is collapsed.
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
{
public partial class wAppModel : Form
{
SmpDB _db = new SmpDB();
string _link = "";
public wAppModel()
{
InitializeComponent();
}
private void wAppModel_Load(object sender, EventArgs e)
{
}
private void tsbDB_Click(object sender, EventArgs e)
{
var frm = new wDbSetting();
if (frm.ShowDialog() == DialogResult.OK)
{
this.SetDbLink(frm.LinkModel);
}
RefrashData("1=1");
}
/// <summary>
/// 设置数据库链接
/// </summary>
/// <param name="m"></param>
private void SetDbLink(DbItemModel m)
{
this._link = m.LinkString;
this.tstbLinkString.Text = m.ToString();
}
private void RefrashData(string strWhere)
{
string sql = $@"
SELECT a.ID,a.Code,a.Name,a.PrevID,b.Name AS PrevName,a.ModuleName FROM dbo.App_SysBusinessModel a
INNER JOIN dbo.App_SysBusinessModel b ON a.PrevID=b.ID
WHERE {strWhere} ORDER BY A.ID DESC";
dgvAppModel.DataSource = this._db.GetDataTable(this._link, sql, "结果列表");
}
private string strWhere;
private void rdbSelected_CheckedChanged(object sender, EventArgs e)
{
RadioButton radioButton = sender as RadioButton;
strWhere = radioButton.Text == "全部" ? "1=1" : $"a.ModuleName = '{radioButton.Text}'";
RefrashData(strWhere);
tabControl1.SelectedTab = tabAppModel;
}
private void btnAdd_Click(object sender, EventArgs e)
{
wAppModelEdit frm = new wAppModelEdit(true, null, this._db, this._link);
if (frm.ShowDialog() == DialogResult.OK)
RefrashData(strWhere);
}
private void btnGetSql_Click(object sender, EventArgs e)
{
if (dgvAppModel.SelectedRows.Count == 0)
{
MessageBox.Show("请先选择行");
return;
}
StringBuilder sb = new StringBuilder();
foreach (DataGridViewRow row in dgvAppModel.SelectedRows)
{
AppModel model = new AppModel(row);
sb.AppendLine($@"
IF NOT EXISTS(SELECT * FROM FTT.dbo.App_SysBusinessModel WHERE Name = '{model.Name}')
AND NOT EXISTS(SELECT * FROM FTT.dbo.App_SysBusinessModel WHERE ID = {model.ID})
BEGIN
INSERT INTO FTT.dbo.App_SysBusinessModel
( ID ,Code ,Name ,PrevID ,LevelNum ,[Index] ,IsEnabled ,PageCode ,IcoPath ,SysCode ,IcoCode,ModuleName)
VALUES ( {model.ID} ,'{model.Code}' ,'{model.Name}' ,{model.PrevID} ,2 ,30 ,1 ,'' ,'' ,',PDM,U6,MES' ,'icon_05','{model.ModuleName}')
END
IF NOT EXISTS(SELECT * FROM FTT_MES.dbo.App_SysBusinessModel WHERE Name = '{model.Name}')
AND NOT EXISTS(SELECT * FROM FTT_MES.dbo.App_SysBusinessModel WHERE ID = {model.ID})
BEGIN
INSERT INTO FTT_MES.dbo.App_SysBusinessModel
( ID ,Code ,Name ,PrevID ,LevelNum ,[Index] ,IsEnabled ,PageCode ,IcoPath ,SysCode ,IcoCode,ModuleName)
VALUES ( {model.ID} ,'{model.Code}' ,'{model.Name}' ,{model.PrevID} ,2 ,30 ,1 ,'' ,'' ,',PDM,U6,MES' ,'icon_05','{model.ModuleName}')
END
IF NOT EXISTS(SELECT * FROM FTT_PDM.dbo.App_SysBusinessModel WHERE Name = '{model.Name}')
AND NOT EXISTS(SELECT * FROM FTT_PDM.dbo.App_SysBusinessModel WHERE ID = {model.ID})
BEGIN
INSERT INTO FTT_PDM.dbo.App_SysBusinessModel
( ID ,Code ,Name ,PrevID ,LevelNum ,[Index] ,IsEnabled ,PageCode ,IcoPath ,SysCode ,IcoCode,ModuleName)
VALUES ( {model.ID} ,'{model.Code}' ,'{model.Name}' ,{model.PrevID} ,2 ,30 ,1 ,'' ,'' ,',PDM,U6,MES' ,'icon_05','{model.ModuleName}')
END
");
}
txtSql.Text = sb.ToString();
tabControl1.SelectedTab = tabSql;
}
private void dgvAppModel_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
{
AppModel model = new AppModel(dgvAppModel.SelectedRows[0]);
wAppModelEdit frm = new wAppModelEdit(false, model, this._db, this._link);
if (frm.ShowDialog() == DialogResult.OK)
RefrashData(strWhere);
}
}
}
<?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="Column1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column5.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="Column6.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column3.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="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
namespace Tools.UI
{
partial class wAppModelEdit
{
/// <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.btnSave = new System.Windows.Forms.Button();
this.btnCancel = new System.Windows.Forms.Button();
this.txtID = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.txtCode = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.txtName = new System.Windows.Forms.TextBox();
this.label3 = new System.Windows.Forms.Label();
this.cmbPrevID = new System.Windows.Forms.ComboBox();
this.cmbModuleName = new System.Windows.Forms.ComboBox();
this.label4 = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// btnSave
//
this.btnSave.DialogResult = System.Windows.Forms.DialogResult.OK;
this.btnSave.Location = new System.Drawing.Point(78, 130);
this.btnSave.Name = "btnSave";
this.btnSave.Size = new System.Drawing.Size(75, 23);
this.btnSave.TabIndex = 0;
this.btnSave.Text = "保存";
this.btnSave.UseVisualStyleBackColor = true;
this.btnSave.Click += new System.EventHandler(this.btnSave_Click);
//
// btnCancel
//
this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.btnCancel.Location = new System.Drawing.Point(194, 130);
this.btnCancel.Name = "btnCancel";
this.btnCancel.Size = new System.Drawing.Size(75, 23);
this.btnCancel.TabIndex = 0;
this.btnCancel.Text = "取消";
this.btnCancel.UseVisualStyleBackColor = true;
this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
//
// txtID
//
this.txtID.Location = new System.Drawing.Point(60, 16);
this.txtID.Name = "txtID";
this.txtID.Size = new System.Drawing.Size(84, 21);
this.txtID.TabIndex = 1;
//
// label1
//
this.label1.AutoSize = true;
this.label1.ForeColor = System.Drawing.Color.Red;
this.label1.Location = new System.Drawing.Point(22, 22);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(35, 12);
this.label1.TabIndex = 2;
this.label1.Text = "编码:";
//
// txtCode
//
this.txtCode.Location = new System.Drawing.Point(60, 51);
this.txtCode.Name = "txtCode";
this.txtCode.ReadOnly = true;
this.txtCode.Size = new System.Drawing.Size(84, 21);
this.txtCode.TabIndex = 1;
//
// label2
//
this.label2.AutoSize = true;
this.label2.ForeColor = System.Drawing.Color.Red;
this.label2.Location = new System.Drawing.Point(22, 57);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(35, 12);
this.label2.TabIndex = 2;
this.label2.Text = "简称:";
//
// txtName
//
this.txtName.Location = new System.Drawing.Point(60, 86);
this.txtName.Name = "txtName";
this.txtName.Size = new System.Drawing.Size(84, 21);
this.txtName.TabIndex = 1;
this.txtName.TextChanged += new System.EventHandler(this.txtName_TextChanged);
//
// label3
//
this.label3.AutoSize = true;
this.label3.ForeColor = System.Drawing.Color.Red;
this.label3.Location = new System.Drawing.Point(22, 92);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(35, 12);
this.label3.TabIndex = 2;
this.label3.Text = "名称:";
//
// cmbPrevID
//
this.cmbPrevID.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbPrevID.FormattingEnabled = true;
this.cmbPrevID.Items.AddRange(new object[] {
"生产控制中心",
"CEO报表中心"});
this.cmbPrevID.Location = new System.Drawing.Point(223, 16);
this.cmbPrevID.Name = "cmbPrevID";
this.cmbPrevID.Size = new System.Drawing.Size(92, 20);
this.cmbPrevID.TabIndex = 3;
//
// cmbModuleName
//
this.cmbModuleName.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbModuleName.FormattingEnabled = true;
this.cmbModuleName.Items.AddRange(new object[] {
"ERP",
"MES",
"WMS",
"PDM",
"BI"});
this.cmbModuleName.Location = new System.Drawing.Point(223, 52);
this.cmbModuleName.Name = "cmbModuleName";
this.cmbModuleName.Size = new System.Drawing.Size(92, 20);
this.cmbModuleName.TabIndex = 3;
//
// label4
//
this.label4.AutoSize = true;
this.label4.ForeColor = System.Drawing.Color.Red;
this.label4.Location = new System.Drawing.Point(164, 19);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(59, 12);
this.label4.TabIndex = 2;
this.label4.Text = "父级模块:";
//
// label5
//
this.label5.AutoSize = true;
this.label5.ForeColor = System.Drawing.Color.Red;
this.label5.Location = new System.Drawing.Point(164, 57);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(59, 12);
this.label5.TabIndex = 2;
this.label5.Text = "所属系统:";
//
// wAppModelEdit
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(334, 174);
this.Controls.Add(this.cmbModuleName);
this.Controls.Add(this.cmbPrevID);
this.Controls.Add(this.label3);
this.Controls.Add(this.label5);
this.Controls.Add(this.label2);
this.Controls.Add(this.label4);
this.Controls.Add(this.label1);
this.Controls.Add(this.txtName);
this.Controls.Add(this.txtCode);
this.Controls.Add(this.txtID);
this.Controls.Add(this.btnCancel);
this.Controls.Add(this.btnSave);
this.Name = "wAppModelEdit";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "编辑APP模块";
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button btnSave;
private System.Windows.Forms.Button btnCancel;
private System.Windows.Forms.TextBox txtID;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.TextBox txtCode;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.TextBox txtName;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.ComboBox cmbPrevID;
private System.Windows.Forms.ComboBox cmbModuleName;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Label label5;
}
}
\ 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
{
public partial class wAppModelEdit : Form
{
private bool _IsAdd;
private AppModel _model;
private SmpDB _smpDB;
string _link = "";
public wAppModelEdit(bool IsAdd, AppModel model, SmpDB smpDB,string link)
{
InitializeComponent();
this._IsAdd = IsAdd;
this._model = model;
this._smpDB = smpDB;
this._link = link;
if (_model != null)
{
txtID.Text = _model.ID;
txtCode.Text = _model.Code;
txtName.Text = _model.Name;
cmbPrevID.Text = _model.PrevName;
cmbModuleName.Text = _model.ModuleName;
}
if (!IsAdd)
txtID.ReadOnly = true;
}
private void btnSave_Click(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(txtID.Text))
{
MessageBox.Show("编码不能为空");
return;
}
if (string.IsNullOrEmpty(txtCode.Text))
{
MessageBox.Show("简称不能为空");
return;
}
if (string.IsNullOrEmpty(txtName.Text))
{
MessageBox.Show("名称不能为空");
return;
}
if (string.IsNullOrEmpty(cmbPrevID.Text))
{
MessageBox.Show("父级模块不能为空");
return;
}
if (string.IsNullOrEmpty(cmbModuleName.Text))
{
MessageBox.Show("所属系统不能为空");
return;
}
StringBuilder sb = new StringBuilder();
AppModel model = new AppModel();
model.Code = txtCode.Text;
model.Name = txtName.Text;
model.PrevID = cmbPrevID.Text == "生产控制中心" ? "90011" : "90010";
model.PrevName = cmbPrevID.Text;
model.ModuleName = cmbModuleName.Text;
if (_IsAdd)
{
model.ID = txtID.Text;
sb.AppendLine($@"
IF NOT EXISTS(SELECT * FROM FTT.dbo.App_SysBusinessModel WHERE Name = '{model.Name}')
AND NOT EXISTS(SELECT * FROM FTT.dbo.App_SysBusinessModel WHERE ID = {model.ID})
BEGIN
INSERT INTO FTT.dbo.App_SysBusinessModel
( ID ,Code ,Name ,PrevID ,LevelNum ,[Index] ,IsEnabled ,PageCode ,IcoPath ,SysCode ,IcoCode,ModuleName)
VALUES ( {model.ID} ,'{model.Code}' ,'{model.Name}' ,{model.PrevID} ,2 ,30 ,1 ,'' ,'' ,',PDM,U6,MES' ,'icon_05','{model.ModuleName}')
END
IF NOT EXISTS(SELECT * FROM FTT_MES.dbo.App_SysBusinessModel WHERE Name = '{model.Name}')
AND NOT EXISTS(SELECT * FROM FTT_MES.dbo.App_SysBusinessModel WHERE ID = {model.ID})
BEGIN
INSERT INTO FTT_MES.dbo.App_SysBusinessModel
( ID ,Code ,Name ,PrevID ,LevelNum ,[Index] ,IsEnabled ,PageCode ,IcoPath ,SysCode ,IcoCode,ModuleName)
VALUES ( {model.ID} ,'{model.Code}' ,'{model.Name}' ,{model.PrevID} ,2 ,30 ,1 ,'' ,'' ,',PDM,U6,MES' ,'icon_05','{model.ModuleName}')
END
IF NOT EXISTS(SELECT * FROM FTT_PDM.dbo.App_SysBusinessModel WHERE Name = '{model.Name}')
AND NOT EXISTS(SELECT * FROM FTT_PDM.dbo.App_SysBusinessModel WHERE ID = {model.ID})
BEGIN
INSERT INTO FTT_PDM.dbo.App_SysBusinessModel
( ID ,Code ,Name ,PrevID ,LevelNum ,[Index] ,IsEnabled ,PageCode ,IcoPath ,SysCode ,IcoCode,ModuleName)
VALUES ( {model.ID} ,'{model.Code}' ,'{model.Name}' ,{model.PrevID} ,2 ,30 ,1 ,'' ,'' ,',PDM,U6,MES' ,'icon_05','{model.ModuleName}')
END
");
this._smpDB.GetDataTable(this._link, sb.ToString(), "列表");
}
else
{
model.ID = _model.ID;
sb.AppendLine($@"
IF EXISTS(SELECT * FROM FTT.dbo.App_SysBusinessModel WHERE ID = {model.ID})
BEGIN
UPDATE FTT.[dbo].[App_SysBusinessModel]
SET [Code] = '{model.Code}',[Name] = '{model.Name}',[PrevID] = {model.PrevID},[ModuleName] = '{model.ModuleName}'
WHERE ID = {model.ID}
END
IF EXISTS(SELECT * FROM FTT_MES.dbo.App_SysBusinessModel WHERE ID = {model.ID})
BEGIN
UPDATE FTT_MES.[dbo].[App_SysBusinessModel]
SET [Code] = '{model.Code}',[Name] = '{model.Name}',[PrevID] = {model.PrevID},[ModuleName] = '{model.ModuleName}'
WHERE ID = {model.ID}
END
IF EXISTS(SELECT * FROM FTT_PDM.dbo.App_SysBusinessModel WHERE ID = {model.ID})
BEGIN
UPDATE FTT_PDM.[dbo].[App_SysBusinessModel]
SET [Code] = '{model.Code}',[Name] = '{model.Name}',[PrevID] = {model.PrevID},[ModuleName] = '{model.ModuleName}'
WHERE ID = {model.ID}
END
");
this._smpDB.GetDataTable(this._link, sb.ToString(), "列表");
}
this.Close();
}
private void btnCancel_Click(object sender, EventArgs e)
{
this.Close();
}
private void txtName_TextChanged(object sender, EventArgs e)
{
txtCode.Text = Utils.GetPinyinString(txtName.Text);
}
}
}
<?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>
</root>
\ No newline at end of file
...@@ -21,6 +21,7 @@ namespace Tools ...@@ -21,6 +21,7 @@ namespace Tools
this.CreateModule(new UI.wDbAnlysis(), "简易SQL效率分析"), this.CreateModule(new UI.wDbAnlysis(), "简易SQL效率分析"),
this.CreateModule(new UI.wSysChecker(), "系统检查配置工具"), this.CreateModule(new UI.wSysChecker(), "系统检查配置工具"),
this.CreateModule(new UI.wMonitorVisit(), "APP模块访问次数监控"), this.CreateModule(new UI.wMonitorVisit(), "APP模块访问次数监控"),
this.CreateModule(new UI.wAppModel(), "APP模块编辑"),
}; };
} }
......
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