添加项目文件。
This commit is contained in:
168
CleanMachineHMI/frmChild/frmAddCleanCode.Designer.cs
generated
Normal file
168
CleanMachineHMI/frmChild/frmAddCleanCode.Designer.cs
generated
Normal file
@@ -0,0 +1,168 @@
|
||||
namespace CleanMachineHMI.frmChild
|
||||
{
|
||||
partial class frmAddCleanCode
|
||||
{
|
||||
/// <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.kryptonPanel1 = new ComponentFactory.Krypton.Toolkit.KryptonPanel();
|
||||
this.txtCleanModeName = new ComponentFactory.Krypton.Toolkit.KryptonTextBox();
|
||||
this.txtCleanModeCode = new ComponentFactory.Krypton.Toolkit.KryptonTextBox();
|
||||
this.lbCleanModeName = new ComponentFactory.Krypton.Toolkit.KryptonLabel();
|
||||
this.lbCleanModeCode = new ComponentFactory.Krypton.Toolkit.KryptonLabel();
|
||||
this.btnEdit = new ComponentFactory.Krypton.Toolkit.KryptonButton();
|
||||
this.btnAdd = new ComponentFactory.Krypton.Toolkit.KryptonButton();
|
||||
((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit();
|
||||
this.kryptonPanel1.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// kryptonPanel1
|
||||
//
|
||||
this.kryptonPanel1.Controls.Add(this.txtCleanModeName);
|
||||
this.kryptonPanel1.Controls.Add(this.txtCleanModeCode);
|
||||
this.kryptonPanel1.Controls.Add(this.lbCleanModeName);
|
||||
this.kryptonPanel1.Controls.Add(this.lbCleanModeCode);
|
||||
this.kryptonPanel1.Controls.Add(this.btnEdit);
|
||||
this.kryptonPanel1.Controls.Add(this.btnAdd);
|
||||
this.kryptonPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.kryptonPanel1.Location = new System.Drawing.Point(0, 0);
|
||||
this.kryptonPanel1.Name = "kryptonPanel1";
|
||||
this.kryptonPanel1.Size = new System.Drawing.Size(289, 227);
|
||||
this.kryptonPanel1.TabIndex = 3;
|
||||
//
|
||||
// txtCleanModeName
|
||||
//
|
||||
this.txtCleanModeName.AlwaysActive = false;
|
||||
this.txtCleanModeName.Location = new System.Drawing.Point(21, 110);
|
||||
this.txtCleanModeName.Name = "txtCleanModeName";
|
||||
this.txtCleanModeName.PaletteMode = ComponentFactory.Krypton.Toolkit.PaletteMode.ProfessionalOffice2003;
|
||||
this.txtCleanModeName.Size = new System.Drawing.Size(250, 35);
|
||||
this.txtCleanModeName.StateActive.Border.Color1 = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(255)))));
|
||||
this.txtCleanModeName.StateActive.Border.DrawBorders = ((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders)((((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Top | ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Bottom)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Left)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Right)));
|
||||
this.txtCleanModeName.StateCommon.Border.DrawBorders = ((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders)((((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Top | ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Bottom)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Left)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Right)));
|
||||
this.txtCleanModeName.StateCommon.Border.GraphicsHint = ComponentFactory.Krypton.Toolkit.PaletteGraphicsHint.AntiAlias;
|
||||
this.txtCleanModeName.StateCommon.Border.Rounding = 4;
|
||||
this.txtCleanModeName.StateCommon.Border.Width = 2;
|
||||
this.txtCleanModeName.StateCommon.Content.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.txtCleanModeName.TabIndex = 39;
|
||||
//
|
||||
// txtCleanModeCode
|
||||
//
|
||||
this.txtCleanModeCode.AlwaysActive = false;
|
||||
this.txtCleanModeCode.Location = new System.Drawing.Point(21, 39);
|
||||
this.txtCleanModeCode.Name = "txtCleanModeCode";
|
||||
this.txtCleanModeCode.PaletteMode = ComponentFactory.Krypton.Toolkit.PaletteMode.ProfessionalOffice2003;
|
||||
this.txtCleanModeCode.Size = new System.Drawing.Size(250, 35);
|
||||
this.txtCleanModeCode.StateActive.Border.Color1 = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(255)))));
|
||||
this.txtCleanModeCode.StateActive.Border.DrawBorders = ((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders)((((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Top | ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Bottom)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Left)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Right)));
|
||||
this.txtCleanModeCode.StateCommon.Border.DrawBorders = ((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders)((((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Top | ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Bottom)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Left)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Right)));
|
||||
this.txtCleanModeCode.StateCommon.Border.GraphicsHint = ComponentFactory.Krypton.Toolkit.PaletteGraphicsHint.AntiAlias;
|
||||
this.txtCleanModeCode.StateCommon.Border.Rounding = 4;
|
||||
this.txtCleanModeCode.StateCommon.Border.Width = 2;
|
||||
this.txtCleanModeCode.StateCommon.Content.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.txtCleanModeCode.TabIndex = 38;
|
||||
//
|
||||
// lbCleanModeName
|
||||
//
|
||||
this.lbCleanModeName.LabelStyle = ComponentFactory.Krypton.Toolkit.LabelStyle.TitleControl;
|
||||
this.lbCleanModeName.Location = new System.Drawing.Point(20, 82);
|
||||
this.lbCleanModeName.Name = "lbCleanModeName";
|
||||
this.lbCleanModeName.Size = new System.Drawing.Size(115, 26);
|
||||
this.lbCleanModeName.StateCommon.ShortText.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.lbCleanModeName.TabIndex = 37;
|
||||
this.lbCleanModeName.Values.Text = "清洁方式名称:";
|
||||
//
|
||||
// lbCleanModeCode
|
||||
//
|
||||
this.lbCleanModeCode.LabelStyle = ComponentFactory.Krypton.Toolkit.LabelStyle.TitleControl;
|
||||
this.lbCleanModeCode.Location = new System.Drawing.Point(20, 11);
|
||||
this.lbCleanModeCode.Name = "lbCleanModeCode";
|
||||
this.lbCleanModeCode.Size = new System.Drawing.Size(115, 26);
|
||||
this.lbCleanModeCode.StateCommon.ShortText.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.lbCleanModeCode.TabIndex = 36;
|
||||
this.lbCleanModeCode.Values.Text = "清洁方式编码:";
|
||||
//
|
||||
// btnEdit
|
||||
//
|
||||
this.btnEdit.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.btnEdit.Location = new System.Drawing.Point(183, 166);
|
||||
this.btnEdit.Name = "btnEdit";
|
||||
this.btnEdit.Size = new System.Drawing.Size(82, 40);
|
||||
this.btnEdit.StateCommon.Content.ShortText.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.btnEdit.TabIndex = 35;
|
||||
this.btnEdit.Values.Text = "取消";
|
||||
this.btnEdit.Click += new System.EventHandler(this.btnEdit_Click);
|
||||
//
|
||||
// btnAdd
|
||||
//
|
||||
this.btnAdd.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.btnAdd.Location = new System.Drawing.Point(23, 166);
|
||||
this.btnAdd.Name = "btnAdd";
|
||||
this.btnAdd.Size = new System.Drawing.Size(82, 40);
|
||||
this.btnAdd.StateCommon.Content.ShortText.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.btnAdd.TabIndex = 34;
|
||||
this.btnAdd.Values.Text = "确认";
|
||||
this.btnAdd.Click += new System.EventHandler(this.btnAdd_Click);
|
||||
//
|
||||
// frmAddCleanCode
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(289, 227);
|
||||
this.Controls.Add(this.kryptonPanel1);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "frmAddCleanCode";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||
this.Text = "AddCleanCode";
|
||||
this.Load += new System.EventHandler(this.frmAddCleanCode_Load);
|
||||
((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).EndInit();
|
||||
this.kryptonPanel1.ResumeLayout(false);
|
||||
this.kryptonPanel1.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonPanel kryptonPanel1;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonButton btnEdit;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonButton btnAdd;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonTextBox txtCleanModeName;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonTextBox txtCleanModeCode;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonLabel lbCleanModeName;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonLabel lbCleanModeCode;
|
||||
}
|
||||
}
|
||||
129
CleanMachineHMI/frmChild/frmAddCleanCode.cs
Normal file
129
CleanMachineHMI/frmChild/frmAddCleanCode.cs
Normal file
@@ -0,0 +1,129 @@
|
||||
using CleanMachineHMI.forms;
|
||||
using CleanMachineHMI.FrmUserControl;
|
||||
using CleanMachineHMI.Utils;
|
||||
using ComponentFactory.Krypton.Toolkit;
|
||||
using LeadDataBaseUtility;
|
||||
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;
|
||||
|
||||
namespace CleanMachineHMI.frmChild
|
||||
{
|
||||
public partial class frmAddCleanCode : KryptonForm
|
||||
{
|
||||
public frmAddCleanCode()
|
||||
{
|
||||
InitializeComponent();
|
||||
_InfoLanguageTextList = this.GetInfoLanguageText(GlobalHelper.LanguageCode);
|
||||
}
|
||||
private DataTable _InfoLanguageTextList;
|
||||
|
||||
private void frmAddCleanCode_Load(object sender, EventArgs e)
|
||||
{
|
||||
InitControlEvent();
|
||||
this.SetFormControlText(GlobalHelper.LanguageCode);
|
||||
}
|
||||
private void txt_GotFocus(object sender, EventArgs e)
|
||||
{
|
||||
KeyboardAutoPopUp.ShowInputPanel();
|
||||
}
|
||||
private void txt_LostFocus(object sender, EventArgs e)
|
||||
{
|
||||
KeyboardAutoPopUp.HideInputPanel();
|
||||
}
|
||||
private void InitControlEvent()
|
||||
{
|
||||
txtCleanModeCode.GotFocus += new EventHandler(txt_GotFocus); //获取焦点前发生事件
|
||||
txtCleanModeCode.LostFocus += new EventHandler(txt_LostFocus); //失去焦点后发生事件
|
||||
|
||||
txtCleanModeName.GotFocus += new EventHandler(txt_GotFocus); //获取焦点前发生事件
|
||||
txtCleanModeName.LostFocus += new EventHandler(txt_LostFocus); //失去焦点后发生事件
|
||||
}
|
||||
|
||||
private void btnAdd_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (string.IsNullOrEmpty(txtCleanModeCode.Text))
|
||||
{
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请输入清洗方式编码!", "EnterCleanCodeInfo"));
|
||||
return;
|
||||
}
|
||||
if (string.IsNullOrEmpty(txtCleanModeName.Text))
|
||||
{
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请输入清洗方式名称!", "EnterCleanNameInfo"));
|
||||
return;
|
||||
}
|
||||
string sqlIsExistCode = $@"SELECT 1 FROM BAS_CLEAN_MODE WHERE CLEAN_MODE_CODE = '{txtCleanModeCode.Text}'";
|
||||
DataTable dtIsExistCode = LeadDbHelperSQLite.Query(sqlIsExistCode).Tables[0];
|
||||
if (dtIsExistCode != null && dtIsExistCode.Rows.Count > 0)
|
||||
{
|
||||
//KryptonMessageBox.Show($"清洗方式条码:【{txtCleanModeCode.Text}】已经存在,请重新输入!");
|
||||
KryptonMessageBox.Show($"Clean methol code: 【{txtCleanModeCode.Text}】already exist, please re-enter!");
|
||||
return;
|
||||
}
|
||||
string sql = $@"
|
||||
INSERT INTO BAS_CLEAN_MODE (
|
||||
CLEAN_MODE_CODE,
|
||||
CLEAN_MODE_NAME,
|
||||
USED_FLAG,
|
||||
DEL_FLAG,
|
||||
CREATE_BY,
|
||||
CREATE_TIME,
|
||||
UPDATE_BY,
|
||||
UPDATE_TIME,
|
||||
DATA_VERSION,
|
||||
REMARKS1,
|
||||
REMARKS2,
|
||||
REMARKS3,
|
||||
REMARKS4,
|
||||
REMARKS5
|
||||
)
|
||||
VALUES
|
||||
(
|
||||
'{txtCleanModeCode.Text}',
|
||||
'{txtCleanModeName.Text}',
|
||||
1,
|
||||
0,
|
||||
'{GlobalHelper.UserInfo.USER_ID}',
|
||||
datetime('now', 'localtime'),
|
||||
'{GlobalHelper.UserInfo.USER_ID}',
|
||||
datetime('now', 'localtime'),
|
||||
0,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL
|
||||
);
|
||||
";
|
||||
int row = LeadDbHelperSQLite.ExecuteSql(sql);
|
||||
if (row > 0)
|
||||
{
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("新增清洗方式数据成功!", "AddSuccessInfo"));
|
||||
frmCleanMode.RefreshFrmHost();
|
||||
this.Close();
|
||||
}
|
||||
else
|
||||
{
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("新增清洗方式数据失败!", "AddFailInfo"));
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("新增清洗方式数据发生异常", "AddCleanModeDataExp") + $":【{ex.Message}】!");
|
||||
}
|
||||
}
|
||||
|
||||
private void btnEdit_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
120
CleanMachineHMI/frmChild/frmAddCleanCode.resx
Normal file
120
CleanMachineHMI/frmChild/frmAddCleanCode.resx
Normal file
@@ -0,0 +1,120 @@
|
||||
<?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>
|
||||
196
CleanMachineHMI/frmChild/frmAddContaminationDtl.Designer.cs
generated
Normal file
196
CleanMachineHMI/frmChild/frmAddContaminationDtl.Designer.cs
generated
Normal file
@@ -0,0 +1,196 @@
|
||||
namespace CleanMachineHMI.frmChild
|
||||
{
|
||||
partial class frmAddContaminationDtl
|
||||
{
|
||||
/// <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.kryptonPanel1 = new ComponentFactory.Krypton.Toolkit.KryptonPanel();
|
||||
this.cmbContaminationType = new ComponentFactory.Krypton.Toolkit.KryptonComboBox();
|
||||
this.txtContaminationDTLName = new ComponentFactory.Krypton.Toolkit.KryptonTextBox();
|
||||
this.txtContaminationDTLCode = new ComponentFactory.Krypton.Toolkit.KryptonTextBox();
|
||||
this.lbContaminationType = new ComponentFactory.Krypton.Toolkit.KryptonLabel();
|
||||
this.lbContaminationDTLName = new ComponentFactory.Krypton.Toolkit.KryptonLabel();
|
||||
this.lbContaminationDTLCode = new ComponentFactory.Krypton.Toolkit.KryptonLabel();
|
||||
this.btnEdit = new ComponentFactory.Krypton.Toolkit.KryptonButton();
|
||||
this.btnAdd = new ComponentFactory.Krypton.Toolkit.KryptonButton();
|
||||
((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit();
|
||||
this.kryptonPanel1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.cmbContaminationType)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// kryptonPanel1
|
||||
//
|
||||
this.kryptonPanel1.Controls.Add(this.cmbContaminationType);
|
||||
this.kryptonPanel1.Controls.Add(this.txtContaminationDTLName);
|
||||
this.kryptonPanel1.Controls.Add(this.txtContaminationDTLCode);
|
||||
this.kryptonPanel1.Controls.Add(this.lbContaminationType);
|
||||
this.kryptonPanel1.Controls.Add(this.lbContaminationDTLName);
|
||||
this.kryptonPanel1.Controls.Add(this.lbContaminationDTLCode);
|
||||
this.kryptonPanel1.Controls.Add(this.btnEdit);
|
||||
this.kryptonPanel1.Controls.Add(this.btnAdd);
|
||||
this.kryptonPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.kryptonPanel1.Location = new System.Drawing.Point(0, 0);
|
||||
this.kryptonPanel1.Name = "kryptonPanel1";
|
||||
this.kryptonPanel1.Size = new System.Drawing.Size(334, 290);
|
||||
this.kryptonPanel1.TabIndex = 5;
|
||||
//
|
||||
// cmbContaminationType
|
||||
//
|
||||
this.cmbContaminationType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.cmbContaminationType.DropDownWidth = 271;
|
||||
this.cmbContaminationType.Location = new System.Drawing.Point(23, 41);
|
||||
this.cmbContaminationType.Name = "cmbContaminationType";
|
||||
this.cmbContaminationType.Size = new System.Drawing.Size(287, 27);
|
||||
this.cmbContaminationType.StateCommon.ComboBox.Content.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.cmbContaminationType.TabIndex = 41;
|
||||
//
|
||||
// txtContaminationDTLName
|
||||
//
|
||||
this.txtContaminationDTLName.AlwaysActive = false;
|
||||
this.txtContaminationDTLName.Location = new System.Drawing.Point(23, 179);
|
||||
this.txtContaminationDTLName.Name = "txtContaminationDTLName";
|
||||
this.txtContaminationDTLName.PaletteMode = ComponentFactory.Krypton.Toolkit.PaletteMode.ProfessionalOffice2003;
|
||||
this.txtContaminationDTLName.Size = new System.Drawing.Size(287, 35);
|
||||
this.txtContaminationDTLName.StateActive.Border.Color1 = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(255)))));
|
||||
this.txtContaminationDTLName.StateActive.Border.DrawBorders = ((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders)((((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Top | ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Bottom)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Left)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Right)));
|
||||
this.txtContaminationDTLName.StateCommon.Border.DrawBorders = ((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders)((((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Top | ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Bottom)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Left)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Right)));
|
||||
this.txtContaminationDTLName.StateCommon.Border.GraphicsHint = ComponentFactory.Krypton.Toolkit.PaletteGraphicsHint.AntiAlias;
|
||||
this.txtContaminationDTLName.StateCommon.Border.Rounding = 4;
|
||||
this.txtContaminationDTLName.StateCommon.Border.Width = 2;
|
||||
this.txtContaminationDTLName.StateCommon.Content.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.txtContaminationDTLName.TabIndex = 40;
|
||||
//
|
||||
// txtContaminationDTLCode
|
||||
//
|
||||
this.txtContaminationDTLCode.AlwaysActive = false;
|
||||
this.txtContaminationDTLCode.Location = new System.Drawing.Point(23, 108);
|
||||
this.txtContaminationDTLCode.Name = "txtContaminationDTLCode";
|
||||
this.txtContaminationDTLCode.PaletteMode = ComponentFactory.Krypton.Toolkit.PaletteMode.ProfessionalOffice2003;
|
||||
this.txtContaminationDTLCode.Size = new System.Drawing.Size(287, 35);
|
||||
this.txtContaminationDTLCode.StateActive.Border.Color1 = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(255)))));
|
||||
this.txtContaminationDTLCode.StateActive.Border.DrawBorders = ((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders)((((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Top | ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Bottom)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Left)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Right)));
|
||||
this.txtContaminationDTLCode.StateCommon.Border.DrawBorders = ((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders)((((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Top | ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Bottom)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Left)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Right)));
|
||||
this.txtContaminationDTLCode.StateCommon.Border.GraphicsHint = ComponentFactory.Krypton.Toolkit.PaletteGraphicsHint.AntiAlias;
|
||||
this.txtContaminationDTLCode.StateCommon.Border.Rounding = 4;
|
||||
this.txtContaminationDTLCode.StateCommon.Border.Width = 2;
|
||||
this.txtContaminationDTLCode.StateCommon.Content.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.txtContaminationDTLCode.TabIndex = 39;
|
||||
//
|
||||
// lbContaminationType
|
||||
//
|
||||
this.lbContaminationType.LabelStyle = ComponentFactory.Krypton.Toolkit.LabelStyle.TitleControl;
|
||||
this.lbContaminationType.Location = new System.Drawing.Point(23, 9);
|
||||
this.lbContaminationType.Name = "lbContaminationType";
|
||||
this.lbContaminationType.Size = new System.Drawing.Size(82, 26);
|
||||
this.lbContaminationType.StateCommon.ShortText.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.lbContaminationType.TabIndex = 38;
|
||||
this.lbContaminationType.Values.Text = "污染类型:";
|
||||
//
|
||||
// lbContaminationDTLName
|
||||
//
|
||||
this.lbContaminationDTLName.LabelStyle = ComponentFactory.Krypton.Toolkit.LabelStyle.TitleControl;
|
||||
this.lbContaminationDTLName.Location = new System.Drawing.Point(23, 147);
|
||||
this.lbContaminationDTLName.Name = "lbContaminationDTLName";
|
||||
this.lbContaminationDTLName.Size = new System.Drawing.Size(115, 26);
|
||||
this.lbContaminationDTLName.StateCommon.ShortText.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.lbContaminationDTLName.TabIndex = 37;
|
||||
this.lbContaminationDTLName.Values.Text = "污染明细名称:";
|
||||
//
|
||||
// lbContaminationDTLCode
|
||||
//
|
||||
this.lbContaminationDTLCode.LabelStyle = ComponentFactory.Krypton.Toolkit.LabelStyle.TitleControl;
|
||||
this.lbContaminationDTLCode.Location = new System.Drawing.Point(23, 76);
|
||||
this.lbContaminationDTLCode.Name = "lbContaminationDTLCode";
|
||||
this.lbContaminationDTLCode.Size = new System.Drawing.Size(115, 26);
|
||||
this.lbContaminationDTLCode.StateCommon.ShortText.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.lbContaminationDTLCode.TabIndex = 36;
|
||||
this.lbContaminationDTLCode.Values.Text = "污染明细编码:";
|
||||
//
|
||||
// btnEdit
|
||||
//
|
||||
this.btnEdit.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.btnEdit.Location = new System.Drawing.Point(228, 231);
|
||||
this.btnEdit.Name = "btnEdit";
|
||||
this.btnEdit.Size = new System.Drawing.Size(82, 40);
|
||||
this.btnEdit.StateCommon.Content.ShortText.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.btnEdit.TabIndex = 35;
|
||||
this.btnEdit.Values.Text = "取消";
|
||||
this.btnEdit.Click += new System.EventHandler(this.btnEdit_Click);
|
||||
//
|
||||
// btnAdd
|
||||
//
|
||||
this.btnAdd.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.btnAdd.Location = new System.Drawing.Point(23, 231);
|
||||
this.btnAdd.Name = "btnAdd";
|
||||
this.btnAdd.Size = new System.Drawing.Size(82, 40);
|
||||
this.btnAdd.StateCommon.Content.ShortText.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.btnAdd.TabIndex = 34;
|
||||
this.btnAdd.Values.Text = "确认";
|
||||
this.btnAdd.Click += new System.EventHandler(this.btnAdd_Click);
|
||||
//
|
||||
// frmAddContaminationDtl
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(334, 290);
|
||||
this.Controls.Add(this.kryptonPanel1);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "frmAddContaminationDtl";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||
this.Text = "AddContaminationDtl";
|
||||
this.Load += new System.EventHandler(this.frmAddContaminationDtl_Load);
|
||||
((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).EndInit();
|
||||
this.kryptonPanel1.ResumeLayout(false);
|
||||
this.kryptonPanel1.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.cmbContaminationType)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonPanel kryptonPanel1;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonButton btnEdit;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonButton btnAdd;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonComboBox cmbContaminationType;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonTextBox txtContaminationDTLName;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonTextBox txtContaminationDTLCode;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonLabel lbContaminationType;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonLabel lbContaminationDTLName;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonLabel lbContaminationDTLCode;
|
||||
}
|
||||
}
|
||||
164
CleanMachineHMI/frmChild/frmAddContaminationDtl.cs
Normal file
164
CleanMachineHMI/frmChild/frmAddContaminationDtl.cs
Normal file
@@ -0,0 +1,164 @@
|
||||
using CleanMachineHMI.forms;
|
||||
using CleanMachineHMI.FrmUserControl;
|
||||
using CleanMachineHMI.Utils;
|
||||
using ComponentFactory.Krypton.Toolkit;
|
||||
using LeadDataBaseUtility;
|
||||
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.Web.UI.WebControls;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace CleanMachineHMI.frmChild
|
||||
{
|
||||
public partial class frmAddContaminationDtl : KryptonForm
|
||||
{
|
||||
public frmAddContaminationDtl()
|
||||
{
|
||||
InitializeComponent();
|
||||
_InfoLanguageTextList = this.GetInfoLanguageText(GlobalHelper.LanguageCode);
|
||||
}
|
||||
private DataTable _InfoLanguageTextList;
|
||||
private void txt_GotFocus(object sender, EventArgs e)
|
||||
{
|
||||
KeyboardAutoPopUp.ShowInputPanel();
|
||||
}
|
||||
private void txt_LostFocus(object sender, EventArgs e)
|
||||
{
|
||||
KeyboardAutoPopUp.HideInputPanel();
|
||||
}
|
||||
private void InitControlEvent()
|
||||
{
|
||||
txtContaminationDTLCode.GotFocus += new EventHandler(txt_GotFocus); //获取焦点前发生事件
|
||||
txtContaminationDTLCode.LostFocus += new EventHandler(txt_LostFocus); //失去焦点后发生事件
|
||||
|
||||
txtContaminationDTLName.GotFocus += new EventHandler(txt_GotFocus); //获取焦点前发生事件
|
||||
txtContaminationDTLName.LostFocus += new EventHandler(txt_LostFocus); //失去焦点后发生事件
|
||||
}
|
||||
|
||||
private void frmAddContaminationDtl_Load(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
InitControlEvent();
|
||||
this.SetFormControlText(GlobalHelper.LanguageCode);
|
||||
string sql = $@"select CONTAMINATION_TYPE_CODE,CONTAMINATION_TYPE_NAME from BAS_CONTAMINATION_TYPE where DEL_FLAG=0";
|
||||
DataTable dt = LeadDbHelperSQLite.Query(sql).Tables[0];
|
||||
if (dt != null && dt.Rows.Count > 0)
|
||||
{
|
||||
cmbContaminationType.Items.Add(new ListItem
|
||||
{
|
||||
Value = "0",
|
||||
Text = "Please Select",
|
||||
});
|
||||
foreach (DataRow item in dt.Rows)
|
||||
{
|
||||
cmbContaminationType.Items.Add(new ListItem
|
||||
{
|
||||
Value = item["CONTAMINATION_TYPE_CODE"].ToString(),
|
||||
Text = item["CONTAMINATION_TYPE_NAME"].ToString(),
|
||||
});
|
||||
}
|
||||
cmbContaminationType.SelectedIndex = 0;
|
||||
}
|
||||
kryptonPanel1.Focus();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("新增污染明细界面加载异常", "LoadAddFrmExp") + $":【{ex.Message}】!");
|
||||
}
|
||||
}
|
||||
|
||||
private void btnAdd_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (cmbContaminationType.SelectedIndex == 0)
|
||||
{
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请选择污染类型!", "SelectContaminationTypeInfo"));
|
||||
return;
|
||||
}
|
||||
if (string.IsNullOrEmpty(txtContaminationDTLCode.Text))
|
||||
{
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请输入污染明细编码!", "EnterContaminationDtlCodeInfo"));
|
||||
return;
|
||||
}
|
||||
if (string.IsNullOrEmpty(txtContaminationDTLName.Text))
|
||||
{
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请输入污染明细名称!", "EnterContaminationDtlNameInfo"));
|
||||
return;
|
||||
}
|
||||
string sqlIsExistCode = $@"SELECT 1 FROM BAS_CONTAMINATION_DTL WHERE CONTAMINATION_TYPE_CODE = '{((ListItem)cmbContaminationType.SelectedItem).Value}' AND CONTAMINATION_DTL_CODE = '{txtContaminationDTLCode.Text}'";
|
||||
DataTable dtIsExistCode = LeadDbHelperSQLite.Query(sqlIsExistCode).Tables[0];
|
||||
if (dtIsExistCode != null && dtIsExistCode.Rows.Count > 0)
|
||||
{
|
||||
//KryptonMessageBox.Show($"污染明细条码:【{txtContaminationDTLCode.Text}】已经存在,请重新输入!");
|
||||
KryptonMessageBox.Show($"Pollution detail code: 【{txtContaminationDTLCode.Text}】already exist, please re-enter!");
|
||||
return;
|
||||
}
|
||||
string sql = $@"
|
||||
INSERT INTO BAS_CONTAMINATION_DTL (
|
||||
CONTAMINATION_TYPE_CODE,
|
||||
CONTAMINATION_DTL_CODE,
|
||||
CONTAMINATION_DTL_NAME,
|
||||
USED_FLAG,
|
||||
DEL_FLAG,
|
||||
CREATE_BY,
|
||||
CREATE_TIME,
|
||||
UPDATE_BY,
|
||||
UPDATE_TIME,
|
||||
DATA_VERSION,
|
||||
REMARKS1,
|
||||
REMARKS2,
|
||||
REMARKS3,
|
||||
REMARKS4,
|
||||
REMARKS5
|
||||
)
|
||||
VALUES
|
||||
(
|
||||
'{((ListItem)cmbContaminationType.SelectedItem).Value}',
|
||||
'{txtContaminationDTLCode.Text}',
|
||||
'{txtContaminationDTLName.Text}',
|
||||
1,
|
||||
0,
|
||||
'{GlobalHelper.UserInfo.USER_ID}',
|
||||
datetime('now', 'localtime'),
|
||||
'{GlobalHelper.UserInfo.USER_ID}',
|
||||
datetime('now', 'localtime'),
|
||||
0,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL
|
||||
);
|
||||
";
|
||||
int row = LeadDbHelperSQLite.ExecuteSql(sql);
|
||||
if (row > 0)
|
||||
{
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("新增污染明细数据成功!", "AddSuccessInfo"));
|
||||
frmContaminationDTL.RefreshFrmHost();
|
||||
this.Close();
|
||||
}
|
||||
else
|
||||
{
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("新增污染明细数据失败!", "AddFailInfo"));
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("新增污染明细数据发生异常", "AddContaminationDtlDataExp") + $":【{ex.Message}】!");
|
||||
}
|
||||
}
|
||||
|
||||
private void btnEdit_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
120
CleanMachineHMI/frmChild/frmAddContaminationDtl.resx
Normal file
120
CleanMachineHMI/frmChild/frmAddContaminationDtl.resx
Normal file
@@ -0,0 +1,120 @@
|
||||
<?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>
|
||||
196
CleanMachineHMI/frmChild/frmAddContaminationType.Designer.cs
generated
Normal file
196
CleanMachineHMI/frmChild/frmAddContaminationType.Designer.cs
generated
Normal file
@@ -0,0 +1,196 @@
|
||||
namespace CleanMachineHMI.frmChild
|
||||
{
|
||||
partial class frmAddContaminationType
|
||||
{
|
||||
/// <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.kryptonPanel1 = new ComponentFactory.Krypton.Toolkit.KryptonPanel();
|
||||
this.cmbCleanMode = new ComponentFactory.Krypton.Toolkit.KryptonComboBox();
|
||||
this.txtContaminationTypeName = new ComponentFactory.Krypton.Toolkit.KryptonTextBox();
|
||||
this.txtContaminationTypeCode = new ComponentFactory.Krypton.Toolkit.KryptonTextBox();
|
||||
this.lbCleanMode = new ComponentFactory.Krypton.Toolkit.KryptonLabel();
|
||||
this.lbContaminationTypeName = new ComponentFactory.Krypton.Toolkit.KryptonLabel();
|
||||
this.lbContaminationTypeCode = new ComponentFactory.Krypton.Toolkit.KryptonLabel();
|
||||
this.btnEdit = new ComponentFactory.Krypton.Toolkit.KryptonButton();
|
||||
this.btnAdd = new ComponentFactory.Krypton.Toolkit.KryptonButton();
|
||||
((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit();
|
||||
this.kryptonPanel1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.cmbCleanMode)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// kryptonPanel1
|
||||
//
|
||||
this.kryptonPanel1.Controls.Add(this.cmbCleanMode);
|
||||
this.kryptonPanel1.Controls.Add(this.txtContaminationTypeName);
|
||||
this.kryptonPanel1.Controls.Add(this.txtContaminationTypeCode);
|
||||
this.kryptonPanel1.Controls.Add(this.lbCleanMode);
|
||||
this.kryptonPanel1.Controls.Add(this.lbContaminationTypeName);
|
||||
this.kryptonPanel1.Controls.Add(this.lbContaminationTypeCode);
|
||||
this.kryptonPanel1.Controls.Add(this.btnEdit);
|
||||
this.kryptonPanel1.Controls.Add(this.btnAdd);
|
||||
this.kryptonPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.kryptonPanel1.Location = new System.Drawing.Point(0, 0);
|
||||
this.kryptonPanel1.Name = "kryptonPanel1";
|
||||
this.kryptonPanel1.Size = new System.Drawing.Size(289, 290);
|
||||
this.kryptonPanel1.TabIndex = 4;
|
||||
//
|
||||
// cmbCleanMode
|
||||
//
|
||||
this.cmbCleanMode.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.cmbCleanMode.DropDownWidth = 271;
|
||||
this.cmbCleanMode.Location = new System.Drawing.Point(15, 39);
|
||||
this.cmbCleanMode.Name = "cmbCleanMode";
|
||||
this.cmbCleanMode.Size = new System.Drawing.Size(261, 31);
|
||||
this.cmbCleanMode.StateCommon.ComboBox.Content.Font = new System.Drawing.Font("微软雅黑", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.cmbCleanMode.TabIndex = 41;
|
||||
//
|
||||
// txtContaminationTypeName
|
||||
//
|
||||
this.txtContaminationTypeName.AlwaysActive = false;
|
||||
this.txtContaminationTypeName.Location = new System.Drawing.Point(15, 174);
|
||||
this.txtContaminationTypeName.Name = "txtContaminationTypeName";
|
||||
this.txtContaminationTypeName.PaletteMode = ComponentFactory.Krypton.Toolkit.PaletteMode.ProfessionalOffice2003;
|
||||
this.txtContaminationTypeName.Size = new System.Drawing.Size(261, 35);
|
||||
this.txtContaminationTypeName.StateActive.Border.Color1 = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(255)))));
|
||||
this.txtContaminationTypeName.StateActive.Border.DrawBorders = ((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders)((((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Top | ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Bottom)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Left)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Right)));
|
||||
this.txtContaminationTypeName.StateCommon.Border.DrawBorders = ((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders)((((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Top | ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Bottom)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Left)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Right)));
|
||||
this.txtContaminationTypeName.StateCommon.Border.GraphicsHint = ComponentFactory.Krypton.Toolkit.PaletteGraphicsHint.AntiAlias;
|
||||
this.txtContaminationTypeName.StateCommon.Border.Rounding = 4;
|
||||
this.txtContaminationTypeName.StateCommon.Border.Width = 2;
|
||||
this.txtContaminationTypeName.StateCommon.Content.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.txtContaminationTypeName.TabIndex = 40;
|
||||
//
|
||||
// txtContaminationTypeCode
|
||||
//
|
||||
this.txtContaminationTypeCode.AlwaysActive = false;
|
||||
this.txtContaminationTypeCode.Location = new System.Drawing.Point(15, 103);
|
||||
this.txtContaminationTypeCode.Name = "txtContaminationTypeCode";
|
||||
this.txtContaminationTypeCode.PaletteMode = ComponentFactory.Krypton.Toolkit.PaletteMode.ProfessionalOffice2003;
|
||||
this.txtContaminationTypeCode.Size = new System.Drawing.Size(261, 35);
|
||||
this.txtContaminationTypeCode.StateActive.Border.Color1 = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(255)))));
|
||||
this.txtContaminationTypeCode.StateActive.Border.DrawBorders = ((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders)((((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Top | ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Bottom)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Left)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Right)));
|
||||
this.txtContaminationTypeCode.StateCommon.Border.DrawBorders = ((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders)((((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Top | ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Bottom)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Left)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Right)));
|
||||
this.txtContaminationTypeCode.StateCommon.Border.GraphicsHint = ComponentFactory.Krypton.Toolkit.PaletteGraphicsHint.AntiAlias;
|
||||
this.txtContaminationTypeCode.StateCommon.Border.Rounding = 4;
|
||||
this.txtContaminationTypeCode.StateCommon.Border.Width = 2;
|
||||
this.txtContaminationTypeCode.StateCommon.Content.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.txtContaminationTypeCode.TabIndex = 39;
|
||||
//
|
||||
// lbCleanMode
|
||||
//
|
||||
this.lbCleanMode.LabelStyle = ComponentFactory.Krypton.Toolkit.LabelStyle.TitleControl;
|
||||
this.lbCleanMode.Location = new System.Drawing.Point(15, 12);
|
||||
this.lbCleanMode.Name = "lbCleanMode";
|
||||
this.lbCleanMode.Size = new System.Drawing.Size(82, 26);
|
||||
this.lbCleanMode.StateCommon.ShortText.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.lbCleanMode.TabIndex = 38;
|
||||
this.lbCleanMode.Values.Text = "清洁方式:";
|
||||
//
|
||||
// lbContaminationTypeName
|
||||
//
|
||||
this.lbContaminationTypeName.LabelStyle = ComponentFactory.Krypton.Toolkit.LabelStyle.TitleControl;
|
||||
this.lbContaminationTypeName.Location = new System.Drawing.Point(15, 147);
|
||||
this.lbContaminationTypeName.Name = "lbContaminationTypeName";
|
||||
this.lbContaminationTypeName.Size = new System.Drawing.Size(115, 26);
|
||||
this.lbContaminationTypeName.StateCommon.ShortText.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.lbContaminationTypeName.TabIndex = 37;
|
||||
this.lbContaminationTypeName.Values.Text = "污染类型名称:";
|
||||
//
|
||||
// lbContaminationTypeCode
|
||||
//
|
||||
this.lbContaminationTypeCode.LabelStyle = ComponentFactory.Krypton.Toolkit.LabelStyle.TitleControl;
|
||||
this.lbContaminationTypeCode.Location = new System.Drawing.Point(15, 76);
|
||||
this.lbContaminationTypeCode.Name = "lbContaminationTypeCode";
|
||||
this.lbContaminationTypeCode.Size = new System.Drawing.Size(115, 26);
|
||||
this.lbContaminationTypeCode.StateCommon.ShortText.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.lbContaminationTypeCode.TabIndex = 36;
|
||||
this.lbContaminationTypeCode.Values.Text = "污染类型编码:";
|
||||
//
|
||||
// btnEdit
|
||||
//
|
||||
this.btnEdit.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.btnEdit.Location = new System.Drawing.Point(183, 229);
|
||||
this.btnEdit.Name = "btnEdit";
|
||||
this.btnEdit.Size = new System.Drawing.Size(82, 40);
|
||||
this.btnEdit.StateCommon.Content.ShortText.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.btnEdit.TabIndex = 35;
|
||||
this.btnEdit.Values.Text = "取消";
|
||||
this.btnEdit.Click += new System.EventHandler(this.btnEdit_Click);
|
||||
//
|
||||
// btnAdd
|
||||
//
|
||||
this.btnAdd.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.btnAdd.Location = new System.Drawing.Point(23, 229);
|
||||
this.btnAdd.Name = "btnAdd";
|
||||
this.btnAdd.Size = new System.Drawing.Size(82, 40);
|
||||
this.btnAdd.StateCommon.Content.ShortText.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.btnAdd.TabIndex = 34;
|
||||
this.btnAdd.Values.Text = "确认";
|
||||
this.btnAdd.Click += new System.EventHandler(this.btnAdd_Click);
|
||||
//
|
||||
// frmAddContaminationType
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(289, 290);
|
||||
this.Controls.Add(this.kryptonPanel1);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "frmAddContaminationType";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||
this.Text = "AddContaminationType";
|
||||
this.Load += new System.EventHandler(this.frmAddContaminationType_Load);
|
||||
((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).EndInit();
|
||||
this.kryptonPanel1.ResumeLayout(false);
|
||||
this.kryptonPanel1.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.cmbCleanMode)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonPanel kryptonPanel1;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonButton btnEdit;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonButton btnAdd;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonComboBox cmbCleanMode;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonTextBox txtContaminationTypeName;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonTextBox txtContaminationTypeCode;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonLabel lbCleanMode;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonLabel lbContaminationTypeName;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonLabel lbContaminationTypeCode;
|
||||
}
|
||||
}
|
||||
166
CleanMachineHMI/frmChild/frmAddContaminationType.cs
Normal file
166
CleanMachineHMI/frmChild/frmAddContaminationType.cs
Normal file
@@ -0,0 +1,166 @@
|
||||
using CleanMachineHMI.forms;
|
||||
using CleanMachineHMI.FrmUserControl;
|
||||
using CleanMachineHMI.Utils;
|
||||
using ComponentFactory.Krypton.Toolkit;
|
||||
using LeadDataBaseUtility;
|
||||
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.Web.UI.WebControls;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace CleanMachineHMI.frmChild
|
||||
{
|
||||
public partial class frmAddContaminationType : KryptonForm
|
||||
{
|
||||
public frmAddContaminationType()
|
||||
{
|
||||
InitializeComponent();
|
||||
_InfoLanguageTextList = this.GetInfoLanguageText(GlobalHelper.LanguageCode);
|
||||
}
|
||||
private DataTable _InfoLanguageTextList;
|
||||
private void txt_GotFocus(object sender, EventArgs e)
|
||||
{
|
||||
KeyboardAutoPopUp.ShowInputPanel();
|
||||
}
|
||||
private void txt_LostFocus(object sender, EventArgs e)
|
||||
{
|
||||
KeyboardAutoPopUp.HideInputPanel();
|
||||
}
|
||||
private void InitControlEvent()
|
||||
{
|
||||
txtContaminationTypeCode.GotFocus += new EventHandler(txt_GotFocus); //获取焦点前发生事件
|
||||
txtContaminationTypeCode.LostFocus += new EventHandler(txt_LostFocus); //失去焦点后发生事件
|
||||
|
||||
txtContaminationTypeName.GotFocus += new EventHandler(txt_GotFocus); //获取焦点前发生事件
|
||||
txtContaminationTypeName.LostFocus += new EventHandler(txt_LostFocus); //失去焦点后发生事件
|
||||
}
|
||||
|
||||
private void frmAddContaminationType_Load(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
InitControlEvent();
|
||||
this.SetFormControlText(GlobalHelper.LanguageCode);
|
||||
string sql = $@"select CLEAN_MODE_CODE,CLEAN_MODE_NAME from BAS_CLEAN_MODE where DEL_FLAG=0";
|
||||
DataTable dt = LeadDbHelperSQLite.Query(sql).Tables[0];
|
||||
if (dt != null && dt.Rows.Count > 0)
|
||||
{
|
||||
cmbCleanMode.Items.Add(new ListItem
|
||||
{
|
||||
Value = "0",
|
||||
Text = "Please Select",
|
||||
});
|
||||
foreach (DataRow item in dt.Rows)
|
||||
{
|
||||
cmbCleanMode.Items.Add(new ListItem
|
||||
{
|
||||
Value = item["CLEAN_MODE_CODE"].ToString(),
|
||||
Text = item["CLEAN_MODE_NAME"].ToString(),
|
||||
});
|
||||
}
|
||||
cmbCleanMode.SelectedIndex = 0;
|
||||
}
|
||||
kryptonPanel1.Focus();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("新增污染类型界面加载异常", "LoadAddFrmExp") + $":【{ex.Message}】!");
|
||||
}
|
||||
}
|
||||
|
||||
private void btnAdd_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (cmbCleanMode.SelectedIndex == 0)
|
||||
{
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请选择清洗方式!", "SelectCleanModeInfo"));
|
||||
return;
|
||||
}
|
||||
if (string.IsNullOrEmpty(txtContaminationTypeCode.Text))
|
||||
{
|
||||
//KryptonMessageBox.Show("请输入污染类型编码!");
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请输入污染类型编码!", "EnterContaminationTypeCodeInfo"));
|
||||
return;
|
||||
}
|
||||
if (string.IsNullOrEmpty(txtContaminationTypeName.Text))
|
||||
{
|
||||
//KryptonMessageBox.Show("请输入污染类型名称!");
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请输入污染类型名称!", "EnterContaminationTypeNameInfo"));
|
||||
return;
|
||||
}
|
||||
string sqlIsExistCode = $@"SELECT 1 FROM BAS_CONTAMINATION_TYPE WHERE CLEAN_MODE_CODE = '{((ListItem)cmbCleanMode.SelectedItem).Value}' AND CONTAMINATION_TYPE_CODE = '{txtContaminationTypeCode.Text}'";
|
||||
DataTable dtIsExistCode = LeadDbHelperSQLite.Query(sqlIsExistCode).Tables[0];
|
||||
if (dtIsExistCode != null && dtIsExistCode.Rows.Count > 0)
|
||||
{
|
||||
//KryptonMessageBox.Show($"污染类型条码:【{txtContaminationTypeCode.Text}】已经存在,请重新输入!");
|
||||
KryptonMessageBox.Show($"Pollution type code: 【{txtContaminationTypeCode.Text}】already exist, please re-enter!");
|
||||
return;
|
||||
}
|
||||
string sql = $@"
|
||||
INSERT INTO BAS_CONTAMINATION_TYPE (
|
||||
CONTAMINATION_TYPE_CODE,
|
||||
CONTAMINATION_TYPE_NAME,
|
||||
CLEAN_MODE_CODE,
|
||||
USED_FLAG,
|
||||
DEL_FLAG,
|
||||
CREATE_BY,
|
||||
CREATE_TIME,
|
||||
UPDATE_BY,
|
||||
UPDATE_TIME,
|
||||
DATA_VERSION,
|
||||
REMARKS1,
|
||||
REMARKS2,
|
||||
REMARKS3,
|
||||
REMARKS4,
|
||||
REMARKS5
|
||||
)
|
||||
VALUES
|
||||
(
|
||||
'{txtContaminationTypeCode.Text}',
|
||||
'{txtContaminationTypeName.Text}',
|
||||
'{((ListItem)cmbCleanMode.SelectedItem).Value}',
|
||||
1,
|
||||
0,
|
||||
'{GlobalHelper.UserInfo.USER_ID}',
|
||||
datetime('now', 'localtime'),
|
||||
'{GlobalHelper.UserInfo.USER_ID}',
|
||||
datetime('now', 'localtime'),
|
||||
0,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL
|
||||
);
|
||||
";
|
||||
int row = LeadDbHelperSQLite.ExecuteSql(sql);
|
||||
if (row > 0)
|
||||
{
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("新增污染类型数据成功!", "AddSuccessInfo"));
|
||||
frmContaminationType.RefreshFrmHost();
|
||||
this.Close();
|
||||
}
|
||||
else
|
||||
{
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("新增污染类型数据失败!", "AddFailInfo"));
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("新增污染类型数据发生异常", "AddContaminationTypeDataExp") + $":【{ex.Message}】!");
|
||||
}
|
||||
}
|
||||
|
||||
private void btnEdit_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
120
CleanMachineHMI/frmChild/frmAddContaminationType.resx
Normal file
120
CleanMachineHMI/frmChild/frmAddContaminationType.resx
Normal file
@@ -0,0 +1,120 @@
|
||||
<?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>
|
||||
250
CleanMachineHMI/frmChild/frmAddPlcItem.Designer.cs
generated
Normal file
250
CleanMachineHMI/frmChild/frmAddPlcItem.Designer.cs
generated
Normal file
@@ -0,0 +1,250 @@
|
||||
namespace CleanMachineHMI.frmChild
|
||||
{
|
||||
partial class frmAddPlcItem
|
||||
{
|
||||
/// <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.kryptonManager = new ComponentFactory.Krypton.Toolkit.KryptonManager(this.components);
|
||||
this.kryptonPanel1 = new ComponentFactory.Krypton.Toolkit.KryptonPanel();
|
||||
this.kryptonButton1 = new ComponentFactory.Krypton.Toolkit.KryptonButton();
|
||||
this.knud_plcItemDeviationAddress = new ComponentFactory.Krypton.Toolkit.KryptonNumericUpDown();
|
||||
this.knud_plcItemPriAddress = new ComponentFactory.Krypton.Toolkit.KryptonNumericUpDown();
|
||||
this.kcmb_plcItemDataType = new ComponentFactory.Krypton.Toolkit.KryptonComboBox();
|
||||
this.kcmb_plcItemType = new ComponentFactory.Krypton.Toolkit.KryptonComboBox();
|
||||
this.ktb_plcItemName = new ComponentFactory.Krypton.Toolkit.KryptonTextBox();
|
||||
this.kryptonLabel5 = new ComponentFactory.Krypton.Toolkit.KryptonLabel();
|
||||
this.kryptonLabel4 = new ComponentFactory.Krypton.Toolkit.KryptonLabel();
|
||||
this.kryptonLabel6 = new ComponentFactory.Krypton.Toolkit.KryptonLabel();
|
||||
this.kryptonLabel3 = new ComponentFactory.Krypton.Toolkit.KryptonLabel();
|
||||
this.kryptonLabel2 = new ComponentFactory.Krypton.Toolkit.KryptonLabel();
|
||||
this.ktb_plcItemCode = new ComponentFactory.Krypton.Toolkit.KryptonTextBox();
|
||||
this.kryptonLabel1 = new ComponentFactory.Krypton.Toolkit.KryptonLabel();
|
||||
this.kryptonButton2 = new ComponentFactory.Krypton.Toolkit.KryptonButton();
|
||||
((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit();
|
||||
this.kryptonPanel1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.kcmb_plcItemDataType)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.kcmb_plcItemType)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// kryptonManager
|
||||
//
|
||||
this.kryptonManager.GlobalPaletteMode = ComponentFactory.Krypton.Toolkit.PaletteModeManager.Office2007Blue;
|
||||
//
|
||||
// kryptonPanel1
|
||||
//
|
||||
this.kryptonPanel1.Controls.Add(this.kryptonButton2);
|
||||
this.kryptonPanel1.Controls.Add(this.kryptonButton1);
|
||||
this.kryptonPanel1.Controls.Add(this.knud_plcItemDeviationAddress);
|
||||
this.kryptonPanel1.Controls.Add(this.knud_plcItemPriAddress);
|
||||
this.kryptonPanel1.Controls.Add(this.kcmb_plcItemDataType);
|
||||
this.kryptonPanel1.Controls.Add(this.kcmb_plcItemType);
|
||||
this.kryptonPanel1.Controls.Add(this.ktb_plcItemName);
|
||||
this.kryptonPanel1.Controls.Add(this.kryptonLabel5);
|
||||
this.kryptonPanel1.Controls.Add(this.kryptonLabel4);
|
||||
this.kryptonPanel1.Controls.Add(this.kryptonLabel6);
|
||||
this.kryptonPanel1.Controls.Add(this.kryptonLabel3);
|
||||
this.kryptonPanel1.Controls.Add(this.kryptonLabel2);
|
||||
this.kryptonPanel1.Controls.Add(this.ktb_plcItemCode);
|
||||
this.kryptonPanel1.Controls.Add(this.kryptonLabel1);
|
||||
this.kryptonPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.kryptonPanel1.Location = new System.Drawing.Point(0, 0);
|
||||
this.kryptonPanel1.Name = "kryptonPanel1";
|
||||
this.kryptonPanel1.Size = new System.Drawing.Size(273, 401);
|
||||
this.kryptonPanel1.TabIndex = 5;
|
||||
//
|
||||
// kryptonButton1
|
||||
//
|
||||
this.kryptonButton1.Location = new System.Drawing.Point(21, 340);
|
||||
this.kryptonButton1.Name = "kryptonButton1";
|
||||
this.kryptonButton1.Size = new System.Drawing.Size(90, 36);
|
||||
this.kryptonButton1.TabIndex = 15;
|
||||
this.kryptonButton1.Values.Text = "确认";
|
||||
this.kryptonButton1.Click += new System.EventHandler(this.kryptonButton1_Click);
|
||||
//
|
||||
// knud_plcItemDeviationAddress
|
||||
//
|
||||
this.knud_plcItemDeviationAddress.Location = new System.Drawing.Point(21, 299);
|
||||
this.knud_plcItemDeviationAddress.Maximum = new decimal(new int[] {
|
||||
50,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.knud_plcItemDeviationAddress.Name = "knud_plcItemDeviationAddress";
|
||||
this.knud_plcItemDeviationAddress.Size = new System.Drawing.Size(228, 22);
|
||||
this.knud_plcItemDeviationAddress.TabIndex = 14;
|
||||
//
|
||||
// knud_plcItemPriAddress
|
||||
//
|
||||
this.knud_plcItemPriAddress.Location = new System.Drawing.Point(21, 245);
|
||||
this.knud_plcItemPriAddress.Maximum = new decimal(new int[] {
|
||||
9999,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.knud_plcItemPriAddress.Name = "knud_plcItemPriAddress";
|
||||
this.knud_plcItemPriAddress.Size = new System.Drawing.Size(228, 22);
|
||||
this.knud_plcItemPriAddress.TabIndex = 14;
|
||||
//
|
||||
// kcmb_plcItemDataType
|
||||
//
|
||||
this.kcmb_plcItemDataType.DropDownWidth = 207;
|
||||
this.kcmb_plcItemDataType.Items.AddRange(new object[] {
|
||||
"M 布尔类型",
|
||||
"D 整数类型",
|
||||
"X 布尔类型",
|
||||
"Y 布尔类型"});
|
||||
this.kcmb_plcItemDataType.Location = new System.Drawing.Point(21, 193);
|
||||
this.kcmb_plcItemDataType.Name = "kcmb_plcItemDataType";
|
||||
this.kcmb_plcItemDataType.Size = new System.Drawing.Size(228, 21);
|
||||
this.kcmb_plcItemDataType.TabIndex = 12;
|
||||
this.kcmb_plcItemDataType.SelectionChangeCommitted += new System.EventHandler(this.kcmb_plcItemDataType_SelectionChangeCommitted);
|
||||
//
|
||||
// kcmb_plcItemType
|
||||
//
|
||||
this.kcmb_plcItemType.DropDownWidth = 207;
|
||||
this.kcmb_plcItemType.Items.AddRange(new object[] {
|
||||
"写入变量",
|
||||
"读取变量",
|
||||
"可读可写"});
|
||||
this.kcmb_plcItemType.Location = new System.Drawing.Point(21, 140);
|
||||
this.kcmb_plcItemType.Name = "kcmb_plcItemType";
|
||||
this.kcmb_plcItemType.Size = new System.Drawing.Size(228, 21);
|
||||
this.kcmb_plcItemType.TabIndex = 13;
|
||||
//
|
||||
// ktb_plcItemName
|
||||
//
|
||||
this.ktb_plcItemName.Location = new System.Drawing.Point(21, 85);
|
||||
this.ktb_plcItemName.Name = "ktb_plcItemName";
|
||||
this.ktb_plcItemName.Size = new System.Drawing.Size(228, 23);
|
||||
this.ktb_plcItemName.TabIndex = 10;
|
||||
//
|
||||
// kryptonLabel5
|
||||
//
|
||||
this.kryptonLabel5.Location = new System.Drawing.Point(24, 219);
|
||||
this.kryptonLabel5.Name = "kryptonLabel5";
|
||||
this.kryptonLabel5.Size = new System.Drawing.Size(134, 20);
|
||||
this.kryptonLabel5.TabIndex = 5;
|
||||
this.kryptonLabel5.Values.Text = "PLC变量寄存器地址:";
|
||||
//
|
||||
// kryptonLabel4
|
||||
//
|
||||
this.kryptonLabel4.Location = new System.Drawing.Point(24, 167);
|
||||
this.kryptonLabel4.Name = "kryptonLabel4";
|
||||
this.kryptonLabel4.Size = new System.Drawing.Size(121, 20);
|
||||
this.kryptonLabel4.TabIndex = 6;
|
||||
this.kryptonLabel4.Values.Text = "PLC变量数据类型:";
|
||||
//
|
||||
// kryptonLabel6
|
||||
//
|
||||
this.kryptonLabel6.Location = new System.Drawing.Point(24, 273);
|
||||
this.kryptonLabel6.Name = "kryptonLabel6";
|
||||
this.kryptonLabel6.Size = new System.Drawing.Size(121, 20);
|
||||
this.kryptonLabel6.TabIndex = 8;
|
||||
this.kryptonLabel6.Values.Text = "PLC变量偏移位置:";
|
||||
//
|
||||
// kryptonLabel3
|
||||
//
|
||||
this.kryptonLabel3.Location = new System.Drawing.Point(24, 114);
|
||||
this.kryptonLabel3.Name = "kryptonLabel3";
|
||||
this.kryptonLabel3.Size = new System.Drawing.Size(95, 20);
|
||||
this.kryptonLabel3.TabIndex = 7;
|
||||
this.kryptonLabel3.Values.Text = "PLC变量类型:";
|
||||
//
|
||||
// kryptonLabel2
|
||||
//
|
||||
this.kryptonLabel2.Location = new System.Drawing.Point(24, 63);
|
||||
this.kryptonLabel2.Name = "kryptonLabel2";
|
||||
this.kryptonLabel2.Size = new System.Drawing.Size(95, 20);
|
||||
this.kryptonLabel2.TabIndex = 8;
|
||||
this.kryptonLabel2.Values.Text = "PLC变量名称:";
|
||||
//
|
||||
// ktb_plcItemCode
|
||||
//
|
||||
this.ktb_plcItemCode.Location = new System.Drawing.Point(21, 34);
|
||||
this.ktb_plcItemCode.Name = "ktb_plcItemCode";
|
||||
this.ktb_plcItemCode.Size = new System.Drawing.Size(228, 23);
|
||||
this.ktb_plcItemCode.TabIndex = 11;
|
||||
//
|
||||
// kryptonLabel1
|
||||
//
|
||||
this.kryptonLabel1.Location = new System.Drawing.Point(24, 12);
|
||||
this.kryptonLabel1.Name = "kryptonLabel1";
|
||||
this.kryptonLabel1.Size = new System.Drawing.Size(95, 20);
|
||||
this.kryptonLabel1.TabIndex = 9;
|
||||
this.kryptonLabel1.Values.Text = "PLC变量编码:";
|
||||
//
|
||||
// kryptonButton2
|
||||
//
|
||||
this.kryptonButton2.Location = new System.Drawing.Point(159, 340);
|
||||
this.kryptonButton2.Name = "kryptonButton2";
|
||||
this.kryptonButton2.Size = new System.Drawing.Size(90, 36);
|
||||
this.kryptonButton2.TabIndex = 15;
|
||||
this.kryptonButton2.Values.Text = "取消";
|
||||
this.kryptonButton2.Click += new System.EventHandler(this.kryptonButton2_Click);
|
||||
//
|
||||
// frmAddPlcItem
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(273, 401);
|
||||
this.Controls.Add(this.kryptonPanel1);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "frmAddPlcItem";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||
this.Text = "Add PLC variable";
|
||||
this.Load += new System.EventHandler(this.frmAddPlcItem_Load);
|
||||
((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).EndInit();
|
||||
this.kryptonPanel1.ResumeLayout(false);
|
||||
this.kryptonPanel1.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.kcmb_plcItemDataType)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.kcmb_plcItemType)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
public ComponentFactory.Krypton.Toolkit.KryptonManager kryptonManager;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonPanel kryptonPanel1;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonButton kryptonButton1;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonNumericUpDown knud_plcItemPriAddress;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonComboBox kcmb_plcItemDataType;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonComboBox kcmb_plcItemType;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonTextBox ktb_plcItemName;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonLabel kryptonLabel5;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonLabel kryptonLabel4;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonLabel kryptonLabel3;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonLabel kryptonLabel2;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonTextBox ktb_plcItemCode;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonLabel kryptonLabel1;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonLabel kryptonLabel6;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonNumericUpDown knud_plcItemDeviationAddress;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonButton kryptonButton2;
|
||||
}
|
||||
}
|
||||
250
CleanMachineHMI/frmChild/frmAddPlcItem.cs
Normal file
250
CleanMachineHMI/frmChild/frmAddPlcItem.cs
Normal file
@@ -0,0 +1,250 @@
|
||||
using CleanMachineHMI.FrmUserControl;
|
||||
using CleanMachineHMI.Utils;
|
||||
using ComponentFactory.Krypton.Toolkit;
|
||||
using LeadDataBaseUtility;
|
||||
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;
|
||||
|
||||
namespace CleanMachineHMI.frmChild
|
||||
{
|
||||
public partial class frmAddPlcItem : KryptonForm
|
||||
{
|
||||
public frmAddPlcItem()
|
||||
{
|
||||
InitializeComponent();
|
||||
_ComboBoxLanguageTextList = this.GetInfoLanguageText(GlobalHelper.LanguageCode, "KryptonComboBox");
|
||||
_InfoLanguageTextList = this.GetInfoLanguageText(GlobalHelper.LanguageCode);
|
||||
}
|
||||
private DataTable _ComboBoxLanguageTextList;
|
||||
private DataTable _InfoLanguageTextList;
|
||||
|
||||
private void txt_GotFocus(object sender, EventArgs e)
|
||||
{
|
||||
KeyboardAutoPopUp.ShowInputPanel();
|
||||
}
|
||||
private void txt_LostFocus(object sender, EventArgs e)
|
||||
{
|
||||
KeyboardAutoPopUp.HideInputPanel();
|
||||
}
|
||||
private void InitControlEvent()
|
||||
{
|
||||
ktb_plcItemCode.GotFocus += new EventHandler(txt_GotFocus); //获取焦点前发生事件
|
||||
ktb_plcItemCode.LostFocus += new EventHandler(txt_LostFocus); //失去焦点后发生事件
|
||||
|
||||
ktb_plcItemName.GotFocus += new EventHandler(txt_GotFocus); //获取焦点前发生事件
|
||||
ktb_plcItemName.LostFocus += new EventHandler(txt_LostFocus); //失去焦点后发生事件
|
||||
|
||||
knud_plcItemPriAddress.GotFocus += new EventHandler(txt_GotFocus); //获取焦点前发生事件
|
||||
knud_plcItemPriAddress.LostFocus += new EventHandler(txt_LostFocus); //失去焦点后发生事件
|
||||
|
||||
knud_plcItemDeviationAddress.GotFocus += new EventHandler(txt_GotFocus); //获取焦点前发生事件
|
||||
knud_plcItemDeviationAddress.LostFocus += new EventHandler(txt_LostFocus); //失去焦点后发生事件
|
||||
}
|
||||
int modbusMinIndex = 0;
|
||||
private void frmAddPlcItem_Load(object sender, EventArgs e)
|
||||
{
|
||||
InitControlEvent();
|
||||
this.SetFormControlText(GlobalHelper.LanguageCode);
|
||||
if (GlobalHelper.LanguageCode == "English")
|
||||
{
|
||||
kcmb_plcItemType.Items.Clear();
|
||||
foreach (DataRow item in _ComboBoxLanguageTextList.GetComBoboxItemArr(kcmb_plcItemType.Name, "KryptonComboBox"))
|
||||
{
|
||||
kcmb_plcItemType.Items.Add(item["CONTROL_NAME"].ToString());
|
||||
}
|
||||
kcmb_plcItemDataType.Items.Clear();
|
||||
foreach (DataRow item in _ComboBoxLanguageTextList.GetComBoboxItemArr(kcmb_plcItemDataType.Name, "KryptonComboBox"))
|
||||
{
|
||||
kcmb_plcItemDataType.Items.Add(item["CONTROL_NAME"].ToString());
|
||||
}
|
||||
}
|
||||
kcmb_plcItemType.SelectedIndex = 0;
|
||||
kcmb_plcItemDataType.SelectedIndex = 0;
|
||||
kryptonPanel1.Focus();
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// 判断是否八进制格式字符串
|
||||
/// </summary>
|
||||
/// <param name="str"></param>
|
||||
/// <returns></returns>
|
||||
public bool IsOctal(string str)
|
||||
{
|
||||
string PATTERN = @"[0-7]+$";
|
||||
return System.Text.RegularExpressions.Regex.IsMatch(str, PATTERN);
|
||||
}
|
||||
private void kryptonButton1_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (string.IsNullOrEmpty(ktb_plcItemCode.Text))
|
||||
{
|
||||
//KryptonMessageBox.Show("请输入PLC编码");
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请输入PLC变量编码!", "EnterPlcItemCodeInfo"));
|
||||
return;
|
||||
}
|
||||
if (string.IsNullOrEmpty(ktb_plcItemName.Text))
|
||||
{
|
||||
//KryptonMessageBox.Show("请输入PLC名称");
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请输入PLC变量名称!", "EnterPlcItemNameInfo"));
|
||||
return;
|
||||
}
|
||||
if (string.IsNullOrEmpty(kcmb_plcItemType.Text))
|
||||
{
|
||||
//KryptonMessageBox.Show("请选择PLC类型");
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请选择PLC变量类型!", "SelectPlcItemTypeInfo"));
|
||||
return;
|
||||
}
|
||||
if (string.IsNullOrEmpty(kcmb_plcItemDataType.Text))
|
||||
{
|
||||
//KryptonMessageBox.Show("请选择PLC数据类型");
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请选择PLC变量数据类型!", "SelectPlcItemDataTypeInfo"));
|
||||
return;
|
||||
}
|
||||
int addPriIndex = Convert.ToInt32(knud_plcItemPriAddress.Value);
|
||||
if (kcmb_plcItemDataType.SelectedIndex == 0)
|
||||
{
|
||||
if (addPriIndex <= 1535)
|
||||
{
|
||||
modbusMinIndex = 2049;
|
||||
}
|
||||
else
|
||||
{
|
||||
modbusMinIndex = 5057;
|
||||
}
|
||||
}
|
||||
else if (kcmb_plcItemDataType.SelectedIndex == 1)
|
||||
{
|
||||
modbusMinIndex = 4097;
|
||||
}
|
||||
else if (kcmb_plcItemDataType.SelectedIndex == 2)
|
||||
{
|
||||
modbusMinIndex = 1025;
|
||||
if (!IsOctal(addPriIndex.ToString()))
|
||||
{
|
||||
//KryptonMessageBox.Show("当PLC数据类型为:【X】,输入的PLC地址只能是八进制的数字!");
|
||||
KryptonMessageBox.Show("When PLC data type is【X】, input PLC address can only be octal number!");
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if (kcmb_plcItemDataType.SelectedIndex == 3)
|
||||
{
|
||||
modbusMinIndex = 1281;
|
||||
if (!IsOctal(addPriIndex.ToString()))
|
||||
{
|
||||
//KryptonMessageBox.Show("当PLC数据类型为:【Y】,输入的PLC地址只能是八进制的数字!");
|
||||
KryptonMessageBox.Show("When PLC data type is【Y】, input PLC address can only be octal number!");
|
||||
return;
|
||||
}
|
||||
}
|
||||
int plcModbusAdd = modbusMinIndex + addPriIndex - 1;
|
||||
string sqlCheck = $@"SELECT 1 FROM BAS_PLC_ITEM WHERE PLC_ITEM_CODE = '{ktb_plcItemCode.Text}'";
|
||||
DataTable dtCheck = LeadDbHelperSQLite.Query(sqlCheck).Tables[0];
|
||||
if (dtCheck != null && dtCheck.Rows.Count > 0)
|
||||
{
|
||||
//KryptonMessageBox.Show($"PLC编码:【{ktb_plcItemCode.Text}】已经被使用,请重新输入!");
|
||||
KryptonMessageBox.Show($"PLC item code 【{0}】already exist, please re-enter");
|
||||
return;
|
||||
}
|
||||
string sql = $@"
|
||||
INSERT INTO [BAS_PLC_ITEM] (
|
||||
[PLC_ITEM_CODE],
|
||||
[PLC_ITEM_NAME],
|
||||
[PLC_ITEM_TYPE],
|
||||
[PLC_ITEM_DATA_TYPE],
|
||||
[PLC_ITEM_DATA_LENGTH],
|
||||
[PLC_ITEM_PRI_ADDRESS],
|
||||
[PLC_ITEM_MODBUS_ADDRESS],
|
||||
[PLC_ITEM_DEVIATION_ADDRESS],
|
||||
[PLC_ITEM_VALUE],
|
||||
[USED_FLAG],
|
||||
[DEL_FLAG],
|
||||
[CREATE_BY],
|
||||
[CREATE_TIME],
|
||||
[UPDATE_BY],
|
||||
[UPDATE_TIME],
|
||||
[DATA_VERSION],
|
||||
[REMARKS1],
|
||||
[REMARKS2],
|
||||
[REMARKS3],
|
||||
[REMARKS4],
|
||||
[REMARKS5]
|
||||
)
|
||||
VALUES
|
||||
(
|
||||
'{ktb_plcItemCode.Text}',
|
||||
'{ktb_plcItemName.Text}',
|
||||
'{kcmb_plcItemType.SelectedIndex}',
|
||||
'{kcmb_plcItemDataType.SelectedIndex}',
|
||||
'{0}',
|
||||
'{addPriIndex}',
|
||||
'{plcModbusAdd}',
|
||||
'{Convert.ToInt32(knud_plcItemDeviationAddress.Value)}',
|
||||
NULL,
|
||||
1,
|
||||
0,
|
||||
'{GlobalHelper.UserInfo.USER_ID}',
|
||||
datetime('now', 'localtime'),
|
||||
'{GlobalHelper.UserInfo.USER_ID}',
|
||||
datetime('now', 'localtime'),
|
||||
0,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL
|
||||
);
|
||||
";
|
||||
int row = LeadDbHelperSQLite.ExecuteSql(sql);
|
||||
if (row > 0)
|
||||
{
|
||||
//KryptonMessageBox.Show("添加PLC变量数据成功!");
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("新增PLC变量数据成功!", "AddSuccessInfo"));
|
||||
frmPlcItemConfig.RefreshFrmHost();
|
||||
this.Close();
|
||||
}
|
||||
else
|
||||
{
|
||||
//KryptonMessageBox.Show("添加PLC变量数据失败!");
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("新增PLC变量数据失败!", "AddFailInfo"));
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("新增PLC变量数据发生异常", "AddPlcItemDataExp") + $":【{ex.Message}】!");
|
||||
}
|
||||
}
|
||||
|
||||
private void kcmb_plcItemDataType_SelectionChangeCommitted(object sender, EventArgs e)
|
||||
{
|
||||
if (kcmb_plcItemDataType.SelectedIndex == 0)
|
||||
{
|
||||
knud_plcItemPriAddress.Maximum = 4095;
|
||||
}
|
||||
else if (kcmb_plcItemDataType.SelectedIndex == 1)
|
||||
{
|
||||
knud_plcItemPriAddress.Maximum = 9999;
|
||||
}
|
||||
else if (kcmb_plcItemDataType.SelectedIndex == 2)
|
||||
{
|
||||
knud_plcItemPriAddress.Maximum = 377;
|
||||
}
|
||||
else if (kcmb_plcItemDataType.SelectedIndex == 3)
|
||||
{
|
||||
knud_plcItemPriAddress.Maximum = 377;
|
||||
}
|
||||
}
|
||||
|
||||
private void kryptonButton2_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
123
CleanMachineHMI/frmChild/frmAddPlcItem.resx
Normal file
123
CleanMachineHMI/frmChild/frmAddPlcItem.resx
Normal file
@@ -0,0 +1,123 @@
|
||||
<?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="kryptonManager.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
</root>
|
||||
197
CleanMachineHMI/frmChild/frmAddRole.Designer.cs
generated
Normal file
197
CleanMachineHMI/frmChild/frmAddRole.Designer.cs
generated
Normal file
@@ -0,0 +1,197 @@
|
||||
namespace CleanMachineHMI.frmChild
|
||||
{
|
||||
partial class frmAddRole
|
||||
{
|
||||
/// <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.kryptonPanel1 = new ComponentFactory.Krypton.Toolkit.KryptonPanel();
|
||||
this.btnClose = new ComponentFactory.Krypton.Toolkit.KryptonButton();
|
||||
this.btnAdd = new ComponentFactory.Krypton.Toolkit.KryptonButton();
|
||||
this.kcmb_roleGrade = new ComponentFactory.Krypton.Toolkit.KryptonComboBox();
|
||||
this.lbGender = new ComponentFactory.Krypton.Toolkit.KryptonLabel();
|
||||
this.txtRoleName = new ComponentFactory.Krypton.Toolkit.KryptonTextBox();
|
||||
this.lbName = new ComponentFactory.Krypton.Toolkit.KryptonLabel();
|
||||
this.txtRoleCode = new ComponentFactory.Krypton.Toolkit.KryptonTextBox();
|
||||
this.lbAccount = new ComponentFactory.Krypton.Toolkit.KryptonLabel();
|
||||
((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit();
|
||||
this.kryptonPanel1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.kcmb_roleGrade)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// kryptonPanel1
|
||||
//
|
||||
this.kryptonPanel1.Controls.Add(this.btnClose);
|
||||
this.kryptonPanel1.Controls.Add(this.btnAdd);
|
||||
this.kryptonPanel1.Controls.Add(this.kcmb_roleGrade);
|
||||
this.kryptonPanel1.Controls.Add(this.lbGender);
|
||||
this.kryptonPanel1.Controls.Add(this.txtRoleName);
|
||||
this.kryptonPanel1.Controls.Add(this.lbName);
|
||||
this.kryptonPanel1.Controls.Add(this.txtRoleCode);
|
||||
this.kryptonPanel1.Controls.Add(this.lbAccount);
|
||||
this.kryptonPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.kryptonPanel1.Location = new System.Drawing.Point(0, 0);
|
||||
this.kryptonPanel1.Name = "kryptonPanel1";
|
||||
this.kryptonPanel1.Size = new System.Drawing.Size(289, 266);
|
||||
this.kryptonPanel1.TabIndex = 1;
|
||||
//
|
||||
// btnClose
|
||||
//
|
||||
this.btnClose.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.btnClose.Location = new System.Drawing.Point(179, 214);
|
||||
this.btnClose.Name = "btnClose";
|
||||
this.btnClose.Size = new System.Drawing.Size(82, 40);
|
||||
this.btnClose.StateCommon.Content.ShortText.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.btnClose.TabIndex = 35;
|
||||
this.btnClose.Values.Text = "取消";
|
||||
this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
|
||||
//
|
||||
// btnAdd
|
||||
//
|
||||
this.btnAdd.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.btnAdd.Location = new System.Drawing.Point(29, 214);
|
||||
this.btnAdd.Name = "btnAdd";
|
||||
this.btnAdd.Size = new System.Drawing.Size(82, 40);
|
||||
this.btnAdd.StateCommon.Content.ShortText.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.btnAdd.TabIndex = 34;
|
||||
this.btnAdd.Values.Text = "确认";
|
||||
this.btnAdd.Click += new System.EventHandler(this.btnAdd_Click);
|
||||
//
|
||||
// kcmb_roleGrade
|
||||
//
|
||||
this.kcmb_roleGrade.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.kcmb_roleGrade.DropDownWidth = 271;
|
||||
this.kcmb_roleGrade.Items.AddRange(new object[] {
|
||||
"请选择",
|
||||
"管理员",
|
||||
"普通用户"});
|
||||
this.kcmb_roleGrade.Location = new System.Drawing.Point(29, 172);
|
||||
this.kcmb_roleGrade.Name = "kcmb_roleGrade";
|
||||
this.kcmb_roleGrade.Size = new System.Drawing.Size(232, 31);
|
||||
this.kcmb_roleGrade.StateCommon.ComboBox.Content.Font = new System.Drawing.Font("微软雅黑", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.kcmb_roleGrade.TabIndex = 33;
|
||||
//
|
||||
// lbGender
|
||||
//
|
||||
this.lbGender.LabelStyle = ComponentFactory.Krypton.Toolkit.LabelStyle.TitleControl;
|
||||
this.lbGender.Location = new System.Drawing.Point(29, 145);
|
||||
this.lbGender.Name = "lbGender";
|
||||
this.lbGender.Size = new System.Drawing.Size(82, 26);
|
||||
this.lbGender.StateCommon.ShortText.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.lbGender.TabIndex = 30;
|
||||
this.lbGender.Values.Text = "角色级别:";
|
||||
//
|
||||
// txtRoleName
|
||||
//
|
||||
this.txtRoleName.AlwaysActive = false;
|
||||
this.txtRoleName.Location = new System.Drawing.Point(29, 104);
|
||||
this.txtRoleName.Name = "txtRoleName";
|
||||
this.txtRoleName.PaletteMode = ComponentFactory.Krypton.Toolkit.PaletteMode.ProfessionalOffice2003;
|
||||
this.txtRoleName.Size = new System.Drawing.Size(232, 35);
|
||||
this.txtRoleName.StateActive.Border.Color1 = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(255)))));
|
||||
this.txtRoleName.StateActive.Border.DrawBorders = ((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders)((((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Top | ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Bottom)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Left)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Right)));
|
||||
this.txtRoleName.StateCommon.Border.DrawBorders = ((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders)((((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Top | ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Bottom)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Left)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Right)));
|
||||
this.txtRoleName.StateCommon.Border.GraphicsHint = ComponentFactory.Krypton.Toolkit.PaletteGraphicsHint.AntiAlias;
|
||||
this.txtRoleName.StateCommon.Border.Rounding = 4;
|
||||
this.txtRoleName.StateCommon.Border.Width = 2;
|
||||
this.txtRoleName.StateCommon.Content.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.txtRoleName.TabIndex = 25;
|
||||
//
|
||||
// lbName
|
||||
//
|
||||
this.lbName.LabelStyle = ComponentFactory.Krypton.Toolkit.LabelStyle.TitleControl;
|
||||
this.lbName.Location = new System.Drawing.Point(29, 78);
|
||||
this.lbName.Name = "lbName";
|
||||
this.lbName.Size = new System.Drawing.Size(82, 26);
|
||||
this.lbName.StateCommon.ShortText.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.lbName.TabIndex = 24;
|
||||
this.lbName.Values.Text = "角色名称:";
|
||||
//
|
||||
// txtRoleCode
|
||||
//
|
||||
this.txtRoleCode.AlwaysActive = false;
|
||||
this.txtRoleCode.Location = new System.Drawing.Point(29, 37);
|
||||
this.txtRoleCode.Name = "txtRoleCode";
|
||||
this.txtRoleCode.PaletteMode = ComponentFactory.Krypton.Toolkit.PaletteMode.ProfessionalOffice2003;
|
||||
this.txtRoleCode.Size = new System.Drawing.Size(232, 35);
|
||||
this.txtRoleCode.StateActive.Border.Color1 = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(255)))));
|
||||
this.txtRoleCode.StateActive.Border.DrawBorders = ((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders)((((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Top | ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Bottom)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Left)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Right)));
|
||||
this.txtRoleCode.StateCommon.Border.DrawBorders = ((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders)((((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Top | ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Bottom)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Left)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Right)));
|
||||
this.txtRoleCode.StateCommon.Border.GraphicsHint = ComponentFactory.Krypton.Toolkit.PaletteGraphicsHint.AntiAlias;
|
||||
this.txtRoleCode.StateCommon.Border.Rounding = 4;
|
||||
this.txtRoleCode.StateCommon.Border.Width = 2;
|
||||
this.txtRoleCode.StateCommon.Content.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.txtRoleCode.TabIndex = 23;
|
||||
//
|
||||
// lbAccount
|
||||
//
|
||||
this.lbAccount.LabelStyle = ComponentFactory.Krypton.Toolkit.LabelStyle.TitleControl;
|
||||
this.lbAccount.Location = new System.Drawing.Point(29, 10);
|
||||
this.lbAccount.Name = "lbAccount";
|
||||
this.lbAccount.Size = new System.Drawing.Size(82, 26);
|
||||
this.lbAccount.StateCommon.ShortText.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.lbAccount.TabIndex = 22;
|
||||
this.lbAccount.Values.Text = "角色编码:";
|
||||
//
|
||||
// frmAddRole
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(289, 266);
|
||||
this.Controls.Add(this.kryptonPanel1);
|
||||
this.Name = "frmAddRole";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||
this.Text = "frmAddRole";
|
||||
this.Load += new System.EventHandler(this.frmAddRole_Load);
|
||||
((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).EndInit();
|
||||
this.kryptonPanel1.ResumeLayout(false);
|
||||
this.kryptonPanel1.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.kcmb_roleGrade)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonPanel kryptonPanel1;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonButton btnClose;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonButton btnAdd;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonComboBox kcmb_roleGrade;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonLabel lbGender;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonTextBox txtRoleName;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonLabel lbName;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonTextBox txtRoleCode;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonLabel lbAccount;
|
||||
}
|
||||
}
|
||||
166
CleanMachineHMI/frmChild/frmAddRole.cs
Normal file
166
CleanMachineHMI/frmChild/frmAddRole.cs
Normal file
@@ -0,0 +1,166 @@
|
||||
using CleanMachineHMI.forms;
|
||||
using CleanMachineHMI.FrmUserControl;
|
||||
using CleanMachineHMI.Utils;
|
||||
using ComponentFactory.Krypton.Toolkit;
|
||||
using LeadDataBaseUtility;
|
||||
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;
|
||||
|
||||
namespace CleanMachineHMI.frmChild
|
||||
{
|
||||
public partial class frmAddRole : KryptonForm
|
||||
{
|
||||
public frmAddRole()
|
||||
{
|
||||
InitializeComponent();
|
||||
_ComboBoxLanguageTextList = this.GetInfoLanguageText(GlobalHelper.LanguageCode, "KryptonComboBox");
|
||||
_InfoLanguageTextList = this.GetInfoLanguageText(GlobalHelper.LanguageCode);
|
||||
}
|
||||
private DataTable _ComboBoxLanguageTextList;
|
||||
private DataTable _InfoLanguageTextList;
|
||||
|
||||
private void txt_GotFocus(object sender, EventArgs e)
|
||||
{
|
||||
KeyboardAutoPopUp.ShowInputPanel();
|
||||
}
|
||||
private void txt_LostFocus(object sender, EventArgs e)
|
||||
{
|
||||
KeyboardAutoPopUp.HideInputPanel();
|
||||
}
|
||||
private void InitControlEvent()
|
||||
{
|
||||
txtRoleCode.GotFocus += new EventHandler(txt_GotFocus); //获取焦点前发生事件
|
||||
txtRoleCode.LostFocus += new EventHandler(txt_LostFocus); //失去焦点后发生事件
|
||||
|
||||
txtRoleName.GotFocus += new EventHandler(txt_GotFocus); //获取焦点前发生事件
|
||||
txtRoleName.LostFocus += new EventHandler(txt_LostFocus); //失去焦点后发生事件
|
||||
}
|
||||
|
||||
private void frmAddRole_Load(object sender, EventArgs e)
|
||||
{
|
||||
InitControlEvent();
|
||||
this.SetFormControlText(GlobalHelper.LanguageCode);
|
||||
if (GlobalHelper.LanguageCode == "English")
|
||||
{
|
||||
kcmb_roleGrade.Items.Clear();
|
||||
foreach (DataRow item in _ComboBoxLanguageTextList.GetComBoboxItemArr(kcmb_roleGrade.Name, "KryptonComboBox"))
|
||||
{
|
||||
kcmb_roleGrade.Items.Add(item["CONTROL_NAME"].ToString());
|
||||
}
|
||||
}
|
||||
kcmb_roleGrade.SelectedIndex = 0;
|
||||
kryptonPanel1.Focus();
|
||||
}
|
||||
|
||||
private void btnAdd_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (string.IsNullOrEmpty(txtRoleCode.Text))
|
||||
{
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请输入角色编码!", "EnterRoleCodeInfo"));
|
||||
return;
|
||||
}
|
||||
if (string.IsNullOrEmpty(txtRoleName.Text))
|
||||
{
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请输入角色名称!", "EnterRoleNameInfo"));
|
||||
return;
|
||||
}
|
||||
int roleGrade = 0;
|
||||
if (kcmb_roleGrade.SelectedIndex == 0)
|
||||
{
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请选择角色级别!", "SelectRoleGradeInfo"));
|
||||
return;
|
||||
}
|
||||
else if (kcmb_roleGrade.SelectedIndex == 1)
|
||||
{
|
||||
string sqlIsExistAdmin = $@"SELECT 1 FROM SYS_ROLE WHERE ROLE_GRADE = '100'";
|
||||
DataTable dtIsExistAdmin = LeadDbHelperSQLite.Query(sqlIsExistAdmin).Tables[0];
|
||||
if (dtIsExistAdmin != null && dtIsExistAdmin.Rows.Count > 0)
|
||||
{
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("管理员角色只能存在一个,请重新选择!", "AdminOnlyInfo"));
|
||||
return;
|
||||
}
|
||||
roleGrade = 100;
|
||||
}
|
||||
else
|
||||
{
|
||||
roleGrade = 1;
|
||||
}
|
||||
string sqlIsExistCode = $@"SELECT 1 FROM SYS_ROLE WHERE ROLE_CODE = '{txtRoleCode.Text}'";
|
||||
DataTable dtIsExistCode = LeadDbHelperSQLite.Query(sqlIsExistCode).Tables[0];
|
||||
if (dtIsExistCode != null && dtIsExistCode.Rows.Count > 0)
|
||||
{
|
||||
//KryptonMessageBox.Show($"角色名:【{txtRoleCode.Text}】已经存在,请重新输入!");
|
||||
KryptonMessageBox.Show($"Role name 【{txtRoleCode.Text}】already exist, please re-enter!");
|
||||
return;
|
||||
}
|
||||
|
||||
string sql = $@"
|
||||
INSERT INTO main.SYS_ROLE (
|
||||
ROLE_CODE,
|
||||
ROLE_NAME,
|
||||
ROLE_GRADE,
|
||||
USED_FLAG,
|
||||
DEL_FLAG,
|
||||
CREATE_BY,
|
||||
CREATE_TIME,
|
||||
UPDATE_BY,
|
||||
UPDATE_TIME,
|
||||
DATA_VERSION,
|
||||
REMARKS1,
|
||||
REMARKS2,
|
||||
REMARKS3,
|
||||
REMARKS4,
|
||||
REMARKS5
|
||||
)
|
||||
VALUES
|
||||
(
|
||||
'{txtRoleCode.Text}',
|
||||
'{txtRoleName.Text}',
|
||||
'{roleGrade}',
|
||||
1,
|
||||
0,
|
||||
'{GlobalHelper.UserInfo.USER_ID}',
|
||||
datetime('now', 'localtime'),
|
||||
'{GlobalHelper.UserInfo.USER_ID}',
|
||||
datetime('now', 'localtime'),
|
||||
0,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL
|
||||
);
|
||||
";
|
||||
int row = LeadDbHelperSQLite.ExecuteSql(sql);
|
||||
if (row > 0)
|
||||
{
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("新增角色数据成功!", "AddSuccessInfo"));
|
||||
frmRole.RefreshFrmHost();
|
||||
this.Close();
|
||||
}
|
||||
else
|
||||
{
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("新增角色数据失败!", "AddFailInfo"));
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("新增角色数据发生异常", "AddRoleDataExp") + $":【{ex.Message}】!");
|
||||
}
|
||||
}
|
||||
|
||||
private void btnClose_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
120
CleanMachineHMI/frmChild/frmAddRole.resx
Normal file
120
CleanMachineHMI/frmChild/frmAddRole.resx
Normal file
@@ -0,0 +1,120 @@
|
||||
<?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>
|
||||
168
CleanMachineHMI/frmChild/frmAddSheetType.Designer.cs
generated
Normal file
168
CleanMachineHMI/frmChild/frmAddSheetType.Designer.cs
generated
Normal file
@@ -0,0 +1,168 @@
|
||||
namespace CleanMachineHMI.frmChild
|
||||
{
|
||||
partial class frmAddSheetType
|
||||
{
|
||||
/// <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.kryptonPanel1 = new ComponentFactory.Krypton.Toolkit.KryptonPanel();
|
||||
this.txtSheetTypeName = new ComponentFactory.Krypton.Toolkit.KryptonTextBox();
|
||||
this.lbSheetTypeName = new ComponentFactory.Krypton.Toolkit.KryptonLabel();
|
||||
this.txtSheetTypeCode = new ComponentFactory.Krypton.Toolkit.KryptonTextBox();
|
||||
this.lbSheetTypeCode = new ComponentFactory.Krypton.Toolkit.KryptonLabel();
|
||||
this.btnEdit = new ComponentFactory.Krypton.Toolkit.KryptonButton();
|
||||
this.btnAdd = new ComponentFactory.Krypton.Toolkit.KryptonButton();
|
||||
((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit();
|
||||
this.kryptonPanel1.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// kryptonPanel1
|
||||
//
|
||||
this.kryptonPanel1.Controls.Add(this.txtSheetTypeName);
|
||||
this.kryptonPanel1.Controls.Add(this.lbSheetTypeName);
|
||||
this.kryptonPanel1.Controls.Add(this.txtSheetTypeCode);
|
||||
this.kryptonPanel1.Controls.Add(this.lbSheetTypeCode);
|
||||
this.kryptonPanel1.Controls.Add(this.btnEdit);
|
||||
this.kryptonPanel1.Controls.Add(this.btnAdd);
|
||||
this.kryptonPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.kryptonPanel1.Location = new System.Drawing.Point(0, 0);
|
||||
this.kryptonPanel1.Name = "kryptonPanel1";
|
||||
this.kryptonPanel1.Size = new System.Drawing.Size(289, 227);
|
||||
this.kryptonPanel1.TabIndex = 1;
|
||||
//
|
||||
// txtSheetTypeName
|
||||
//
|
||||
this.txtSheetTypeName.AlwaysActive = false;
|
||||
this.txtSheetTypeName.Location = new System.Drawing.Point(23, 114);
|
||||
this.txtSheetTypeName.Name = "txtSheetTypeName";
|
||||
this.txtSheetTypeName.PaletteMode = ComponentFactory.Krypton.Toolkit.PaletteMode.ProfessionalOffice2003;
|
||||
this.txtSheetTypeName.Size = new System.Drawing.Size(243, 35);
|
||||
this.txtSheetTypeName.StateActive.Border.Color1 = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(255)))));
|
||||
this.txtSheetTypeName.StateActive.Border.DrawBorders = ((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders)((((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Top | ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Bottom)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Left)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Right)));
|
||||
this.txtSheetTypeName.StateCommon.Border.DrawBorders = ((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders)((((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Top | ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Bottom)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Left)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Right)));
|
||||
this.txtSheetTypeName.StateCommon.Border.GraphicsHint = ComponentFactory.Krypton.Toolkit.PaletteGraphicsHint.AntiAlias;
|
||||
this.txtSheetTypeName.StateCommon.Border.Rounding = 4;
|
||||
this.txtSheetTypeName.StateCommon.Border.Width = 2;
|
||||
this.txtSheetTypeName.StateCommon.Content.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.txtSheetTypeName.TabIndex = 39;
|
||||
//
|
||||
// lbSheetTypeName
|
||||
//
|
||||
this.lbSheetTypeName.LabelStyle = ComponentFactory.Krypton.Toolkit.LabelStyle.TitleControl;
|
||||
this.lbSheetTypeName.Location = new System.Drawing.Point(22, 87);
|
||||
this.lbSheetTypeName.Name = "lbSheetTypeName";
|
||||
this.lbSheetTypeName.Size = new System.Drawing.Size(115, 26);
|
||||
this.lbSheetTypeName.StateCommon.ShortText.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.lbSheetTypeName.TabIndex = 38;
|
||||
this.lbSheetTypeName.Values.Text = "板材类型名称:";
|
||||
//
|
||||
// txtSheetTypeCode
|
||||
//
|
||||
this.txtSheetTypeCode.AlwaysActive = false;
|
||||
this.txtSheetTypeCode.Location = new System.Drawing.Point(23, 43);
|
||||
this.txtSheetTypeCode.Name = "txtSheetTypeCode";
|
||||
this.txtSheetTypeCode.PaletteMode = ComponentFactory.Krypton.Toolkit.PaletteMode.ProfessionalOffice2003;
|
||||
this.txtSheetTypeCode.Size = new System.Drawing.Size(243, 35);
|
||||
this.txtSheetTypeCode.StateActive.Border.Color1 = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(255)))));
|
||||
this.txtSheetTypeCode.StateActive.Border.DrawBorders = ((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders)((((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Top | ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Bottom)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Left)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Right)));
|
||||
this.txtSheetTypeCode.StateCommon.Border.DrawBorders = ((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders)((((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Top | ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Bottom)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Left)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Right)));
|
||||
this.txtSheetTypeCode.StateCommon.Border.GraphicsHint = ComponentFactory.Krypton.Toolkit.PaletteGraphicsHint.AntiAlias;
|
||||
this.txtSheetTypeCode.StateCommon.Border.Rounding = 4;
|
||||
this.txtSheetTypeCode.StateCommon.Border.Width = 2;
|
||||
this.txtSheetTypeCode.StateCommon.Content.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.txtSheetTypeCode.TabIndex = 37;
|
||||
//
|
||||
// lbSheetTypeCode
|
||||
//
|
||||
this.lbSheetTypeCode.LabelStyle = ComponentFactory.Krypton.Toolkit.LabelStyle.TitleControl;
|
||||
this.lbSheetTypeCode.Location = new System.Drawing.Point(23, 16);
|
||||
this.lbSheetTypeCode.Name = "lbSheetTypeCode";
|
||||
this.lbSheetTypeCode.Size = new System.Drawing.Size(115, 26);
|
||||
this.lbSheetTypeCode.StateCommon.ShortText.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.lbSheetTypeCode.TabIndex = 36;
|
||||
this.lbSheetTypeCode.Values.Text = "板材类型编码:";
|
||||
//
|
||||
// btnEdit
|
||||
//
|
||||
this.btnEdit.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.btnEdit.Location = new System.Drawing.Point(183, 166);
|
||||
this.btnEdit.Name = "btnEdit";
|
||||
this.btnEdit.Size = new System.Drawing.Size(82, 40);
|
||||
this.btnEdit.StateCommon.Content.ShortText.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.btnEdit.TabIndex = 35;
|
||||
this.btnEdit.Values.Text = "取消";
|
||||
this.btnEdit.Click += new System.EventHandler(this.btnEdit_Click);
|
||||
//
|
||||
// btnAdd
|
||||
//
|
||||
this.btnAdd.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.btnAdd.Location = new System.Drawing.Point(23, 166);
|
||||
this.btnAdd.Name = "btnAdd";
|
||||
this.btnAdd.Size = new System.Drawing.Size(82, 40);
|
||||
this.btnAdd.StateCommon.Content.ShortText.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.btnAdd.TabIndex = 34;
|
||||
this.btnAdd.Values.Text = "确认";
|
||||
this.btnAdd.Click += new System.EventHandler(this.btnAdd_Click);
|
||||
//
|
||||
// frmAddSheetType
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(289, 227);
|
||||
this.Controls.Add(this.kryptonPanel1);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "frmAddSheetType";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||
this.Text = "frmAddSheetType";
|
||||
this.Load += new System.EventHandler(this.frmAddSheetType_Load);
|
||||
((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).EndInit();
|
||||
this.kryptonPanel1.ResumeLayout(false);
|
||||
this.kryptonPanel1.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonPanel kryptonPanel1;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonButton btnEdit;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonButton btnAdd;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonTextBox txtSheetTypeName;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonLabel lbSheetTypeName;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonTextBox txtSheetTypeCode;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonLabel lbSheetTypeCode;
|
||||
}
|
||||
}
|
||||
135
CleanMachineHMI/frmChild/frmAddSheetType.cs
Normal file
135
CleanMachineHMI/frmChild/frmAddSheetType.cs
Normal file
@@ -0,0 +1,135 @@
|
||||
using CleanMachineHMI.forms;
|
||||
using CleanMachineHMI.FrmUserControl;
|
||||
using CleanMachineHMI.Utils;
|
||||
using ComponentFactory.Krypton.Toolkit;
|
||||
using LeadDataBaseUtility;
|
||||
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;
|
||||
|
||||
namespace CleanMachineHMI.frmChild
|
||||
{
|
||||
public partial class frmAddSheetType : KryptonForm
|
||||
{
|
||||
public frmAddSheetType()
|
||||
{
|
||||
InitializeComponent();
|
||||
_InfoLanguageTextList = this.GetInfoLanguageText(GlobalHelper.LanguageCode);
|
||||
}
|
||||
private DataTable _InfoLanguageTextList;
|
||||
|
||||
private void btnAdd_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (string.IsNullOrEmpty(txtSheetTypeCode.Text))
|
||||
{
|
||||
//KryptonMessageBox.Show("请输入板材编码!");
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请输入板材编码!", "EnterSheetTypeCodeInfo"));
|
||||
return;
|
||||
}
|
||||
if (string.IsNullOrEmpty(txtSheetTypeName.Text))
|
||||
{
|
||||
//KryptonMessageBox.Show("请输入板材名称!");
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请输入板材名称!", "EnterSheetTypeNameInfo"));
|
||||
return;
|
||||
}
|
||||
string sqlIsExistCode = $@"SELECT 1 FROM BAS_SHEET_TYPE WHERE SHEET_TYPE_CODE = '{txtSheetTypeCode.Text}'";
|
||||
DataTable dtIsExistCode = LeadDbHelperSQLite.Query(sqlIsExistCode).Tables[0];
|
||||
if (dtIsExistCode != null && dtIsExistCode.Rows.Count > 0)
|
||||
{
|
||||
//KryptonMessageBox.Show($"板材条码:【{txtSheetTypeCode.Text}】已经存在,请重新输入!");
|
||||
KryptonMessageBox.Show($"Sheet type code 【{txtSheetTypeCode.Text}】already exist, please re-enter!");
|
||||
return;
|
||||
}
|
||||
string sql = $@"
|
||||
INSERT INTO BAS_SHEET_TYPE (
|
||||
SHEET_TYPE_CODE,
|
||||
SHEET_TYPE_NAME,
|
||||
USED_FLAG,
|
||||
DEL_FLAG,
|
||||
CREATE_BY,
|
||||
CREATE_TIME,
|
||||
UPDATE_BY,
|
||||
UPDATE_TIME,
|
||||
DATA_VERSION,
|
||||
REMARKS1,
|
||||
REMARKS2,
|
||||
REMARKS3,
|
||||
REMARKS4,
|
||||
REMARKS5
|
||||
)
|
||||
VALUES
|
||||
(
|
||||
'{txtSheetTypeCode.Text}',
|
||||
'{txtSheetTypeName.Text}',
|
||||
1,
|
||||
0,
|
||||
'{GlobalHelper.UserInfo.USER_ID}',
|
||||
datetime('now', 'localtime'),
|
||||
'{GlobalHelper.UserInfo.USER_ID}',
|
||||
datetime('now', 'localtime'),
|
||||
0,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL
|
||||
);
|
||||
";
|
||||
int row = LeadDbHelperSQLite.ExecuteSql(sql);
|
||||
if (row > 0)
|
||||
{
|
||||
//KryptonMessageBox.Show("新增板材数据成功!");
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("新增板材数据成功!", "AddSuccessInfo"));
|
||||
frmSheetType.RefreshFrmHost();
|
||||
this.Close();
|
||||
}
|
||||
else
|
||||
{
|
||||
//KryptonMessageBox.Show("新增板材数据失败!");
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("新增板材数据失败!", "AddFailInfo"));
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("新增板材类型数据发生异常", "AddSheetTypeDataExp") + $":【{ex.Message}】!");
|
||||
}
|
||||
}
|
||||
|
||||
private void btnEdit_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
private void txt_GotFocus(object sender, EventArgs e)
|
||||
{
|
||||
KeyboardAutoPopUp.ShowInputPanel();
|
||||
}
|
||||
private void txt_LostFocus(object sender, EventArgs e)
|
||||
{
|
||||
KeyboardAutoPopUp.HideInputPanel();
|
||||
}
|
||||
private void InitControlEvent()
|
||||
{
|
||||
txtSheetTypeCode.GotFocus += new EventHandler(txt_GotFocus); //获取焦点前发生事件
|
||||
txtSheetTypeCode.LostFocus += new EventHandler(txt_LostFocus); //失去焦点后发生事件
|
||||
|
||||
txtSheetTypeName.GotFocus += new EventHandler(txt_GotFocus); //获取焦点前发生事件
|
||||
txtSheetTypeName.LostFocus += new EventHandler(txt_LostFocus); //失去焦点后发生事件
|
||||
}
|
||||
|
||||
private void frmAddSheetType_Load(object sender, EventArgs e)
|
||||
{
|
||||
InitControlEvent();
|
||||
this.SetFormControlText(GlobalHelper.LanguageCode);
|
||||
kryptonPanel1.Focus();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
120
CleanMachineHMI/frmChild/frmAddSheetType.resx
Normal file
120
CleanMachineHMI/frmChild/frmAddSheetType.resx
Normal file
@@ -0,0 +1,120 @@
|
||||
<?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>
|
||||
302
CleanMachineHMI/frmChild/frmAddUser.Designer.cs
generated
Normal file
302
CleanMachineHMI/frmChild/frmAddUser.Designer.cs
generated
Normal file
@@ -0,0 +1,302 @@
|
||||
namespace CleanMachineHMI.frmChild
|
||||
{
|
||||
partial class frmAddUser
|
||||
{
|
||||
/// <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.kryptonPanel1 = new ComponentFactory.Krypton.Toolkit.KryptonPanel();
|
||||
this.btnClose = new ComponentFactory.Krypton.Toolkit.KryptonButton();
|
||||
this.btnAdd = new ComponentFactory.Krypton.Toolkit.KryptonButton();
|
||||
this.cmbGender = new ComponentFactory.Krypton.Toolkit.KryptonComboBox();
|
||||
this.lbGender = new ComponentFactory.Krypton.Toolkit.KryptonLabel();
|
||||
this.txtPS1 = new ComponentFactory.Krypton.Toolkit.KryptonTextBox();
|
||||
this.lbPS1 = new ComponentFactory.Krypton.Toolkit.KryptonLabel();
|
||||
this.txtPS = new ComponentFactory.Krypton.Toolkit.KryptonTextBox();
|
||||
this.lbPS = new ComponentFactory.Krypton.Toolkit.KryptonLabel();
|
||||
this.txtName = new ComponentFactory.Krypton.Toolkit.KryptonTextBox();
|
||||
this.lbName = new ComponentFactory.Krypton.Toolkit.KryptonLabel();
|
||||
this.txtAccount = new ComponentFactory.Krypton.Toolkit.KryptonTextBox();
|
||||
this.lbAccount = new ComponentFactory.Krypton.Toolkit.KryptonLabel();
|
||||
this.klb_Role = new ComponentFactory.Krypton.Toolkit.KryptonLabel();
|
||||
this.kcmb_Role = new ComponentFactory.Krypton.Toolkit.KryptonComboBox();
|
||||
((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit();
|
||||
this.kryptonPanel1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.cmbGender)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.kcmb_Role)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// kryptonPanel1
|
||||
//
|
||||
this.kryptonPanel1.Controls.Add(this.btnClose);
|
||||
this.kryptonPanel1.Controls.Add(this.btnAdd);
|
||||
this.kryptonPanel1.Controls.Add(this.kcmb_Role);
|
||||
this.kryptonPanel1.Controls.Add(this.cmbGender);
|
||||
this.kryptonPanel1.Controls.Add(this.klb_Role);
|
||||
this.kryptonPanel1.Controls.Add(this.lbGender);
|
||||
this.kryptonPanel1.Controls.Add(this.txtPS1);
|
||||
this.kryptonPanel1.Controls.Add(this.lbPS1);
|
||||
this.kryptonPanel1.Controls.Add(this.txtPS);
|
||||
this.kryptonPanel1.Controls.Add(this.lbPS);
|
||||
this.kryptonPanel1.Controls.Add(this.txtName);
|
||||
this.kryptonPanel1.Controls.Add(this.lbName);
|
||||
this.kryptonPanel1.Controls.Add(this.txtAccount);
|
||||
this.kryptonPanel1.Controls.Add(this.lbAccount);
|
||||
this.kryptonPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.kryptonPanel1.Location = new System.Drawing.Point(0, 0);
|
||||
this.kryptonPanel1.Name = "kryptonPanel1";
|
||||
this.kryptonPanel1.Size = new System.Drawing.Size(289, 483);
|
||||
this.kryptonPanel1.TabIndex = 0;
|
||||
//
|
||||
// btnClose
|
||||
//
|
||||
this.btnClose.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.btnClose.Location = new System.Drawing.Point(179, 422);
|
||||
this.btnClose.Name = "btnClose";
|
||||
this.btnClose.Size = new System.Drawing.Size(82, 40);
|
||||
this.btnClose.StateCommon.Content.ShortText.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.btnClose.TabIndex = 35;
|
||||
this.btnClose.Values.Text = "取消";
|
||||
this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
|
||||
//
|
||||
// btnAdd
|
||||
//
|
||||
this.btnAdd.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.btnAdd.Location = new System.Drawing.Point(29, 422);
|
||||
this.btnAdd.Name = "btnAdd";
|
||||
this.btnAdd.Size = new System.Drawing.Size(82, 40);
|
||||
this.btnAdd.StateCommon.Content.ShortText.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.btnAdd.TabIndex = 34;
|
||||
this.btnAdd.Values.Text = "确认";
|
||||
this.btnAdd.Click += new System.EventHandler(this.btnAdd_Click);
|
||||
//
|
||||
// cmbGender
|
||||
//
|
||||
this.cmbGender.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.cmbGender.DropDownWidth = 271;
|
||||
this.cmbGender.Items.AddRange(new object[] {
|
||||
"请选择",
|
||||
"男",
|
||||
"女"});
|
||||
this.cmbGender.Location = new System.Drawing.Point(29, 305);
|
||||
this.cmbGender.Name = "cmbGender";
|
||||
this.cmbGender.Size = new System.Drawing.Size(232, 31);
|
||||
this.cmbGender.StateCommon.ComboBox.Content.Font = new System.Drawing.Font("微软雅黑", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.cmbGender.TabIndex = 33;
|
||||
//
|
||||
// lbGender
|
||||
//
|
||||
this.lbGender.LabelStyle = ComponentFactory.Krypton.Toolkit.LabelStyle.TitleControl;
|
||||
this.lbGender.Location = new System.Drawing.Point(29, 278);
|
||||
this.lbGender.Name = "lbGender";
|
||||
this.lbGender.Size = new System.Drawing.Size(49, 26);
|
||||
this.lbGender.StateCommon.ShortText.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.lbGender.TabIndex = 30;
|
||||
this.lbGender.Values.Text = "性别:";
|
||||
//
|
||||
// txtPS1
|
||||
//
|
||||
this.txtPS1.AlwaysActive = false;
|
||||
this.txtPS1.Location = new System.Drawing.Point(29, 237);
|
||||
this.txtPS1.Name = "txtPS1";
|
||||
this.txtPS1.PaletteMode = ComponentFactory.Krypton.Toolkit.PaletteMode.ProfessionalOffice2003;
|
||||
this.txtPS1.PasswordChar = '*';
|
||||
this.txtPS1.Size = new System.Drawing.Size(232, 35);
|
||||
this.txtPS1.StateActive.Border.Color1 = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(255)))));
|
||||
this.txtPS1.StateActive.Border.DrawBorders = ((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders)((((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Top | ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Bottom)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Left)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Right)));
|
||||
this.txtPS1.StateCommon.Border.DrawBorders = ((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders)((((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Top | ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Bottom)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Left)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Right)));
|
||||
this.txtPS1.StateCommon.Border.GraphicsHint = ComponentFactory.Krypton.Toolkit.PaletteGraphicsHint.AntiAlias;
|
||||
this.txtPS1.StateCommon.Border.Rounding = 4;
|
||||
this.txtPS1.StateCommon.Border.Width = 2;
|
||||
this.txtPS1.StateCommon.Content.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.txtPS1.TabIndex = 29;
|
||||
//
|
||||
// lbPS1
|
||||
//
|
||||
this.lbPS1.LabelStyle = ComponentFactory.Krypton.Toolkit.LabelStyle.TitleControl;
|
||||
this.lbPS1.Location = new System.Drawing.Point(29, 211);
|
||||
this.lbPS1.Name = "lbPS1";
|
||||
this.lbPS1.Size = new System.Drawing.Size(82, 26);
|
||||
this.lbPS1.StateCommon.ShortText.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.lbPS1.TabIndex = 28;
|
||||
this.lbPS1.Values.Text = "密码确认:";
|
||||
//
|
||||
// txtPS
|
||||
//
|
||||
this.txtPS.AlwaysActive = false;
|
||||
this.txtPS.Location = new System.Drawing.Point(29, 170);
|
||||
this.txtPS.Name = "txtPS";
|
||||
this.txtPS.PaletteMode = ComponentFactory.Krypton.Toolkit.PaletteMode.ProfessionalOffice2003;
|
||||
this.txtPS.PasswordChar = '*';
|
||||
this.txtPS.Size = new System.Drawing.Size(232, 35);
|
||||
this.txtPS.StateActive.Border.Color1 = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(255)))));
|
||||
this.txtPS.StateActive.Border.DrawBorders = ((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders)((((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Top | ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Bottom)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Left)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Right)));
|
||||
this.txtPS.StateCommon.Border.DrawBorders = ((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders)((((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Top | ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Bottom)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Left)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Right)));
|
||||
this.txtPS.StateCommon.Border.GraphicsHint = ComponentFactory.Krypton.Toolkit.PaletteGraphicsHint.AntiAlias;
|
||||
this.txtPS.StateCommon.Border.Rounding = 4;
|
||||
this.txtPS.StateCommon.Border.Width = 2;
|
||||
this.txtPS.StateCommon.Content.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.txtPS.TabIndex = 27;
|
||||
//
|
||||
// lbPS
|
||||
//
|
||||
this.lbPS.LabelStyle = ComponentFactory.Krypton.Toolkit.LabelStyle.TitleControl;
|
||||
this.lbPS.Location = new System.Drawing.Point(29, 145);
|
||||
this.lbPS.Name = "lbPS";
|
||||
this.lbPS.Size = new System.Drawing.Size(82, 26);
|
||||
this.lbPS.StateCommon.ShortText.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.lbPS.TabIndex = 26;
|
||||
this.lbPS.Values.Text = "登陆密码:";
|
||||
//
|
||||
// txtName
|
||||
//
|
||||
this.txtName.AlwaysActive = false;
|
||||
this.txtName.Location = new System.Drawing.Point(29, 104);
|
||||
this.txtName.Name = "txtName";
|
||||
this.txtName.PaletteMode = ComponentFactory.Krypton.Toolkit.PaletteMode.ProfessionalOffice2003;
|
||||
this.txtName.Size = new System.Drawing.Size(232, 35);
|
||||
this.txtName.StateActive.Border.Color1 = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(255)))));
|
||||
this.txtName.StateActive.Border.DrawBorders = ((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders)((((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Top | ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Bottom)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Left)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Right)));
|
||||
this.txtName.StateCommon.Border.DrawBorders = ((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders)((((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Top | ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Bottom)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Left)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Right)));
|
||||
this.txtName.StateCommon.Border.GraphicsHint = ComponentFactory.Krypton.Toolkit.PaletteGraphicsHint.AntiAlias;
|
||||
this.txtName.StateCommon.Border.Rounding = 4;
|
||||
this.txtName.StateCommon.Border.Width = 2;
|
||||
this.txtName.StateCommon.Content.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.txtName.TabIndex = 25;
|
||||
//
|
||||
// lbName
|
||||
//
|
||||
this.lbName.LabelStyle = ComponentFactory.Krypton.Toolkit.LabelStyle.TitleControl;
|
||||
this.lbName.Location = new System.Drawing.Point(29, 78);
|
||||
this.lbName.Name = "lbName";
|
||||
this.lbName.Size = new System.Drawing.Size(82, 26);
|
||||
this.lbName.StateCommon.ShortText.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.lbName.TabIndex = 24;
|
||||
this.lbName.Values.Text = "用户姓名:";
|
||||
//
|
||||
// txtAccount
|
||||
//
|
||||
this.txtAccount.AlwaysActive = false;
|
||||
this.txtAccount.Location = new System.Drawing.Point(29, 37);
|
||||
this.txtAccount.Name = "txtAccount";
|
||||
this.txtAccount.PaletteMode = ComponentFactory.Krypton.Toolkit.PaletteMode.ProfessionalOffice2003;
|
||||
this.txtAccount.Size = new System.Drawing.Size(232, 35);
|
||||
this.txtAccount.StateActive.Border.Color1 = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(255)))));
|
||||
this.txtAccount.StateActive.Border.DrawBorders = ((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders)((((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Top | ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Bottom)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Left)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Right)));
|
||||
this.txtAccount.StateCommon.Border.DrawBorders = ((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders)((((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Top | ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Bottom)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Left)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Right)));
|
||||
this.txtAccount.StateCommon.Border.GraphicsHint = ComponentFactory.Krypton.Toolkit.PaletteGraphicsHint.AntiAlias;
|
||||
this.txtAccount.StateCommon.Border.Rounding = 4;
|
||||
this.txtAccount.StateCommon.Border.Width = 2;
|
||||
this.txtAccount.StateCommon.Content.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.txtAccount.TabIndex = 23;
|
||||
//
|
||||
// lbAccount
|
||||
//
|
||||
this.lbAccount.LabelStyle = ComponentFactory.Krypton.Toolkit.LabelStyle.TitleControl;
|
||||
this.lbAccount.Location = new System.Drawing.Point(29, 10);
|
||||
this.lbAccount.Name = "lbAccount";
|
||||
this.lbAccount.Size = new System.Drawing.Size(82, 26);
|
||||
this.lbAccount.StateCommon.ShortText.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.lbAccount.TabIndex = 22;
|
||||
this.lbAccount.Values.Text = "用户账号:";
|
||||
//
|
||||
// klb_Role
|
||||
//
|
||||
this.klb_Role.LabelStyle = ComponentFactory.Krypton.Toolkit.LabelStyle.TitleControl;
|
||||
this.klb_Role.Location = new System.Drawing.Point(29, 342);
|
||||
this.klb_Role.Name = "klb_Role";
|
||||
this.klb_Role.Size = new System.Drawing.Size(82, 26);
|
||||
this.klb_Role.StateCommon.ShortText.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.klb_Role.TabIndex = 30;
|
||||
this.klb_Role.Values.Text = "所属角色:";
|
||||
//
|
||||
// kcmb_Role
|
||||
//
|
||||
this.kcmb_Role.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.kcmb_Role.DropDownWidth = 271;
|
||||
this.kcmb_Role.Location = new System.Drawing.Point(29, 369);
|
||||
this.kcmb_Role.Name = "kcmb_Role";
|
||||
this.kcmb_Role.Size = new System.Drawing.Size(232, 31);
|
||||
this.kcmb_Role.StateCommon.ComboBox.Content.Font = new System.Drawing.Font("微软雅黑", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.kcmb_Role.TabIndex = 33;
|
||||
//
|
||||
// frmAddUser
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(289, 483);
|
||||
this.Controls.Add(this.kryptonPanel1);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "frmAddUser";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||
this.Text = "frmAddUser";
|
||||
this.Load += new System.EventHandler(this.frmAddUser_Load);
|
||||
((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).EndInit();
|
||||
this.kryptonPanel1.ResumeLayout(false);
|
||||
this.kryptonPanel1.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.cmbGender)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.kcmb_Role)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonPanel kryptonPanel1;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonComboBox cmbGender;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonLabel lbGender;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonTextBox txtPS1;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonLabel lbPS1;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonTextBox txtPS;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonLabel lbPS;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonTextBox txtName;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonLabel lbName;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonTextBox txtAccount;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonLabel lbAccount;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonButton btnClose;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonButton btnAdd;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonComboBox kcmb_Role;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonLabel klb_Role;
|
||||
}
|
||||
}
|
||||
209
CleanMachineHMI/frmChild/frmAddUser.cs
Normal file
209
CleanMachineHMI/frmChild/frmAddUser.cs
Normal file
@@ -0,0 +1,209 @@
|
||||
using CleanMachineHMI.forms;
|
||||
using CleanMachineHMI.FrmUserControl;
|
||||
using CleanMachineHMI.Utils;
|
||||
using ComponentFactory.Krypton.Toolkit;
|
||||
using LeadDataBaseUtility;
|
||||
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.Web.UI.WebControls;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace CleanMachineHMI.frmChild
|
||||
{
|
||||
public partial class frmAddUser : KryptonForm
|
||||
{
|
||||
public frmAddUser()
|
||||
{
|
||||
InitializeComponent();
|
||||
_ComboBoxLanguageTextList = this.GetInfoLanguageText(GlobalHelper.LanguageCode, "KryptonComboBox");
|
||||
_InfoLanguageTextList = this.GetInfoLanguageText(GlobalHelper.LanguageCode);
|
||||
}
|
||||
private DataTable _ComboBoxLanguageTextList;
|
||||
private DataTable _InfoLanguageTextList;
|
||||
private void txt_GotFocus(object sender, EventArgs e)
|
||||
{
|
||||
KeyboardAutoPopUp.ShowInputPanel();
|
||||
}
|
||||
private void txt_LostFocus(object sender, EventArgs e)
|
||||
{
|
||||
KeyboardAutoPopUp.HideInputPanel();
|
||||
}
|
||||
private void InitControlEvent()
|
||||
{
|
||||
txtAccount.GotFocus += new EventHandler(txt_GotFocus); //获取焦点前发生事件
|
||||
txtAccount.LostFocus += new EventHandler(txt_LostFocus); //失去焦点后发生事件
|
||||
|
||||
txtName.GotFocus += new EventHandler(txt_GotFocus); //获取焦点前发生事件
|
||||
txtName.LostFocus += new EventHandler(txt_LostFocus); //失去焦点后发生事件
|
||||
|
||||
txtPS.GotFocus += new EventHandler(txt_GotFocus); //获取焦点前发生事件
|
||||
txtPS.LostFocus += new EventHandler(txt_LostFocus); //失去焦点后发生事件
|
||||
|
||||
txtPS1.GotFocus += new EventHandler(txt_GotFocus); //获取焦点前发生事件
|
||||
txtPS1.LostFocus += new EventHandler(txt_LostFocus); //失去焦点后发生事件
|
||||
}
|
||||
|
||||
private void frmAddUser_Load(object sender, EventArgs e)
|
||||
{
|
||||
InitControlEvent();
|
||||
this.SetFormControlText(GlobalHelper.LanguageCode);
|
||||
if (GlobalHelper.LanguageCode == "English")
|
||||
{
|
||||
cmbGender.Items.Clear();
|
||||
foreach (DataRow item in _ComboBoxLanguageTextList.GetComBoboxItemArr(cmbGender.Name, "KryptonComboBox"))
|
||||
{
|
||||
cmbGender.Items.Add(item["CONTROL_NAME"].ToString());
|
||||
}
|
||||
}
|
||||
string sql = $"SELECT ROLE_ID,ROLE_CODE,ROLE_NAME FROM SYS_ROLE ";
|
||||
DataTable dt = LeadDbHelperSQLite.Query(sql).Tables[0];
|
||||
if (dt != null && dt.Rows.Count > 0)
|
||||
{
|
||||
kcmb_Role.Items.Clear();
|
||||
kcmb_Role.Items.Add(new ListItem
|
||||
{
|
||||
Value = "0",
|
||||
Text = "Please Select",
|
||||
});
|
||||
foreach (DataRow item in dt.Rows)
|
||||
{
|
||||
kcmb_Role.Items.Add(new ListItem
|
||||
{
|
||||
Value = item["ROLE_ID"].ToString(),
|
||||
Text = item["ROLE_CODE"].ToString(),
|
||||
});
|
||||
}
|
||||
}
|
||||
kcmb_Role.SelectedIndex = 0;
|
||||
cmbGender.SelectedIndex = 0;
|
||||
kryptonPanel1.Focus();
|
||||
}
|
||||
|
||||
private void btnAdd_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (string.IsNullOrEmpty(txtAccount.Text))
|
||||
{
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请输入用户编码!", "EnterUserCodeInfo"));
|
||||
return;
|
||||
}
|
||||
if (string.IsNullOrEmpty(txtName.Text))
|
||||
{
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请输入用户名称!", "EnterUserNameInfo"));
|
||||
return;
|
||||
}
|
||||
if (string.IsNullOrEmpty(txtPS.Text))
|
||||
{
|
||||
//KryptonMessageBox.Show("请输入用户密码!");
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请输入用户密码!", "EnterUserPasswordInfo"));
|
||||
return;
|
||||
}
|
||||
if (string.IsNullOrEmpty(txtPS1.Text))
|
||||
{
|
||||
//KryptonMessageBox.Show("请确认用户密码!");
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请确认用户密码!", "ConfirmUserPasswordInfo"));
|
||||
return;
|
||||
}
|
||||
if (cmbGender.SelectedIndex == 0)
|
||||
{
|
||||
//KryptonMessageBox.Show("请选择性别!");
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请选择性别!", "SelectUserGenderInfo"));
|
||||
return;
|
||||
}
|
||||
if (kcmb_Role.SelectedIndex == 0)
|
||||
{
|
||||
//KryptonMessageBox.Show("请选择所属角色!");
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请选择所属角色!", "SelectUserRoleInfo"));
|
||||
return;
|
||||
}
|
||||
if (txtPS1.Text != txtPS.Text)
|
||||
{
|
||||
//KryptonMessageBox.Show("两次输入的密码不同,请重新输入!");
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("两次输入的密码不同,请重新输入!", "ConfirmUserPasswordErrInfo"));
|
||||
return;
|
||||
}
|
||||
string sqlIsExistCode = $@"SELECT 1 FROM SYS_USER WHERE USER_CODE = '{txtAccount.Text}'";
|
||||
DataTable dtIsExistCode = LeadDbHelperSQLite.Query(sqlIsExistCode).Tables[0];
|
||||
if (dtIsExistCode != null && dtIsExistCode.Rows.Count > 0)
|
||||
{
|
||||
//KryptonMessageBox.Show($"用户名:【{txtAccount.Text}】已经存在,请重新输入!");
|
||||
KryptonMessageBox.Show($"User name 【{txtAccount.Text}】already exist, please re-enter!");
|
||||
return;
|
||||
}
|
||||
|
||||
string sql = $@"
|
||||
INSERT INTO SYS_USER (
|
||||
USER_CODE,
|
||||
USER_NAME,
|
||||
PASSWORD,
|
||||
GENDER,
|
||||
SCHEDULE_CODE,
|
||||
ROLE_ID,
|
||||
USED_FLAG,
|
||||
DEL_FLAG,
|
||||
CREATE_BY,
|
||||
CREATE_TIME,
|
||||
UPDATE_BY,
|
||||
UPDATE_TIME,
|
||||
DATA_VERSION,
|
||||
REMARKS1,
|
||||
REMARKS2,
|
||||
REMARKS3,
|
||||
REMARKS4,
|
||||
REMARKS5
|
||||
)
|
||||
VALUES
|
||||
(
|
||||
'{txtAccount.Text}',
|
||||
'{txtName.Text}',
|
||||
'{txtPS1.Text}',
|
||||
'{cmbGender.SelectedIndex}',
|
||||
'1',
|
||||
'{((ListItem)kcmb_Role.SelectedItem).Value}',
|
||||
1,
|
||||
0,
|
||||
'{GlobalHelper.UserInfo.USER_ID}',
|
||||
datetime('now', 'localtime'),
|
||||
'{GlobalHelper.UserInfo.USER_ID}',
|
||||
datetime('now', 'localtime'),
|
||||
0,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL
|
||||
);
|
||||
";
|
||||
int row = LeadDbHelperSQLite.ExecuteSql(sql);
|
||||
if (row > 0)
|
||||
{
|
||||
//KryptonMessageBox.Show("新增用户数据成功!");
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("新增用户数据成功!", "AddSuccessInfo"));
|
||||
frmUser.RefreshFrmHost();
|
||||
this.Close();
|
||||
}
|
||||
else
|
||||
{
|
||||
//KryptonMessageBox.Show("新增用户数据失败!");
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("新增用户数据失败!", "AddFailInfo"));
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("新增用户数据发生异常", "AddUserDataExp") + $":【{ex.Message}】!");
|
||||
}
|
||||
}
|
||||
|
||||
private void btnClose_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
120
CleanMachineHMI/frmChild/frmAddUser.resx
Normal file
120
CleanMachineHMI/frmChild/frmAddUser.resx
Normal file
@@ -0,0 +1,120 @@
|
||||
<?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>
|
||||
280
CleanMachineHMI/frmChild/frmAddWaringMsg.Designer.cs
generated
Normal file
280
CleanMachineHMI/frmChild/frmAddWaringMsg.Designer.cs
generated
Normal file
@@ -0,0 +1,280 @@
|
||||
namespace CleanMachineHMI.frmChild
|
||||
{
|
||||
partial class frmAddWaringMsg
|
||||
{
|
||||
/// <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.kryptonPanel1 = new ComponentFactory.Krypton.Toolkit.KryptonPanel();
|
||||
this.kcmb_WarningType = new ComponentFactory.Krypton.Toolkit.KryptonComboBox();
|
||||
this.ktb_PlcCode = new ComponentFactory.Krypton.Toolkit.KryptonTextBox();
|
||||
this.txtWarningMessage = new ComponentFactory.Krypton.Toolkit.KryptonTextBox();
|
||||
this.kryptonLabel2 = new ComponentFactory.Krypton.Toolkit.KryptonLabel();
|
||||
this.kryptonLabel1 = new ComponentFactory.Krypton.Toolkit.KryptonLabel();
|
||||
this.lbWarningMessage = new ComponentFactory.Krypton.Toolkit.KryptonLabel();
|
||||
this.txtWarningName = new ComponentFactory.Krypton.Toolkit.KryptonTextBox();
|
||||
this.lbWarningName = new ComponentFactory.Krypton.Toolkit.KryptonLabel();
|
||||
this.txtWarningCode = new ComponentFactory.Krypton.Toolkit.KryptonTextBox();
|
||||
this.lbWarningCode = new ComponentFactory.Krypton.Toolkit.KryptonLabel();
|
||||
this.btnEdit = new ComponentFactory.Krypton.Toolkit.KryptonButton();
|
||||
this.btnAdd = new ComponentFactory.Krypton.Toolkit.KryptonButton();
|
||||
((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit();
|
||||
this.kryptonPanel1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.kcmb_WarningType)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// kryptonPanel1
|
||||
//
|
||||
this.kryptonPanel1.Controls.Add(this.kcmb_WarningType);
|
||||
this.kryptonPanel1.Controls.Add(this.ktb_PlcCode);
|
||||
this.kryptonPanel1.Controls.Add(this.txtWarningMessage);
|
||||
this.kryptonPanel1.Controls.Add(this.kryptonLabel2);
|
||||
this.kryptonPanel1.Controls.Add(this.kryptonLabel1);
|
||||
this.kryptonPanel1.Controls.Add(this.lbWarningMessage);
|
||||
this.kryptonPanel1.Controls.Add(this.txtWarningName);
|
||||
this.kryptonPanel1.Controls.Add(this.lbWarningName);
|
||||
this.kryptonPanel1.Controls.Add(this.txtWarningCode);
|
||||
this.kryptonPanel1.Controls.Add(this.lbWarningCode);
|
||||
this.kryptonPanel1.Controls.Add(this.btnEdit);
|
||||
this.kryptonPanel1.Controls.Add(this.btnAdd);
|
||||
this.kryptonPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.kryptonPanel1.Location = new System.Drawing.Point(0, 0);
|
||||
this.kryptonPanel1.Name = "kryptonPanel1";
|
||||
this.kryptonPanel1.Size = new System.Drawing.Size(289, 441);
|
||||
this.kryptonPanel1.TabIndex = 6;
|
||||
//
|
||||
// kcmb_WarningType
|
||||
//
|
||||
this.kcmb_WarningType.DropDownWidth = 236;
|
||||
this.kcmb_WarningType.Items.AddRange(new object[] {
|
||||
"请选择",
|
||||
"清洁机报警",
|
||||
"变频器报警"});
|
||||
this.kcmb_WarningType.Location = new System.Drawing.Point(23, 330);
|
||||
this.kcmb_WarningType.Name = "kcmb_WarningType";
|
||||
this.kcmb_WarningType.Size = new System.Drawing.Size(242, 33);
|
||||
this.kcmb_WarningType.StateActive.ComboBox.Border.Color1 = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(255)))));
|
||||
this.kcmb_WarningType.StateActive.ComboBox.Border.DrawBorders = ((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders)((((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Top | ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Bottom)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Left)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Right)));
|
||||
this.kcmb_WarningType.StateCommon.ComboBox.Border.DrawBorders = ((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders)((((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Top | ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Bottom)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Left)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Right)));
|
||||
this.kcmb_WarningType.StateCommon.ComboBox.Border.Rounding = 4;
|
||||
this.kcmb_WarningType.StateCommon.ComboBox.Border.Width = 2;
|
||||
this.kcmb_WarningType.StateCommon.ComboBox.Content.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.kcmb_WarningType.TabIndex = 42;
|
||||
//
|
||||
// ktb_PlcCode
|
||||
//
|
||||
this.ktb_PlcCode.AlwaysActive = false;
|
||||
this.ktb_PlcCode.Location = new System.Drawing.Point(23, 256);
|
||||
this.ktb_PlcCode.Name = "ktb_PlcCode";
|
||||
this.ktb_PlcCode.PaletteMode = ComponentFactory.Krypton.Toolkit.PaletteMode.ProfessionalOffice2003;
|
||||
this.ktb_PlcCode.Size = new System.Drawing.Size(242, 35);
|
||||
this.ktb_PlcCode.StateActive.Border.Color1 = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(255)))));
|
||||
this.ktb_PlcCode.StateActive.Border.DrawBorders = ((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders)((((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Top | ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Bottom)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Left)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Right)));
|
||||
this.ktb_PlcCode.StateCommon.Border.DrawBorders = ((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders)((((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Top | ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Bottom)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Left)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Right)));
|
||||
this.ktb_PlcCode.StateCommon.Border.GraphicsHint = ComponentFactory.Krypton.Toolkit.PaletteGraphicsHint.AntiAlias;
|
||||
this.ktb_PlcCode.StateCommon.Border.Rounding = 4;
|
||||
this.ktb_PlcCode.StateCommon.Border.Width = 2;
|
||||
this.ktb_PlcCode.StateCommon.Content.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.ktb_PlcCode.TabIndex = 41;
|
||||
//
|
||||
// txtWarningMessage
|
||||
//
|
||||
this.txtWarningMessage.AlwaysActive = false;
|
||||
this.txtWarningMessage.Location = new System.Drawing.Point(23, 185);
|
||||
this.txtWarningMessage.Name = "txtWarningMessage";
|
||||
this.txtWarningMessage.PaletteMode = ComponentFactory.Krypton.Toolkit.PaletteMode.ProfessionalOffice2003;
|
||||
this.txtWarningMessage.Size = new System.Drawing.Size(242, 35);
|
||||
this.txtWarningMessage.StateActive.Border.Color1 = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(255)))));
|
||||
this.txtWarningMessage.StateActive.Border.DrawBorders = ((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders)((((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Top | ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Bottom)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Left)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Right)));
|
||||
this.txtWarningMessage.StateCommon.Border.DrawBorders = ((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders)((((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Top | ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Bottom)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Left)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Right)));
|
||||
this.txtWarningMessage.StateCommon.Border.GraphicsHint = ComponentFactory.Krypton.Toolkit.PaletteGraphicsHint.AntiAlias;
|
||||
this.txtWarningMessage.StateCommon.Border.Rounding = 4;
|
||||
this.txtWarningMessage.StateCommon.Border.Width = 2;
|
||||
this.txtWarningMessage.StateCommon.Content.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.txtWarningMessage.TabIndex = 41;
|
||||
//
|
||||
// kryptonLabel2
|
||||
//
|
||||
this.kryptonLabel2.LabelStyle = ComponentFactory.Krypton.Toolkit.LabelStyle.TitleControl;
|
||||
this.kryptonLabel2.Location = new System.Drawing.Point(23, 297);
|
||||
this.kryptonLabel2.Name = "kryptonLabel2";
|
||||
this.kryptonLabel2.Size = new System.Drawing.Size(82, 26);
|
||||
this.kryptonLabel2.StateCommon.ShortText.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.kryptonLabel2.TabIndex = 40;
|
||||
this.kryptonLabel2.Values.Text = "报警类型:";
|
||||
//
|
||||
// kryptonLabel1
|
||||
//
|
||||
this.kryptonLabel1.LabelStyle = ComponentFactory.Krypton.Toolkit.LabelStyle.TitleControl;
|
||||
this.kryptonLabel1.Location = new System.Drawing.Point(23, 226);
|
||||
this.kryptonLabel1.Name = "kryptonLabel1";
|
||||
this.kryptonLabel1.Size = new System.Drawing.Size(80, 26);
|
||||
this.kryptonLabel1.StateCommon.ShortText.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.kryptonLabel1.TabIndex = 40;
|
||||
this.kryptonLabel1.Values.Text = "PLC信息:";
|
||||
//
|
||||
// lbWarningMessage
|
||||
//
|
||||
this.lbWarningMessage.LabelStyle = ComponentFactory.Krypton.Toolkit.LabelStyle.TitleControl;
|
||||
this.lbWarningMessage.Location = new System.Drawing.Point(23, 155);
|
||||
this.lbWarningMessage.Name = "lbWarningMessage";
|
||||
this.lbWarningMessage.Size = new System.Drawing.Size(82, 26);
|
||||
this.lbWarningMessage.StateCommon.ShortText.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.lbWarningMessage.TabIndex = 40;
|
||||
this.lbWarningMessage.Values.Text = "报警消息:";
|
||||
//
|
||||
// txtWarningName
|
||||
//
|
||||
this.txtWarningName.AlwaysActive = false;
|
||||
this.txtWarningName.Location = new System.Drawing.Point(23, 112);
|
||||
this.txtWarningName.Name = "txtWarningName";
|
||||
this.txtWarningName.PaletteMode = ComponentFactory.Krypton.Toolkit.PaletteMode.ProfessionalOffice2003;
|
||||
this.txtWarningName.Size = new System.Drawing.Size(242, 35);
|
||||
this.txtWarningName.StateActive.Border.Color1 = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(255)))));
|
||||
this.txtWarningName.StateActive.Border.DrawBorders = ((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders)((((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Top | ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Bottom)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Left)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Right)));
|
||||
this.txtWarningName.StateCommon.Border.DrawBorders = ((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders)((((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Top | ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Bottom)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Left)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Right)));
|
||||
this.txtWarningName.StateCommon.Border.GraphicsHint = ComponentFactory.Krypton.Toolkit.PaletteGraphicsHint.AntiAlias;
|
||||
this.txtWarningName.StateCommon.Border.Rounding = 4;
|
||||
this.txtWarningName.StateCommon.Border.Width = 2;
|
||||
this.txtWarningName.StateCommon.Content.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.txtWarningName.TabIndex = 39;
|
||||
//
|
||||
// lbWarningName
|
||||
//
|
||||
this.lbWarningName.LabelStyle = ComponentFactory.Krypton.Toolkit.LabelStyle.TitleControl;
|
||||
this.lbWarningName.Location = new System.Drawing.Point(23, 86);
|
||||
this.lbWarningName.Name = "lbWarningName";
|
||||
this.lbWarningName.Size = new System.Drawing.Size(82, 26);
|
||||
this.lbWarningName.StateCommon.ShortText.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.lbWarningName.TabIndex = 38;
|
||||
this.lbWarningName.Values.Text = "报警名称:";
|
||||
//
|
||||
// txtWarningCode
|
||||
//
|
||||
this.txtWarningCode.AlwaysActive = false;
|
||||
this.txtWarningCode.Location = new System.Drawing.Point(23, 45);
|
||||
this.txtWarningCode.Name = "txtWarningCode";
|
||||
this.txtWarningCode.PaletteMode = ComponentFactory.Krypton.Toolkit.PaletteMode.ProfessionalOffice2003;
|
||||
this.txtWarningCode.Size = new System.Drawing.Size(242, 35);
|
||||
this.txtWarningCode.StateActive.Border.Color1 = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(255)))));
|
||||
this.txtWarningCode.StateActive.Border.DrawBorders = ((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders)((((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Top | ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Bottom)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Left)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Right)));
|
||||
this.txtWarningCode.StateCommon.Border.DrawBorders = ((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders)((((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Top | ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Bottom)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Left)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Right)));
|
||||
this.txtWarningCode.StateCommon.Border.GraphicsHint = ComponentFactory.Krypton.Toolkit.PaletteGraphicsHint.AntiAlias;
|
||||
this.txtWarningCode.StateCommon.Border.Rounding = 4;
|
||||
this.txtWarningCode.StateCommon.Border.Width = 2;
|
||||
this.txtWarningCode.StateCommon.Content.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.txtWarningCode.TabIndex = 37;
|
||||
//
|
||||
// lbWarningCode
|
||||
//
|
||||
this.lbWarningCode.LabelStyle = ComponentFactory.Krypton.Toolkit.LabelStyle.TitleControl;
|
||||
this.lbWarningCode.Location = new System.Drawing.Point(23, 13);
|
||||
this.lbWarningCode.Name = "lbWarningCode";
|
||||
this.lbWarningCode.Size = new System.Drawing.Size(82, 26);
|
||||
this.lbWarningCode.StateCommon.ShortText.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.lbWarningCode.TabIndex = 36;
|
||||
this.lbWarningCode.Values.Text = "报警编码:";
|
||||
//
|
||||
// btnEdit
|
||||
//
|
||||
this.btnEdit.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.btnEdit.Location = new System.Drawing.Point(183, 382);
|
||||
this.btnEdit.Name = "btnEdit";
|
||||
this.btnEdit.Size = new System.Drawing.Size(82, 40);
|
||||
this.btnEdit.StateCommon.Content.ShortText.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.btnEdit.TabIndex = 35;
|
||||
this.btnEdit.Values.Text = "取消";
|
||||
this.btnEdit.Click += new System.EventHandler(this.btnEdit_Click);
|
||||
//
|
||||
// btnAdd
|
||||
//
|
||||
this.btnAdd.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.btnAdd.Location = new System.Drawing.Point(23, 382);
|
||||
this.btnAdd.Name = "btnAdd";
|
||||
this.btnAdd.Size = new System.Drawing.Size(82, 40);
|
||||
this.btnAdd.StateCommon.Content.ShortText.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.btnAdd.TabIndex = 34;
|
||||
this.btnAdd.Values.Text = "确认";
|
||||
this.btnAdd.Click += new System.EventHandler(this.btnAdd_Click);
|
||||
//
|
||||
// frmAddWaringMsg
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(289, 441);
|
||||
this.Controls.Add(this.kryptonPanel1);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "frmAddWaringMsg";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||
this.Text = "AddWaringMsg";
|
||||
this.Load += new System.EventHandler(this.frmAddWaringMsg_Load);
|
||||
((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).EndInit();
|
||||
this.kryptonPanel1.ResumeLayout(false);
|
||||
this.kryptonPanel1.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.kcmb_WarningType)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonPanel kryptonPanel1;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonButton btnEdit;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonButton btnAdd;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonTextBox txtWarningMessage;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonLabel lbWarningMessage;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonTextBox txtWarningName;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonLabel lbWarningName;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonTextBox txtWarningCode;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonLabel lbWarningCode;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonTextBox ktb_PlcCode;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonLabel kryptonLabel2;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonLabel kryptonLabel1;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonComboBox kcmb_WarningType;
|
||||
}
|
||||
}
|
||||
164
CleanMachineHMI/frmChild/frmAddWaringMsg.cs
Normal file
164
CleanMachineHMI/frmChild/frmAddWaringMsg.cs
Normal file
@@ -0,0 +1,164 @@
|
||||
using CleanMachineHMI.forms;
|
||||
using CleanMachineHMI.FrmUserControl;
|
||||
using CleanMachineHMI.Utils;
|
||||
using ComponentFactory.Krypton.Toolkit;
|
||||
using LeadDataBaseUtility;
|
||||
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;
|
||||
|
||||
namespace CleanMachineHMI.frmChild
|
||||
{
|
||||
public partial class frmAddWaringMsg : KryptonForm
|
||||
{
|
||||
public frmAddWaringMsg()
|
||||
{
|
||||
InitializeComponent();
|
||||
_ComboBoxLanguageTextList = this.GetInfoLanguageText(GlobalHelper.LanguageCode, "KryptonComboBox");
|
||||
_InfoLanguageTextList = this.GetInfoLanguageText(GlobalHelper.LanguageCode);
|
||||
}
|
||||
private DataTable _ComboBoxLanguageTextList;
|
||||
private DataTable _InfoLanguageTextList;
|
||||
private void txt_GotFocus(object sender, EventArgs e)
|
||||
{
|
||||
KeyboardAutoPopUp.ShowInputPanel();
|
||||
}
|
||||
private void txt_LostFocus(object sender, EventArgs e)
|
||||
{
|
||||
KeyboardAutoPopUp.HideInputPanel();
|
||||
}
|
||||
private void InitControlEvent()
|
||||
{
|
||||
txtWarningCode.GotFocus += new EventHandler(txt_GotFocus); //获取焦点前发生事件
|
||||
txtWarningCode.LostFocus += new EventHandler(txt_LostFocus); //失去焦点后发生事件
|
||||
|
||||
txtWarningName.GotFocus += new EventHandler(txt_GotFocus); //获取焦点前发生事件
|
||||
txtWarningName.LostFocus += new EventHandler(txt_LostFocus); //失去焦点后发生事件
|
||||
|
||||
txtWarningMessage.GotFocus += new EventHandler(txt_GotFocus); //获取焦点前发生事件
|
||||
txtWarningMessage.LostFocus += new EventHandler(txt_LostFocus); //失去焦点后发生事件
|
||||
|
||||
ktb_PlcCode.GotFocus += new EventHandler(txt_GotFocus); //获取焦点前发生事件
|
||||
ktb_PlcCode.LostFocus += new EventHandler(txt_LostFocus); //失去焦点后发生事件
|
||||
}
|
||||
|
||||
private void frmAddWaringMsg_Load(object sender, EventArgs e)
|
||||
{
|
||||
InitControlEvent();
|
||||
this.SetFormControlText(GlobalHelper.LanguageCode);
|
||||
if (GlobalHelper.LanguageCode == "English")
|
||||
{
|
||||
kcmb_WarningType.Items.Clear();
|
||||
foreach (DataRow item in _ComboBoxLanguageTextList.GetComBoboxItemArr(kcmb_WarningType.Name, "KryptonComboBox"))
|
||||
{
|
||||
kcmb_WarningType.Items.Add(item["CONTROL_NAME"].ToString());
|
||||
}
|
||||
}
|
||||
kcmb_WarningType.SelectedIndex = 0;
|
||||
kryptonPanel1.Focus();
|
||||
}
|
||||
|
||||
private void btnAdd_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (string.IsNullOrEmpty(txtWarningCode.Text))
|
||||
{
|
||||
//KryptonMessageBox.Show("请输入报警条码!");
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请输入报警条码!", "EnterWarningCodeInfo"));
|
||||
return;
|
||||
}
|
||||
if (string.IsNullOrEmpty(txtWarningName.Text))
|
||||
{
|
||||
//KryptonMessageBox.Show("请输入报警名称!");
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请输入报警名称!", "EnterWarningNameInfo"));
|
||||
return;
|
||||
}
|
||||
if (kcmb_WarningType.SelectedIndex == 0)
|
||||
{
|
||||
//KryptonMessageBox.Show("请选择报警类型!");
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请选择报警类型!", "SelectWarningTypeInfo"));
|
||||
return;
|
||||
}
|
||||
string sqlIsExistCode = $@"SELECT 1 FROM BAS_WARNING WHERE WARNING_TYPE = '{kcmb_WarningType.SelectedIndex}' AND PLC_ITEM_CODE = '{ktb_PlcCode.Text}' AND WARNING_CODE = '{txtWarningCode.Text}'";
|
||||
DataTable dtIsExistCode = LeadDbHelperSQLite.Query(sqlIsExistCode).Tables[0];
|
||||
if (dtIsExistCode != null && dtIsExistCode.Rows.Count > 0)
|
||||
{
|
||||
//KryptonMessageBox.Show($"相同报警类类型:【{kcmb_WarningType.Text}】,PLC条码:【{ktb_PlcCode.Text}】的报警编码:【{txtWarningCode.Text}】已经存在,请重新输入!");
|
||||
KryptonMessageBox.Show($"Same alarm type: [{kcmb_WarningType.Text}],PLC item code: [{ktb_PlcCode.Text}] alarm code: [{txtWarningCode.Text}] already exists, please re-enter!");
|
||||
return;
|
||||
}
|
||||
string sql = $@"
|
||||
INSERT INTO BAS_WARNING (
|
||||
WARNING_CODE,
|
||||
WARNING_NAME,
|
||||
PLC_ITEM_CODE,
|
||||
WARNING_TYPE,
|
||||
WARNING_MESSAGE,
|
||||
USED_FLAG,
|
||||
DEL_FLAG,
|
||||
CREATE_BY,
|
||||
CREATE_TIME,
|
||||
UPDATE_BY,
|
||||
UPDATE_TIME,
|
||||
DATA_VERSION,
|
||||
REMARKS1,
|
||||
REMARKS2,
|
||||
REMARKS3,
|
||||
REMARKS4,
|
||||
REMARKS5
|
||||
)
|
||||
VALUES
|
||||
(
|
||||
'{txtWarningCode.Text}',
|
||||
'{txtWarningName.Text}',
|
||||
'{ktb_PlcCode.Text}',
|
||||
'{kcmb_WarningType.SelectedIndex}',
|
||||
'{txtWarningMessage.Text}',
|
||||
1,
|
||||
0,
|
||||
'{GlobalHelper.UserInfo.USER_ID}',
|
||||
datetime('now', 'localtime'),
|
||||
'{GlobalHelper.UserInfo.USER_ID}',
|
||||
datetime('now', 'localtime'),
|
||||
0,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL
|
||||
);
|
||||
";
|
||||
int row = LeadDbHelperSQLite.ExecuteSql(sql);
|
||||
if (row > 0)
|
||||
{
|
||||
//KryptonMessageBox.Show("新增基础报警数据成功!");
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("新增基础报警数据成功!", "AddSuccessInfo"));
|
||||
frmWarning.RefreshFrmHost();
|
||||
this.Close();
|
||||
}
|
||||
else
|
||||
{
|
||||
//KryptonMessageBox.Show("新增基础报警数据失败!");
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("新增基础报警数据失败!", "AddFailInfo"));
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
//KryptonMessageBox.Show(ex.Message);
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("新增基础报警数据发生异常", "AddWarningDataExp") + $":【{ex.Message}】!");
|
||||
}
|
||||
}
|
||||
|
||||
private void btnEdit_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
120
CleanMachineHMI/frmChild/frmAddWaringMsg.resx
Normal file
120
CleanMachineHMI/frmChild/frmAddWaringMsg.resx
Normal file
@@ -0,0 +1,120 @@
|
||||
<?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>
|
||||
168
CleanMachineHMI/frmChild/frmEditCleanCode.Designer.cs
generated
Normal file
168
CleanMachineHMI/frmChild/frmEditCleanCode.Designer.cs
generated
Normal file
@@ -0,0 +1,168 @@
|
||||
namespace CleanMachineHMI.frmChild
|
||||
{
|
||||
partial class frmEditCleanCode
|
||||
{
|
||||
/// <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.kryptonPanel1 = new ComponentFactory.Krypton.Toolkit.KryptonPanel();
|
||||
this.txtCleanModeName = new ComponentFactory.Krypton.Toolkit.KryptonTextBox();
|
||||
this.txtCleanModeCode = new ComponentFactory.Krypton.Toolkit.KryptonTextBox();
|
||||
this.lbCleanModeName = new ComponentFactory.Krypton.Toolkit.KryptonLabel();
|
||||
this.lbCleanModeCode = new ComponentFactory.Krypton.Toolkit.KryptonLabel();
|
||||
this.btnEdit = new ComponentFactory.Krypton.Toolkit.KryptonButton();
|
||||
this.btnAdd = new ComponentFactory.Krypton.Toolkit.KryptonButton();
|
||||
((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit();
|
||||
this.kryptonPanel1.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// kryptonPanel1
|
||||
//
|
||||
this.kryptonPanel1.Controls.Add(this.txtCleanModeName);
|
||||
this.kryptonPanel1.Controls.Add(this.txtCleanModeCode);
|
||||
this.kryptonPanel1.Controls.Add(this.lbCleanModeName);
|
||||
this.kryptonPanel1.Controls.Add(this.lbCleanModeCode);
|
||||
this.kryptonPanel1.Controls.Add(this.btnEdit);
|
||||
this.kryptonPanel1.Controls.Add(this.btnAdd);
|
||||
this.kryptonPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.kryptonPanel1.Location = new System.Drawing.Point(0, 0);
|
||||
this.kryptonPanel1.Name = "kryptonPanel1";
|
||||
this.kryptonPanel1.Size = new System.Drawing.Size(289, 227);
|
||||
this.kryptonPanel1.TabIndex = 4;
|
||||
//
|
||||
// txtCleanModeName
|
||||
//
|
||||
this.txtCleanModeName.AlwaysActive = false;
|
||||
this.txtCleanModeName.Location = new System.Drawing.Point(21, 110);
|
||||
this.txtCleanModeName.Name = "txtCleanModeName";
|
||||
this.txtCleanModeName.PaletteMode = ComponentFactory.Krypton.Toolkit.PaletteMode.ProfessionalOffice2003;
|
||||
this.txtCleanModeName.Size = new System.Drawing.Size(250, 35);
|
||||
this.txtCleanModeName.StateActive.Border.Color1 = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(255)))));
|
||||
this.txtCleanModeName.StateActive.Border.DrawBorders = ((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders)((((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Top | ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Bottom)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Left)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Right)));
|
||||
this.txtCleanModeName.StateCommon.Border.DrawBorders = ((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders)((((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Top | ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Bottom)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Left)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Right)));
|
||||
this.txtCleanModeName.StateCommon.Border.GraphicsHint = ComponentFactory.Krypton.Toolkit.PaletteGraphicsHint.AntiAlias;
|
||||
this.txtCleanModeName.StateCommon.Border.Rounding = 4;
|
||||
this.txtCleanModeName.StateCommon.Border.Width = 2;
|
||||
this.txtCleanModeName.StateCommon.Content.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.txtCleanModeName.TabIndex = 39;
|
||||
//
|
||||
// txtCleanModeCode
|
||||
//
|
||||
this.txtCleanModeCode.AlwaysActive = false;
|
||||
this.txtCleanModeCode.Location = new System.Drawing.Point(21, 39);
|
||||
this.txtCleanModeCode.Name = "txtCleanModeCode";
|
||||
this.txtCleanModeCode.PaletteMode = ComponentFactory.Krypton.Toolkit.PaletteMode.ProfessionalOffice2003;
|
||||
this.txtCleanModeCode.Size = new System.Drawing.Size(250, 35);
|
||||
this.txtCleanModeCode.StateActive.Border.Color1 = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(255)))));
|
||||
this.txtCleanModeCode.StateActive.Border.DrawBorders = ((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders)((((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Top | ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Bottom)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Left)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Right)));
|
||||
this.txtCleanModeCode.StateCommon.Border.DrawBorders = ((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders)((((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Top | ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Bottom)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Left)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Right)));
|
||||
this.txtCleanModeCode.StateCommon.Border.GraphicsHint = ComponentFactory.Krypton.Toolkit.PaletteGraphicsHint.AntiAlias;
|
||||
this.txtCleanModeCode.StateCommon.Border.Rounding = 4;
|
||||
this.txtCleanModeCode.StateCommon.Border.Width = 2;
|
||||
this.txtCleanModeCode.StateCommon.Content.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.txtCleanModeCode.TabIndex = 38;
|
||||
//
|
||||
// lbCleanModeName
|
||||
//
|
||||
this.lbCleanModeName.LabelStyle = ComponentFactory.Krypton.Toolkit.LabelStyle.TitleControl;
|
||||
this.lbCleanModeName.Location = new System.Drawing.Point(20, 82);
|
||||
this.lbCleanModeName.Name = "lbCleanModeName";
|
||||
this.lbCleanModeName.Size = new System.Drawing.Size(115, 26);
|
||||
this.lbCleanModeName.StateCommon.ShortText.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.lbCleanModeName.TabIndex = 37;
|
||||
this.lbCleanModeName.Values.Text = "清洁方式名称:";
|
||||
//
|
||||
// lbCleanModeCode
|
||||
//
|
||||
this.lbCleanModeCode.LabelStyle = ComponentFactory.Krypton.Toolkit.LabelStyle.TitleControl;
|
||||
this.lbCleanModeCode.Location = new System.Drawing.Point(20, 11);
|
||||
this.lbCleanModeCode.Name = "lbCleanModeCode";
|
||||
this.lbCleanModeCode.Size = new System.Drawing.Size(115, 26);
|
||||
this.lbCleanModeCode.StateCommon.ShortText.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.lbCleanModeCode.TabIndex = 36;
|
||||
this.lbCleanModeCode.Values.Text = "清洁方式编码:";
|
||||
//
|
||||
// btnEdit
|
||||
//
|
||||
this.btnEdit.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.btnEdit.Location = new System.Drawing.Point(183, 166);
|
||||
this.btnEdit.Name = "btnEdit";
|
||||
this.btnEdit.Size = new System.Drawing.Size(82, 40);
|
||||
this.btnEdit.StateCommon.Content.ShortText.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.btnEdit.TabIndex = 35;
|
||||
this.btnEdit.Values.Text = "取消";
|
||||
this.btnEdit.Click += new System.EventHandler(this.btnEdit_Click);
|
||||
//
|
||||
// btnAdd
|
||||
//
|
||||
this.btnAdd.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.btnAdd.Location = new System.Drawing.Point(23, 166);
|
||||
this.btnAdd.Name = "btnAdd";
|
||||
this.btnAdd.Size = new System.Drawing.Size(82, 40);
|
||||
this.btnAdd.StateCommon.Content.ShortText.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.btnAdd.TabIndex = 34;
|
||||
this.btnAdd.Values.Text = "确认";
|
||||
this.btnAdd.Click += new System.EventHandler(this.btnAdd_Click);
|
||||
//
|
||||
// frmEditCleanCode
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(289, 227);
|
||||
this.Controls.Add(this.kryptonPanel1);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "frmEditCleanCode";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||
this.Text = "EditCleanCode";
|
||||
this.Load += new System.EventHandler(this.frmEditCleanCode_Load);
|
||||
((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).EndInit();
|
||||
this.kryptonPanel1.ResumeLayout(false);
|
||||
this.kryptonPanel1.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonPanel kryptonPanel1;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonTextBox txtCleanModeName;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonTextBox txtCleanModeCode;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonLabel lbCleanModeName;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonLabel lbCleanModeCode;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonButton btnEdit;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonButton btnAdd;
|
||||
}
|
||||
}
|
||||
107
CleanMachineHMI/frmChild/frmEditCleanCode.cs
Normal file
107
CleanMachineHMI/frmChild/frmEditCleanCode.cs
Normal file
@@ -0,0 +1,107 @@
|
||||
using CleanMachineHMI.forms;
|
||||
using CleanMachineHMI.FrmUserControl;
|
||||
using CleanMachineHMI.Utils;
|
||||
using ComponentFactory.Krypton.Toolkit;
|
||||
using LeadDataBaseUtility;
|
||||
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;
|
||||
|
||||
namespace CleanMachineHMI.frmChild
|
||||
{
|
||||
public partial class frmEditCleanCode : KryptonForm
|
||||
{
|
||||
public frmEditCleanCode()
|
||||
{
|
||||
InitializeComponent();
|
||||
_InfoLanguageTextList = this.GetInfoLanguageText(GlobalHelper.LanguageCode);
|
||||
}
|
||||
private DataTable _InfoLanguageTextList;
|
||||
public string CleanModeId { get; set; }
|
||||
private void frmAddCleanCode_Load(object sender, EventArgs e)
|
||||
{
|
||||
InitControlEvent();
|
||||
this.SetFormControlText(GlobalHelper.LanguageCode);
|
||||
}
|
||||
private void txt_GotFocus(object sender, EventArgs e)
|
||||
{
|
||||
KeyboardAutoPopUp.ShowInputPanel();
|
||||
}
|
||||
private void txt_LostFocus(object sender, EventArgs e)
|
||||
{
|
||||
KeyboardAutoPopUp.HideInputPanel();
|
||||
}
|
||||
private void InitControlEvent()
|
||||
{
|
||||
txtCleanModeCode.GotFocus += new EventHandler(txt_GotFocus); //获取焦点前发生事件
|
||||
txtCleanModeCode.LostFocus += new EventHandler(txt_LostFocus); //失去焦点后发生事件
|
||||
|
||||
txtCleanModeName.GotFocus += new EventHandler(txt_GotFocus); //获取焦点前发生事件
|
||||
txtCleanModeName.LostFocus += new EventHandler(txt_LostFocus); //失去焦点后发生事件
|
||||
}
|
||||
|
||||
private void frmEditCleanCode_Load(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
InitControlEvent();
|
||||
string sql = $@"SELECT * FROM BAS_CLEAN_MODE WHERE CLEAN_MODE_ID = '{CleanModeId}'";
|
||||
DataTable dt = LeadDbHelperSQLite.Query(sql).Tables[0];
|
||||
if (dt != null && dt.Rows.Count > 0)
|
||||
{
|
||||
txtCleanModeCode.Text = dt.Rows[0]["CLEAN_MODE_CODE"].ToString();
|
||||
txtCleanModeCode.Enabled = false;
|
||||
txtCleanModeName.Text = dt.Rows[0]["CLEAN_MODE_NAME"].ToString();
|
||||
}
|
||||
this.SetFormControlText(GlobalHelper.LanguageCode);
|
||||
kryptonPanel1.Focus();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("修改清洁方式数据界面加载异常", "LoadEditFrmExp") + $":【{ex.Message}】!");
|
||||
}
|
||||
}
|
||||
|
||||
private void btnAdd_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (string.IsNullOrEmpty(txtCleanModeName.Text))
|
||||
{
|
||||
//KryptonMessageBox.Show("请输入板材名称!");
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请输入清洗方式名称!", "EnterCleanNameInfo"));
|
||||
return;
|
||||
}
|
||||
string sql = $@"update BAS_CLEAN_MODE set CLEAN_MODE_NAME = '{txtCleanModeName.Text}',UPDATE_BY = '{GlobalHelper.UserInfo.USER_ID}',UPDATE_TIME = datetime('now', 'localtime') where CLEAN_MODE_ID = '{CleanModeId}'";
|
||||
int row = LeadDbHelperSQLite.ExecuteSql(sql);
|
||||
if (row > 0)
|
||||
{
|
||||
//KryptonMessageBox.Show("修改清洗方式数据成功!");
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("编辑清洗方式数据成功!", "EditSuccessInfo"));
|
||||
frmCleanMode.RefreshFrmHost();
|
||||
this.Close();
|
||||
}
|
||||
else
|
||||
{
|
||||
//KryptonMessageBox.Show("修改清洗方式数据失败!");
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("编辑清洗方式数据失败!", "EditFailInfo"));
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("编辑清洗方式数据发生异常", "EditCleanModeDataExp") + $":【{ex.Message}】!");
|
||||
}
|
||||
}
|
||||
|
||||
private void btnEdit_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
120
CleanMachineHMI/frmChild/frmEditCleanCode.resx
Normal file
120
CleanMachineHMI/frmChild/frmEditCleanCode.resx
Normal file
@@ -0,0 +1,120 @@
|
||||
<?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>
|
||||
196
CleanMachineHMI/frmChild/frmEditContaminationDtl.Designer.cs
generated
Normal file
196
CleanMachineHMI/frmChild/frmEditContaminationDtl.Designer.cs
generated
Normal file
@@ -0,0 +1,196 @@
|
||||
namespace CleanMachineHMI.frmChild
|
||||
{
|
||||
partial class frmEditContaminationDtl
|
||||
{
|
||||
/// <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.kryptonPanel1 = new ComponentFactory.Krypton.Toolkit.KryptonPanel();
|
||||
this.cmbContaminationType = new ComponentFactory.Krypton.Toolkit.KryptonComboBox();
|
||||
this.txtContaminationDTLName = new ComponentFactory.Krypton.Toolkit.KryptonTextBox();
|
||||
this.txtContaminationDTLCode = new ComponentFactory.Krypton.Toolkit.KryptonTextBox();
|
||||
this.lbContaminationType = new ComponentFactory.Krypton.Toolkit.KryptonLabel();
|
||||
this.lbContaminationDTLName = new ComponentFactory.Krypton.Toolkit.KryptonLabel();
|
||||
this.lbContaminationDTLCode = new ComponentFactory.Krypton.Toolkit.KryptonLabel();
|
||||
this.btnEdit = new ComponentFactory.Krypton.Toolkit.KryptonButton();
|
||||
this.btnAdd = new ComponentFactory.Krypton.Toolkit.KryptonButton();
|
||||
((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit();
|
||||
this.kryptonPanel1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.cmbContaminationType)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// kryptonPanel1
|
||||
//
|
||||
this.kryptonPanel1.Controls.Add(this.cmbContaminationType);
|
||||
this.kryptonPanel1.Controls.Add(this.txtContaminationDTLName);
|
||||
this.kryptonPanel1.Controls.Add(this.txtContaminationDTLCode);
|
||||
this.kryptonPanel1.Controls.Add(this.lbContaminationType);
|
||||
this.kryptonPanel1.Controls.Add(this.lbContaminationDTLName);
|
||||
this.kryptonPanel1.Controls.Add(this.lbContaminationDTLCode);
|
||||
this.kryptonPanel1.Controls.Add(this.btnEdit);
|
||||
this.kryptonPanel1.Controls.Add(this.btnAdd);
|
||||
this.kryptonPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.kryptonPanel1.Location = new System.Drawing.Point(0, 0);
|
||||
this.kryptonPanel1.Name = "kryptonPanel1";
|
||||
this.kryptonPanel1.Size = new System.Drawing.Size(334, 290);
|
||||
this.kryptonPanel1.TabIndex = 6;
|
||||
//
|
||||
// cmbContaminationType
|
||||
//
|
||||
this.cmbContaminationType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.cmbContaminationType.DropDownWidth = 271;
|
||||
this.cmbContaminationType.Location = new System.Drawing.Point(23, 41);
|
||||
this.cmbContaminationType.Name = "cmbContaminationType";
|
||||
this.cmbContaminationType.Size = new System.Drawing.Size(287, 27);
|
||||
this.cmbContaminationType.StateCommon.ComboBox.Content.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.cmbContaminationType.TabIndex = 41;
|
||||
//
|
||||
// txtContaminationDTLName
|
||||
//
|
||||
this.txtContaminationDTLName.AlwaysActive = false;
|
||||
this.txtContaminationDTLName.Location = new System.Drawing.Point(23, 179);
|
||||
this.txtContaminationDTLName.Name = "txtContaminationDTLName";
|
||||
this.txtContaminationDTLName.PaletteMode = ComponentFactory.Krypton.Toolkit.PaletteMode.ProfessionalOffice2003;
|
||||
this.txtContaminationDTLName.Size = new System.Drawing.Size(287, 35);
|
||||
this.txtContaminationDTLName.StateActive.Border.Color1 = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(255)))));
|
||||
this.txtContaminationDTLName.StateActive.Border.DrawBorders = ((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders)((((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Top | ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Bottom)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Left)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Right)));
|
||||
this.txtContaminationDTLName.StateCommon.Border.DrawBorders = ((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders)((((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Top | ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Bottom)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Left)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Right)));
|
||||
this.txtContaminationDTLName.StateCommon.Border.GraphicsHint = ComponentFactory.Krypton.Toolkit.PaletteGraphicsHint.AntiAlias;
|
||||
this.txtContaminationDTLName.StateCommon.Border.Rounding = 4;
|
||||
this.txtContaminationDTLName.StateCommon.Border.Width = 2;
|
||||
this.txtContaminationDTLName.StateCommon.Content.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.txtContaminationDTLName.TabIndex = 40;
|
||||
//
|
||||
// txtContaminationDTLCode
|
||||
//
|
||||
this.txtContaminationDTLCode.AlwaysActive = false;
|
||||
this.txtContaminationDTLCode.Location = new System.Drawing.Point(23, 108);
|
||||
this.txtContaminationDTLCode.Name = "txtContaminationDTLCode";
|
||||
this.txtContaminationDTLCode.PaletteMode = ComponentFactory.Krypton.Toolkit.PaletteMode.ProfessionalOffice2003;
|
||||
this.txtContaminationDTLCode.Size = new System.Drawing.Size(287, 35);
|
||||
this.txtContaminationDTLCode.StateActive.Border.Color1 = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(255)))));
|
||||
this.txtContaminationDTLCode.StateActive.Border.DrawBorders = ((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders)((((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Top | ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Bottom)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Left)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Right)));
|
||||
this.txtContaminationDTLCode.StateCommon.Border.DrawBorders = ((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders)((((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Top | ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Bottom)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Left)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Right)));
|
||||
this.txtContaminationDTLCode.StateCommon.Border.GraphicsHint = ComponentFactory.Krypton.Toolkit.PaletteGraphicsHint.AntiAlias;
|
||||
this.txtContaminationDTLCode.StateCommon.Border.Rounding = 4;
|
||||
this.txtContaminationDTLCode.StateCommon.Border.Width = 2;
|
||||
this.txtContaminationDTLCode.StateCommon.Content.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.txtContaminationDTLCode.TabIndex = 39;
|
||||
//
|
||||
// lbContaminationType
|
||||
//
|
||||
this.lbContaminationType.LabelStyle = ComponentFactory.Krypton.Toolkit.LabelStyle.TitleControl;
|
||||
this.lbContaminationType.Location = new System.Drawing.Point(23, 9);
|
||||
this.lbContaminationType.Name = "lbContaminationType";
|
||||
this.lbContaminationType.Size = new System.Drawing.Size(82, 26);
|
||||
this.lbContaminationType.StateCommon.ShortText.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.lbContaminationType.TabIndex = 38;
|
||||
this.lbContaminationType.Values.Text = "污染类型:";
|
||||
//
|
||||
// lbContaminationDTLName
|
||||
//
|
||||
this.lbContaminationDTLName.LabelStyle = ComponentFactory.Krypton.Toolkit.LabelStyle.TitleControl;
|
||||
this.lbContaminationDTLName.Location = new System.Drawing.Point(23, 147);
|
||||
this.lbContaminationDTLName.Name = "lbContaminationDTLName";
|
||||
this.lbContaminationDTLName.Size = new System.Drawing.Size(115, 26);
|
||||
this.lbContaminationDTLName.StateCommon.ShortText.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.lbContaminationDTLName.TabIndex = 37;
|
||||
this.lbContaminationDTLName.Values.Text = "污染明细名称:";
|
||||
//
|
||||
// lbContaminationDTLCode
|
||||
//
|
||||
this.lbContaminationDTLCode.LabelStyle = ComponentFactory.Krypton.Toolkit.LabelStyle.TitleControl;
|
||||
this.lbContaminationDTLCode.Location = new System.Drawing.Point(23, 76);
|
||||
this.lbContaminationDTLCode.Name = "lbContaminationDTLCode";
|
||||
this.lbContaminationDTLCode.Size = new System.Drawing.Size(115, 26);
|
||||
this.lbContaminationDTLCode.StateCommon.ShortText.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.lbContaminationDTLCode.TabIndex = 36;
|
||||
this.lbContaminationDTLCode.Values.Text = "污染明细编码:";
|
||||
//
|
||||
// btnEdit
|
||||
//
|
||||
this.btnEdit.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.btnEdit.Location = new System.Drawing.Point(228, 231);
|
||||
this.btnEdit.Name = "btnEdit";
|
||||
this.btnEdit.Size = new System.Drawing.Size(82, 40);
|
||||
this.btnEdit.StateCommon.Content.ShortText.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.btnEdit.TabIndex = 35;
|
||||
this.btnEdit.Values.Text = "取消";
|
||||
this.btnEdit.Click += new System.EventHandler(this.btnEdit_Click);
|
||||
//
|
||||
// btnAdd
|
||||
//
|
||||
this.btnAdd.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.btnAdd.Location = new System.Drawing.Point(23, 231);
|
||||
this.btnAdd.Name = "btnAdd";
|
||||
this.btnAdd.Size = new System.Drawing.Size(82, 40);
|
||||
this.btnAdd.StateCommon.Content.ShortText.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.btnAdd.TabIndex = 34;
|
||||
this.btnAdd.Values.Text = "确认";
|
||||
this.btnAdd.Click += new System.EventHandler(this.btnAdd_Click);
|
||||
//
|
||||
// frmEditContaminationDtl
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(334, 290);
|
||||
this.Controls.Add(this.kryptonPanel1);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "frmEditContaminationDtl";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||
this.Text = "EditContaminationDtl";
|
||||
this.Load += new System.EventHandler(this.frmEditContaminationDtl_Load);
|
||||
((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).EndInit();
|
||||
this.kryptonPanel1.ResumeLayout(false);
|
||||
this.kryptonPanel1.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.cmbContaminationType)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonPanel kryptonPanel1;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonComboBox cmbContaminationType;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonTextBox txtContaminationDTLName;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonTextBox txtContaminationDTLCode;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonLabel lbContaminationType;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonLabel lbContaminationDTLName;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonLabel lbContaminationDTLCode;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonButton btnEdit;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonButton btnAdd;
|
||||
}
|
||||
}
|
||||
135
CleanMachineHMI/frmChild/frmEditContaminationDtl.cs
Normal file
135
CleanMachineHMI/frmChild/frmEditContaminationDtl.cs
Normal file
@@ -0,0 +1,135 @@
|
||||
using CleanMachineHMI.forms;
|
||||
using CleanMachineHMI.FrmUserControl;
|
||||
using CleanMachineHMI.Utils;
|
||||
using ComponentFactory.Krypton.Toolkit;
|
||||
using LeadDataBaseUtility;
|
||||
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.Web.UI.WebControls;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace CleanMachineHMI.frmChild
|
||||
{
|
||||
public partial class frmEditContaminationDtl : KryptonForm
|
||||
{
|
||||
public frmEditContaminationDtl()
|
||||
{
|
||||
InitializeComponent();
|
||||
_InfoLanguageTextList = this.GetInfoLanguageText(GlobalHelper.LanguageCode);
|
||||
}
|
||||
private DataTable _InfoLanguageTextList;
|
||||
public string ContaminationDtlId { get; set; }
|
||||
private void txt_GotFocus(object sender, EventArgs e)
|
||||
{
|
||||
KeyboardAutoPopUp.ShowInputPanel();
|
||||
}
|
||||
private void txt_LostFocus(object sender, EventArgs e)
|
||||
{
|
||||
KeyboardAutoPopUp.HideInputPanel();
|
||||
}
|
||||
private void InitControlEvent()
|
||||
{
|
||||
txtContaminationDTLCode.GotFocus += new EventHandler(txt_GotFocus); //获取焦点前发生事件
|
||||
txtContaminationDTLCode.LostFocus += new EventHandler(txt_LostFocus); //失去焦点后发生事件
|
||||
|
||||
txtContaminationDTLName.GotFocus += new EventHandler(txt_GotFocus); //获取焦点前发生事件
|
||||
txtContaminationDTLName.LostFocus += new EventHandler(txt_LostFocus); //失去焦点后发生事件
|
||||
}
|
||||
private void frmEditContaminationDtl_Load(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
InitControlEvent();
|
||||
this.SetFormControlText(GlobalHelper.LanguageCode);
|
||||
string sql = $@"select CONTAMINATION_TYPE_CODE,CONTAMINATION_TYPE_NAME from BAS_CONTAMINATION_TYPE where DEL_FLAG=0";
|
||||
DataTable dt = LeadDbHelperSQLite.Query(sql).Tables[0];
|
||||
if (dt != null && dt.Rows.Count > 0)
|
||||
{
|
||||
cmbContaminationType.Items.Add(new ListItem
|
||||
{
|
||||
Value = "0",
|
||||
Text = "Please Select",
|
||||
});
|
||||
foreach (DataRow item in dt.Rows)
|
||||
{
|
||||
cmbContaminationType.Items.Add(new ListItem
|
||||
{
|
||||
Value = item["CONTAMINATION_TYPE_CODE"].ToString(),
|
||||
Text = item["CONTAMINATION_TYPE_NAME"].ToString(),
|
||||
});
|
||||
}
|
||||
cmbContaminationType.SelectedIndex = 0;
|
||||
}
|
||||
string sql1 = $@"SELECT B.CONTAMINATION_TYPE_CODE,B.CONTAMINATION_TYPE_NAME,A.CONTAMINATION_DTL_CODE,A.CONTAMINATION_DTL_NAME FROM BAS_CONTAMINATION_DTL A LEFT JOIN BAS_CONTAMINATION_TYPE B ON A.CONTAMINATION_TYPE_CODE = B.CONTAMINATION_TYPE_CODE WHERE A.CONTAMINATION_DTL_ID = '{ContaminationDtlId}'";
|
||||
DataTable dt1 = LeadDbHelperSQLite.Query(sql1).Tables[0];
|
||||
if (dt1 != null && dt1.Rows.Count > 0)
|
||||
{
|
||||
txtContaminationDTLCode.Text = dt1.Rows[0]["CONTAMINATION_DTL_CODE"].ToString();
|
||||
txtContaminationDTLCode.Enabled = false;
|
||||
txtContaminationDTLName.Text = dt1.Rows[0]["CONTAMINATION_DTL_NAME"].ToString();
|
||||
cmbContaminationType.Text = dt1.Rows[0]["CONTAMINATION_TYPE_NAME"].ToString();
|
||||
cmbContaminationType.Enabled = false;
|
||||
}
|
||||
kryptonPanel1.Focus();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("编辑污染明细数据界面加载异常", "LoadEditFrmExp") + $":【{ex.Message}】!");
|
||||
}
|
||||
}
|
||||
|
||||
private void btnAdd_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (cmbContaminationType.SelectedIndex == 0)
|
||||
{
|
||||
//KryptonMessageBox.Show("请选择污染类型!");
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请选择污染类型!", "SelectContaminationTypeInfo"));
|
||||
return;
|
||||
}
|
||||
if (string.IsNullOrEmpty(txtContaminationDTLCode.Text))
|
||||
{
|
||||
//KryptonMessageBox.Show("请输入污染明细编码!");
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请输入污染明细编码!", "EnterContaminationDtlCodeInfo"));
|
||||
return;
|
||||
}
|
||||
if (string.IsNullOrEmpty(txtContaminationDTLName.Text))
|
||||
{
|
||||
//KryptonMessageBox.Show("请输入污染明细名称!");
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请输入污染明细名称!", "EnterContaminationDtlNameInfo"));
|
||||
return;
|
||||
}
|
||||
string sql = $@"update BAS_CONTAMINATION_DTL set CONTAMINATION_DTL_NAME = '{txtContaminationDTLName.Text}',UPDATE_BY = '{GlobalHelper.UserInfo.USER_ID}',UPDATE_TIME = datetime('now', 'localtime') where CONTAMINATION_DTL_ID = '{ContaminationDtlId}'";
|
||||
int row = LeadDbHelperSQLite.ExecuteSql(sql);
|
||||
if (row > 0)
|
||||
{
|
||||
//KryptonMessageBox.Show("修改污染明细数据成功!");
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("新增污染明细数据成功!", "EditSuccessInfo"));
|
||||
frmContaminationDTL.RefreshFrmHost();
|
||||
this.Close();
|
||||
}
|
||||
else
|
||||
{
|
||||
//KryptonMessageBox.Show("修改污染明细数据失败!");
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("新增污染明细数据失败!", "EditFailInfo"));
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("编辑污染明细数据发生异常", "EditContaminationDtlDataExp") + $":【{ex.Message}】!");
|
||||
}
|
||||
}
|
||||
|
||||
private void btnEdit_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
120
CleanMachineHMI/frmChild/frmEditContaminationDtl.resx
Normal file
120
CleanMachineHMI/frmChild/frmEditContaminationDtl.resx
Normal file
@@ -0,0 +1,120 @@
|
||||
<?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>
|
||||
196
CleanMachineHMI/frmChild/frmEditContaminationType.Designer.cs
generated
Normal file
196
CleanMachineHMI/frmChild/frmEditContaminationType.Designer.cs
generated
Normal file
@@ -0,0 +1,196 @@
|
||||
namespace CleanMachineHMI.frmChild
|
||||
{
|
||||
partial class frmEditContaminationType
|
||||
{
|
||||
/// <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.kryptonPanel1 = new ComponentFactory.Krypton.Toolkit.KryptonPanel();
|
||||
this.cmbCleanMode = new ComponentFactory.Krypton.Toolkit.KryptonComboBox();
|
||||
this.txtContaminationTypeName = new ComponentFactory.Krypton.Toolkit.KryptonTextBox();
|
||||
this.txtContaminationTypeCode = new ComponentFactory.Krypton.Toolkit.KryptonTextBox();
|
||||
this.lbCleanMode = new ComponentFactory.Krypton.Toolkit.KryptonLabel();
|
||||
this.lbContaminationTypeName = new ComponentFactory.Krypton.Toolkit.KryptonLabel();
|
||||
this.lbContaminationTypeCode = new ComponentFactory.Krypton.Toolkit.KryptonLabel();
|
||||
this.btnEdit = new ComponentFactory.Krypton.Toolkit.KryptonButton();
|
||||
this.btnAdd = new ComponentFactory.Krypton.Toolkit.KryptonButton();
|
||||
((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit();
|
||||
this.kryptonPanel1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.cmbCleanMode)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// kryptonPanel1
|
||||
//
|
||||
this.kryptonPanel1.Controls.Add(this.cmbCleanMode);
|
||||
this.kryptonPanel1.Controls.Add(this.txtContaminationTypeName);
|
||||
this.kryptonPanel1.Controls.Add(this.txtContaminationTypeCode);
|
||||
this.kryptonPanel1.Controls.Add(this.lbCleanMode);
|
||||
this.kryptonPanel1.Controls.Add(this.lbContaminationTypeName);
|
||||
this.kryptonPanel1.Controls.Add(this.lbContaminationTypeCode);
|
||||
this.kryptonPanel1.Controls.Add(this.btnEdit);
|
||||
this.kryptonPanel1.Controls.Add(this.btnAdd);
|
||||
this.kryptonPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.kryptonPanel1.Location = new System.Drawing.Point(0, 0);
|
||||
this.kryptonPanel1.Name = "kryptonPanel1";
|
||||
this.kryptonPanel1.Size = new System.Drawing.Size(289, 290);
|
||||
this.kryptonPanel1.TabIndex = 5;
|
||||
//
|
||||
// cmbCleanMode
|
||||
//
|
||||
this.cmbCleanMode.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.cmbCleanMode.DropDownWidth = 271;
|
||||
this.cmbCleanMode.Location = new System.Drawing.Point(15, 37);
|
||||
this.cmbCleanMode.Name = "cmbCleanMode";
|
||||
this.cmbCleanMode.Size = new System.Drawing.Size(261, 31);
|
||||
this.cmbCleanMode.StateCommon.ComboBox.Content.Font = new System.Drawing.Font("微软雅黑", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.cmbCleanMode.TabIndex = 41;
|
||||
//
|
||||
// txtContaminationTypeName
|
||||
//
|
||||
this.txtContaminationTypeName.AlwaysActive = false;
|
||||
this.txtContaminationTypeName.Location = new System.Drawing.Point(15, 174);
|
||||
this.txtContaminationTypeName.Name = "txtContaminationTypeName";
|
||||
this.txtContaminationTypeName.PaletteMode = ComponentFactory.Krypton.Toolkit.PaletteMode.ProfessionalOffice2003;
|
||||
this.txtContaminationTypeName.Size = new System.Drawing.Size(261, 35);
|
||||
this.txtContaminationTypeName.StateActive.Border.Color1 = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(255)))));
|
||||
this.txtContaminationTypeName.StateActive.Border.DrawBorders = ((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders)((((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Top | ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Bottom)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Left)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Right)));
|
||||
this.txtContaminationTypeName.StateCommon.Border.DrawBorders = ((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders)((((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Top | ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Bottom)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Left)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Right)));
|
||||
this.txtContaminationTypeName.StateCommon.Border.GraphicsHint = ComponentFactory.Krypton.Toolkit.PaletteGraphicsHint.AntiAlias;
|
||||
this.txtContaminationTypeName.StateCommon.Border.Rounding = 4;
|
||||
this.txtContaminationTypeName.StateCommon.Border.Width = 2;
|
||||
this.txtContaminationTypeName.StateCommon.Content.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.txtContaminationTypeName.TabIndex = 40;
|
||||
//
|
||||
// txtContaminationTypeCode
|
||||
//
|
||||
this.txtContaminationTypeCode.AlwaysActive = false;
|
||||
this.txtContaminationTypeCode.Location = new System.Drawing.Point(15, 103);
|
||||
this.txtContaminationTypeCode.Name = "txtContaminationTypeCode";
|
||||
this.txtContaminationTypeCode.PaletteMode = ComponentFactory.Krypton.Toolkit.PaletteMode.ProfessionalOffice2003;
|
||||
this.txtContaminationTypeCode.Size = new System.Drawing.Size(261, 35);
|
||||
this.txtContaminationTypeCode.StateActive.Border.Color1 = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(255)))));
|
||||
this.txtContaminationTypeCode.StateActive.Border.DrawBorders = ((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders)((((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Top | ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Bottom)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Left)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Right)));
|
||||
this.txtContaminationTypeCode.StateCommon.Border.DrawBorders = ((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders)((((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Top | ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Bottom)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Left)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Right)));
|
||||
this.txtContaminationTypeCode.StateCommon.Border.GraphicsHint = ComponentFactory.Krypton.Toolkit.PaletteGraphicsHint.AntiAlias;
|
||||
this.txtContaminationTypeCode.StateCommon.Border.Rounding = 4;
|
||||
this.txtContaminationTypeCode.StateCommon.Border.Width = 2;
|
||||
this.txtContaminationTypeCode.StateCommon.Content.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.txtContaminationTypeCode.TabIndex = 39;
|
||||
//
|
||||
// lbCleanMode
|
||||
//
|
||||
this.lbCleanMode.LabelStyle = ComponentFactory.Krypton.Toolkit.LabelStyle.TitleControl;
|
||||
this.lbCleanMode.Location = new System.Drawing.Point(15, 10);
|
||||
this.lbCleanMode.Name = "lbCleanMode";
|
||||
this.lbCleanMode.Size = new System.Drawing.Size(82, 26);
|
||||
this.lbCleanMode.StateCommon.ShortText.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.lbCleanMode.TabIndex = 38;
|
||||
this.lbCleanMode.Values.Text = "清洁方式:";
|
||||
//
|
||||
// lbContaminationTypeName
|
||||
//
|
||||
this.lbContaminationTypeName.LabelStyle = ComponentFactory.Krypton.Toolkit.LabelStyle.TitleControl;
|
||||
this.lbContaminationTypeName.Location = new System.Drawing.Point(15, 147);
|
||||
this.lbContaminationTypeName.Name = "lbContaminationTypeName";
|
||||
this.lbContaminationTypeName.Size = new System.Drawing.Size(115, 26);
|
||||
this.lbContaminationTypeName.StateCommon.ShortText.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.lbContaminationTypeName.TabIndex = 37;
|
||||
this.lbContaminationTypeName.Values.Text = "污染类型编码:";
|
||||
//
|
||||
// lbContaminationTypeCode
|
||||
//
|
||||
this.lbContaminationTypeCode.LabelStyle = ComponentFactory.Krypton.Toolkit.LabelStyle.TitleControl;
|
||||
this.lbContaminationTypeCode.Location = new System.Drawing.Point(15, 76);
|
||||
this.lbContaminationTypeCode.Name = "lbContaminationTypeCode";
|
||||
this.lbContaminationTypeCode.Size = new System.Drawing.Size(115, 26);
|
||||
this.lbContaminationTypeCode.StateCommon.ShortText.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.lbContaminationTypeCode.TabIndex = 36;
|
||||
this.lbContaminationTypeCode.Values.Text = "污染类型编码:";
|
||||
//
|
||||
// btnEdit
|
||||
//
|
||||
this.btnEdit.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.btnEdit.Location = new System.Drawing.Point(183, 229);
|
||||
this.btnEdit.Name = "btnEdit";
|
||||
this.btnEdit.Size = new System.Drawing.Size(82, 40);
|
||||
this.btnEdit.StateCommon.Content.ShortText.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.btnEdit.TabIndex = 35;
|
||||
this.btnEdit.Values.Text = "取消";
|
||||
this.btnEdit.Click += new System.EventHandler(this.btnEdit_Click);
|
||||
//
|
||||
// btnAdd
|
||||
//
|
||||
this.btnAdd.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.btnAdd.Location = new System.Drawing.Point(23, 229);
|
||||
this.btnAdd.Name = "btnAdd";
|
||||
this.btnAdd.Size = new System.Drawing.Size(82, 40);
|
||||
this.btnAdd.StateCommon.Content.ShortText.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.btnAdd.TabIndex = 34;
|
||||
this.btnAdd.Values.Text = "确认";
|
||||
this.btnAdd.Click += new System.EventHandler(this.btnAdd_Click);
|
||||
//
|
||||
// frmEditContaminationType
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(289, 290);
|
||||
this.Controls.Add(this.kryptonPanel1);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "frmEditContaminationType";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||
this.Text = "EditContaminationType";
|
||||
this.Load += new System.EventHandler(this.frmEditContaminationType_Load);
|
||||
((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).EndInit();
|
||||
this.kryptonPanel1.ResumeLayout(false);
|
||||
this.kryptonPanel1.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.cmbCleanMode)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonPanel kryptonPanel1;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonComboBox cmbCleanMode;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonTextBox txtContaminationTypeName;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonTextBox txtContaminationTypeCode;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonLabel lbCleanMode;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonLabel lbContaminationTypeName;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonLabel lbContaminationTypeCode;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonButton btnEdit;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonButton btnAdd;
|
||||
}
|
||||
}
|
||||
131
CleanMachineHMI/frmChild/frmEditContaminationType.cs
Normal file
131
CleanMachineHMI/frmChild/frmEditContaminationType.cs
Normal file
@@ -0,0 +1,131 @@
|
||||
using CleanMachineHMI.forms;
|
||||
using CleanMachineHMI.FrmUserControl;
|
||||
using CleanMachineHMI.Utils;
|
||||
using ComponentFactory.Krypton.Toolkit;
|
||||
using LeadDataBaseUtility;
|
||||
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.Web.UI.WebControls;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace CleanMachineHMI.frmChild
|
||||
{
|
||||
public partial class frmEditContaminationType : KryptonForm
|
||||
{
|
||||
public frmEditContaminationType()
|
||||
{
|
||||
InitializeComponent();
|
||||
_InfoLanguageTextList = this.GetInfoLanguageText(GlobalHelper.LanguageCode);
|
||||
}
|
||||
private DataTable _InfoLanguageTextList;
|
||||
private void txt_GotFocus(object sender, EventArgs e)
|
||||
{
|
||||
KeyboardAutoPopUp.ShowInputPanel();
|
||||
}
|
||||
private void txt_LostFocus(object sender, EventArgs e)
|
||||
{
|
||||
KeyboardAutoPopUp.HideInputPanel();
|
||||
}
|
||||
private void InitControlEvent()
|
||||
{
|
||||
txtContaminationTypeCode.GotFocus += new EventHandler(txt_GotFocus); //获取焦点前发生事件
|
||||
txtContaminationTypeCode.LostFocus += new EventHandler(txt_LostFocus); //失去焦点后发生事件
|
||||
|
||||
txtContaminationTypeName.GotFocus += new EventHandler(txt_GotFocus); //获取焦点前发生事件
|
||||
txtContaminationTypeName.LostFocus += new EventHandler(txt_LostFocus); //失去焦点后发生事件
|
||||
}
|
||||
public string ContaminationId { get; set; }
|
||||
private void frmEditContaminationType_Load(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
InitControlEvent();
|
||||
this.SetFormControlText(GlobalHelper.LanguageCode);
|
||||
string sql = $@"select CLEAN_MODE_CODE,CLEAN_MODE_NAME from BAS_CLEAN_MODE where DEL_FLAG=0";
|
||||
DataTable dt = LeadDbHelperSQLite.Query(sql).Tables[0];
|
||||
if (dt != null && dt.Rows.Count > 0)
|
||||
{
|
||||
cmbCleanMode.Items.Add(new ListItem
|
||||
{
|
||||
Value = "0",
|
||||
Text = "Please Select",
|
||||
});
|
||||
foreach (DataRow item in dt.Rows)
|
||||
{
|
||||
cmbCleanMode.Items.Add(new ListItem
|
||||
{
|
||||
Value = item["CLEAN_MODE_CODE"].ToString(),
|
||||
Text = item["CLEAN_MODE_NAME"].ToString(),
|
||||
});
|
||||
}
|
||||
cmbCleanMode.SelectedIndex = 0;
|
||||
}
|
||||
|
||||
string sql1 = $@"SELECT A.CONTAMINATION_TYPE_CODE,A.CONTAMINATION_TYPE_NAME,B.CLEAN_MODE_CODE,B.CLEAN_MODE_NAME FROM BAS_CONTAMINATION_TYPE A LEFT JOIN BAS_CLEAN_MODE B ON A.CLEAN_MODE_CODE = B.CLEAN_MODE_CODE WHERE A.CONTAMINATION_TYPE_ID = '{ContaminationId}'";
|
||||
DataTable dt1 = LeadDbHelperSQLite.Query(sql1).Tables[0];
|
||||
if (dt1 != null && dt1.Rows.Count > 0)
|
||||
{
|
||||
txtContaminationTypeCode.Text = dt1.Rows[0]["CONTAMINATION_TYPE_CODE"].ToString();
|
||||
txtContaminationTypeCode.Enabled = false;
|
||||
txtContaminationTypeName.Text = dt1.Rows[0]["CONTAMINATION_TYPE_NAME"].ToString();
|
||||
cmbCleanMode.Text = dt1.Rows[0]["CLEAN_MODE_NAME"].ToString();
|
||||
cmbCleanMode.Enabled = false;
|
||||
}
|
||||
kryptonPanel1.Focus();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("编辑污染类型界面加载异常", "LoadEditFrmExp") + $":【{ex.Message}】!");
|
||||
}
|
||||
}
|
||||
|
||||
private void btnAdd_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (cmbCleanMode.SelectedIndex == 0)
|
||||
{
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请选择清洗方式!", "SelectCleanModeInfo"));
|
||||
return;
|
||||
}
|
||||
if (string.IsNullOrEmpty(txtContaminationTypeCode.Text))
|
||||
{
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请输入污染类型编码!", "EnterContaminationTypeCodeInfo"));
|
||||
return;
|
||||
}
|
||||
if (string.IsNullOrEmpty(txtContaminationTypeName.Text))
|
||||
{
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请输入污染类型名称!", "EnterContaminationTypeNameInfo"));
|
||||
return;
|
||||
}
|
||||
string sql = $@"update BAS_CONTAMINATION_TYPE set CONTAMINATION_TYPE_NAME = '{txtContaminationTypeName.Text}',UPDATE_BY = '{GlobalHelper.UserInfo.USER_ID}',UPDATE_TIME = datetime('now', 'localtime') where CONTAMINATION_TYPE_ID = '{ContaminationId}'";
|
||||
int row = LeadDbHelperSQLite.ExecuteSql(sql);
|
||||
if (row > 0)
|
||||
{
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("编辑污染类型数据成功!", "EditSuccessInfo"));
|
||||
frmContaminationType.RefreshFrmHost();
|
||||
this.Close();
|
||||
}
|
||||
else
|
||||
{
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("编辑污染类型数据失败!", "EditFailInfo"));
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("编辑污染类型数据发生异常", "EditContaminationTypeDataExp") + $":【{ex.Message}】!");
|
||||
}
|
||||
}
|
||||
|
||||
private void btnEdit_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
120
CleanMachineHMI/frmChild/frmEditContaminationType.resx
Normal file
120
CleanMachineHMI/frmChild/frmEditContaminationType.resx
Normal file
@@ -0,0 +1,120 @@
|
||||
<?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>
|
||||
168
CleanMachineHMI/frmChild/frmEditParamater.Designer.cs
generated
Normal file
168
CleanMachineHMI/frmChild/frmEditParamater.Designer.cs
generated
Normal file
@@ -0,0 +1,168 @@
|
||||
namespace CleanMachineHMI.frmChild
|
||||
{
|
||||
partial class frmEditParamater
|
||||
{
|
||||
/// <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.kryptonPanel1 = new ComponentFactory.Krypton.Toolkit.KryptonPanel();
|
||||
this.txtValue = new ComponentFactory.Krypton.Toolkit.KryptonTextBox();
|
||||
this.txtKey = new ComponentFactory.Krypton.Toolkit.KryptonTextBox();
|
||||
this.lbValue = new ComponentFactory.Krypton.Toolkit.KryptonLabel();
|
||||
this.lbKey = new ComponentFactory.Krypton.Toolkit.KryptonLabel();
|
||||
this.btnEdit = new ComponentFactory.Krypton.Toolkit.KryptonButton();
|
||||
this.btnAdd = new ComponentFactory.Krypton.Toolkit.KryptonButton();
|
||||
((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit();
|
||||
this.kryptonPanel1.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// kryptonPanel1
|
||||
//
|
||||
this.kryptonPanel1.Controls.Add(this.txtValue);
|
||||
this.kryptonPanel1.Controls.Add(this.txtKey);
|
||||
this.kryptonPanel1.Controls.Add(this.lbValue);
|
||||
this.kryptonPanel1.Controls.Add(this.lbKey);
|
||||
this.kryptonPanel1.Controls.Add(this.btnEdit);
|
||||
this.kryptonPanel1.Controls.Add(this.btnAdd);
|
||||
this.kryptonPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.kryptonPanel1.Location = new System.Drawing.Point(0, 0);
|
||||
this.kryptonPanel1.Name = "kryptonPanel1";
|
||||
this.kryptonPanel1.Size = new System.Drawing.Size(289, 229);
|
||||
this.kryptonPanel1.TabIndex = 4;
|
||||
//
|
||||
// txtValue
|
||||
//
|
||||
this.txtValue.AlwaysActive = false;
|
||||
this.txtValue.Location = new System.Drawing.Point(23, 117);
|
||||
this.txtValue.Name = "txtValue";
|
||||
this.txtValue.PaletteMode = ComponentFactory.Krypton.Toolkit.PaletteMode.ProfessionalOffice2003;
|
||||
this.txtValue.Size = new System.Drawing.Size(248, 35);
|
||||
this.txtValue.StateActive.Border.Color1 = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(255)))));
|
||||
this.txtValue.StateActive.Border.DrawBorders = ((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders)((((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Top | ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Bottom)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Left)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Right)));
|
||||
this.txtValue.StateCommon.Border.DrawBorders = ((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders)((((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Top | ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Bottom)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Left)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Right)));
|
||||
this.txtValue.StateCommon.Border.GraphicsHint = ComponentFactory.Krypton.Toolkit.PaletteGraphicsHint.AntiAlias;
|
||||
this.txtValue.StateCommon.Border.Rounding = 4;
|
||||
this.txtValue.StateCommon.Border.Width = 2;
|
||||
this.txtValue.StateCommon.Content.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.txtValue.TabIndex = 39;
|
||||
//
|
||||
// txtKey
|
||||
//
|
||||
this.txtKey.AlwaysActive = false;
|
||||
this.txtKey.Location = new System.Drawing.Point(23, 44);
|
||||
this.txtKey.Name = "txtKey";
|
||||
this.txtKey.PaletteMode = ComponentFactory.Krypton.Toolkit.PaletteMode.ProfessionalOffice2003;
|
||||
this.txtKey.Size = new System.Drawing.Size(248, 35);
|
||||
this.txtKey.StateActive.Border.Color1 = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(255)))));
|
||||
this.txtKey.StateActive.Border.DrawBorders = ((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders)((((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Top | ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Bottom)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Left)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Right)));
|
||||
this.txtKey.StateCommon.Border.DrawBorders = ((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders)((((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Top | ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Bottom)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Left)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Right)));
|
||||
this.txtKey.StateCommon.Border.GraphicsHint = ComponentFactory.Krypton.Toolkit.PaletteGraphicsHint.AntiAlias;
|
||||
this.txtKey.StateCommon.Border.Rounding = 4;
|
||||
this.txtKey.StateCommon.Border.Width = 2;
|
||||
this.txtKey.StateCommon.Content.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.txtKey.TabIndex = 38;
|
||||
//
|
||||
// lbValue
|
||||
//
|
||||
this.lbValue.LabelStyle = ComponentFactory.Krypton.Toolkit.LabelStyle.TitleControl;
|
||||
this.lbValue.Location = new System.Drawing.Point(23, 85);
|
||||
this.lbValue.Name = "lbValue";
|
||||
this.lbValue.Size = new System.Drawing.Size(66, 26);
|
||||
this.lbValue.StateCommon.ShortText.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.lbValue.TabIndex = 37;
|
||||
this.lbValue.Values.Text = "设定值:";
|
||||
//
|
||||
// lbKey
|
||||
//
|
||||
this.lbKey.LabelStyle = ComponentFactory.Krypton.Toolkit.LabelStyle.TitleControl;
|
||||
this.lbKey.Location = new System.Drawing.Point(23, 12);
|
||||
this.lbKey.Name = "lbKey";
|
||||
this.lbKey.Size = new System.Drawing.Size(82, 26);
|
||||
this.lbKey.StateCommon.ShortText.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.lbKey.TabIndex = 36;
|
||||
this.lbKey.Values.Text = "参数名称:";
|
||||
//
|
||||
// btnEdit
|
||||
//
|
||||
this.btnEdit.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.btnEdit.Location = new System.Drawing.Point(183, 168);
|
||||
this.btnEdit.Name = "btnEdit";
|
||||
this.btnEdit.Size = new System.Drawing.Size(82, 40);
|
||||
this.btnEdit.StateCommon.Content.ShortText.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.btnEdit.TabIndex = 35;
|
||||
this.btnEdit.Values.Text = "取消";
|
||||
this.btnEdit.Click += new System.EventHandler(this.btnEdit_Click);
|
||||
//
|
||||
// btnAdd
|
||||
//
|
||||
this.btnAdd.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.btnAdd.Location = new System.Drawing.Point(23, 168);
|
||||
this.btnAdd.Name = "btnAdd";
|
||||
this.btnAdd.Size = new System.Drawing.Size(82, 40);
|
||||
this.btnAdd.StateCommon.Content.ShortText.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.btnAdd.TabIndex = 34;
|
||||
this.btnAdd.Values.Text = "确认";
|
||||
this.btnAdd.Click += new System.EventHandler(this.btnAdd_Click);
|
||||
//
|
||||
// frmEditParamater
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(289, 229);
|
||||
this.Controls.Add(this.kryptonPanel1);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "frmEditParamater";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||
this.Text = "frmEditParamater";
|
||||
this.Load += new System.EventHandler(this.frmEditParamater_Load);
|
||||
((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).EndInit();
|
||||
this.kryptonPanel1.ResumeLayout(false);
|
||||
this.kryptonPanel1.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonPanel kryptonPanel1;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonButton btnEdit;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonButton btnAdd;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonTextBox txtValue;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonTextBox txtKey;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonLabel lbValue;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonLabel lbKey;
|
||||
}
|
||||
}
|
||||
99
CleanMachineHMI/frmChild/frmEditParamater.cs
Normal file
99
CleanMachineHMI/frmChild/frmEditParamater.cs
Normal file
@@ -0,0 +1,99 @@
|
||||
using CleanMachineHMI.forms;
|
||||
using CleanMachineHMI.FrmUserControl;
|
||||
using CleanMachineHMI.Utils;
|
||||
using ComponentFactory.Krypton.Toolkit;
|
||||
using LeadDataBaseUtility;
|
||||
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;
|
||||
|
||||
namespace CleanMachineHMI.frmChild
|
||||
{
|
||||
public partial class frmEditParamater : KryptonForm
|
||||
{
|
||||
public frmEditParamater()
|
||||
{
|
||||
InitializeComponent();
|
||||
_InfoLanguageTextList = this.GetInfoLanguageText(GlobalHelper.LanguageCode);
|
||||
}
|
||||
private DataTable _InfoLanguageTextList;
|
||||
public string ParamaterId { get; set; }
|
||||
private void txt_GotFocus(object sender, EventArgs e)
|
||||
{
|
||||
KeyboardAutoPopUp.ShowInputPanel();
|
||||
}
|
||||
private void txt_LostFocus(object sender, EventArgs e)
|
||||
{
|
||||
KeyboardAutoPopUp.HideInputPanel();
|
||||
}
|
||||
private void InitControlEvent()
|
||||
{
|
||||
txtValue.GotFocus += new EventHandler(txt_GotFocus); //获取焦点前发生事件
|
||||
txtValue.LostFocus += new EventHandler(txt_LostFocus); //失去焦点后发生事件
|
||||
}
|
||||
|
||||
private void frmEditParamater_Load(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
InitControlEvent();
|
||||
this.SetFormControlText(GlobalHelper.LanguageCode);
|
||||
string sql = $@"SELECT * FROM SYS_PARAMETER WHERE PARAMETER_ID = '{ParamaterId}'";
|
||||
DataTable dt = LeadDbHelperSQLite.Query(sql).Tables[0];
|
||||
if (dt != null && dt.Rows.Count > 0)
|
||||
{
|
||||
txtKey.Text = dt.Rows[0]["PARAMETER_CODE"].ToString();
|
||||
txtKey.Enabled = false;
|
||||
txtValue.Text = dt.Rows[0]["PARAMETER_VALUE"].ToString();
|
||||
}
|
||||
kryptonPanel1.Focus();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("编辑参数数据界面加载异常", "LoadEditFrmExp") + $":【{ex.Message}】!");
|
||||
}
|
||||
}
|
||||
|
||||
private void btnAdd_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (string.IsNullOrEmpty(txtValue.Text))
|
||||
{
|
||||
//KryptonMessageBox.Show("请输入参数值!");
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请输入参数值!", "EnterparamaterVlaueInfo"));
|
||||
return;
|
||||
}
|
||||
string sql = $@"update SYS_PARAMETER set PARAMETER_VALUE = '{txtValue.Text}',UPDATE_BY = '{GlobalHelper.UserInfo.USER_ID}',UPDATE_TIME = datetime('now', 'localtime') where PARAMETER_ID = '{ParamaterId}'";
|
||||
int row = LeadDbHelperSQLite.ExecuteSql(sql);
|
||||
if (row > 0)
|
||||
{
|
||||
//KryptonMessageBox.Show("修改参数信息数据成功!");
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("编辑参数数据成功!", "EditSuccessInfo"));
|
||||
frmParamater.RefreshFrmHost();
|
||||
this.Close();
|
||||
}
|
||||
else
|
||||
{
|
||||
//KryptonMessageBox.Show("修改参数信息数据失败!");
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("编辑参数数据失败!", "EditFailInfo"));
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("编辑参数数据发生异常", "EditParamaterDataExp") + $":【{ex.Message}】!");
|
||||
}
|
||||
}
|
||||
|
||||
private void btnEdit_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
120
CleanMachineHMI/frmChild/frmEditParamater.resx
Normal file
120
CleanMachineHMI/frmChild/frmEditParamater.resx
Normal file
@@ -0,0 +1,120 @@
|
||||
<?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>
|
||||
250
CleanMachineHMI/frmChild/frmEditPlcItem.Designer.cs
generated
Normal file
250
CleanMachineHMI/frmChild/frmEditPlcItem.Designer.cs
generated
Normal file
@@ -0,0 +1,250 @@
|
||||
namespace CleanMachineHMI.frmChild
|
||||
{
|
||||
partial class frmEditPlcItem
|
||||
{
|
||||
/// <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.kryptonManager = new ComponentFactory.Krypton.Toolkit.KryptonManager(this.components);
|
||||
this.kryptonPanel1 = new ComponentFactory.Krypton.Toolkit.KryptonPanel();
|
||||
this.knud_plcItemDeviationAddress = new ComponentFactory.Krypton.Toolkit.KryptonNumericUpDown();
|
||||
this.kryptonLabel6 = new ComponentFactory.Krypton.Toolkit.KryptonLabel();
|
||||
this.kcmb_plcItemDataType = new ComponentFactory.Krypton.Toolkit.KryptonComboBox();
|
||||
this.kcmb_plcItemType = new ComponentFactory.Krypton.Toolkit.KryptonComboBox();
|
||||
this.kryptonButton1 = new ComponentFactory.Krypton.Toolkit.KryptonButton();
|
||||
this.knud_plcItemPriAddress = new ComponentFactory.Krypton.Toolkit.KryptonNumericUpDown();
|
||||
this.ktb_plcItemName = new ComponentFactory.Krypton.Toolkit.KryptonTextBox();
|
||||
this.kryptonLabel5 = new ComponentFactory.Krypton.Toolkit.KryptonLabel();
|
||||
this.kryptonLabel4 = new ComponentFactory.Krypton.Toolkit.KryptonLabel();
|
||||
this.kryptonLabel3 = new ComponentFactory.Krypton.Toolkit.KryptonLabel();
|
||||
this.kryptonLabel2 = new ComponentFactory.Krypton.Toolkit.KryptonLabel();
|
||||
this.ktb_plcItemCode = new ComponentFactory.Krypton.Toolkit.KryptonTextBox();
|
||||
this.kryptonLabel1 = new ComponentFactory.Krypton.Toolkit.KryptonLabel();
|
||||
this.kryptonButton2 = new ComponentFactory.Krypton.Toolkit.KryptonButton();
|
||||
((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit();
|
||||
this.kryptonPanel1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.kcmb_plcItemDataType)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.kcmb_plcItemType)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// kryptonManager
|
||||
//
|
||||
this.kryptonManager.GlobalPaletteMode = ComponentFactory.Krypton.Toolkit.PaletteModeManager.Office2007Blue;
|
||||
//
|
||||
// kryptonPanel1
|
||||
//
|
||||
this.kryptonPanel1.Controls.Add(this.knud_plcItemDeviationAddress);
|
||||
this.kryptonPanel1.Controls.Add(this.kryptonLabel6);
|
||||
this.kryptonPanel1.Controls.Add(this.kcmb_plcItemDataType);
|
||||
this.kryptonPanel1.Controls.Add(this.kcmb_plcItemType);
|
||||
this.kryptonPanel1.Controls.Add(this.kryptonButton2);
|
||||
this.kryptonPanel1.Controls.Add(this.kryptonButton1);
|
||||
this.kryptonPanel1.Controls.Add(this.knud_plcItemPriAddress);
|
||||
this.kryptonPanel1.Controls.Add(this.ktb_plcItemName);
|
||||
this.kryptonPanel1.Controls.Add(this.kryptonLabel5);
|
||||
this.kryptonPanel1.Controls.Add(this.kryptonLabel4);
|
||||
this.kryptonPanel1.Controls.Add(this.kryptonLabel3);
|
||||
this.kryptonPanel1.Controls.Add(this.kryptonLabel2);
|
||||
this.kryptonPanel1.Controls.Add(this.ktb_plcItemCode);
|
||||
this.kryptonPanel1.Controls.Add(this.kryptonLabel1);
|
||||
this.kryptonPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.kryptonPanel1.Location = new System.Drawing.Point(0, 0);
|
||||
this.kryptonPanel1.Name = "kryptonPanel1";
|
||||
this.kryptonPanel1.Size = new System.Drawing.Size(274, 396);
|
||||
this.kryptonPanel1.TabIndex = 18;
|
||||
//
|
||||
// knud_plcItemDeviationAddress
|
||||
//
|
||||
this.knud_plcItemDeviationAddress.Location = new System.Drawing.Point(18, 305);
|
||||
this.knud_plcItemDeviationAddress.Maximum = new decimal(new int[] {
|
||||
50,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.knud_plcItemDeviationAddress.Name = "knud_plcItemDeviationAddress";
|
||||
this.knud_plcItemDeviationAddress.Size = new System.Drawing.Size(235, 22);
|
||||
this.knud_plcItemDeviationAddress.TabIndex = 30;
|
||||
//
|
||||
// kryptonLabel6
|
||||
//
|
||||
this.kryptonLabel6.Location = new System.Drawing.Point(18, 279);
|
||||
this.kryptonLabel6.Name = "kryptonLabel6";
|
||||
this.kryptonLabel6.Size = new System.Drawing.Size(121, 20);
|
||||
this.kryptonLabel6.TabIndex = 29;
|
||||
this.kryptonLabel6.Values.Text = "PLC变量偏移位置:";
|
||||
//
|
||||
// kcmb_plcItemDataType
|
||||
//
|
||||
this.kcmb_plcItemDataType.DropDownWidth = 207;
|
||||
this.kcmb_plcItemDataType.Items.AddRange(new object[] {
|
||||
"M 布尔类型",
|
||||
"D 整数类型",
|
||||
"X 布尔类型",
|
||||
"Y 布尔类型"});
|
||||
this.kcmb_plcItemDataType.Location = new System.Drawing.Point(18, 198);
|
||||
this.kcmb_plcItemDataType.Name = "kcmb_plcItemDataType";
|
||||
this.kcmb_plcItemDataType.Size = new System.Drawing.Size(235, 21);
|
||||
this.kcmb_plcItemDataType.TabIndex = 27;
|
||||
this.kcmb_plcItemDataType.SelectionChangeCommitted += new System.EventHandler(this.kcmb_plcItemDataType_SelectionChangeCommitted);
|
||||
//
|
||||
// kcmb_plcItemType
|
||||
//
|
||||
this.kcmb_plcItemType.DropDownWidth = 207;
|
||||
this.kcmb_plcItemType.Items.AddRange(new object[] {
|
||||
"写入变量",
|
||||
"读取变量",
|
||||
"可读可写"});
|
||||
this.kcmb_plcItemType.Location = new System.Drawing.Point(18, 145);
|
||||
this.kcmb_plcItemType.Name = "kcmb_plcItemType";
|
||||
this.kcmb_plcItemType.Size = new System.Drawing.Size(235, 21);
|
||||
this.kcmb_plcItemType.TabIndex = 28;
|
||||
//
|
||||
// kryptonButton1
|
||||
//
|
||||
this.kryptonButton1.Location = new System.Drawing.Point(18, 343);
|
||||
this.kryptonButton1.Name = "kryptonButton1";
|
||||
this.kryptonButton1.Size = new System.Drawing.Size(90, 36);
|
||||
this.kryptonButton1.TabIndex = 26;
|
||||
this.kryptonButton1.Values.Text = "确认";
|
||||
this.kryptonButton1.Click += new System.EventHandler(this.kryptonButton1_Click);
|
||||
//
|
||||
// knud_plcItemPriAddress
|
||||
//
|
||||
this.knud_plcItemPriAddress.Location = new System.Drawing.Point(18, 251);
|
||||
this.knud_plcItemPriAddress.Maximum = new decimal(new int[] {
|
||||
9999,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.knud_plcItemPriAddress.Name = "knud_plcItemPriAddress";
|
||||
this.knud_plcItemPriAddress.Size = new System.Drawing.Size(235, 22);
|
||||
this.knud_plcItemPriAddress.TabIndex = 25;
|
||||
//
|
||||
// ktb_plcItemName
|
||||
//
|
||||
this.ktb_plcItemName.Location = new System.Drawing.Point(18, 90);
|
||||
this.ktb_plcItemName.Name = "ktb_plcItemName";
|
||||
this.ktb_plcItemName.Size = new System.Drawing.Size(235, 23);
|
||||
this.ktb_plcItemName.TabIndex = 23;
|
||||
//
|
||||
// kryptonLabel5
|
||||
//
|
||||
this.kryptonLabel5.Location = new System.Drawing.Point(18, 225);
|
||||
this.kryptonLabel5.Name = "kryptonLabel5";
|
||||
this.kryptonLabel5.Size = new System.Drawing.Size(134, 20);
|
||||
this.kryptonLabel5.TabIndex = 18;
|
||||
this.kryptonLabel5.Values.Text = "PLC变量寄存器地址:";
|
||||
//
|
||||
// kryptonLabel4
|
||||
//
|
||||
this.kryptonLabel4.Location = new System.Drawing.Point(18, 172);
|
||||
this.kryptonLabel4.Name = "kryptonLabel4";
|
||||
this.kryptonLabel4.Size = new System.Drawing.Size(121, 20);
|
||||
this.kryptonLabel4.TabIndex = 19;
|
||||
this.kryptonLabel4.Values.Text = "PLC变量数据类型:";
|
||||
//
|
||||
// kryptonLabel3
|
||||
//
|
||||
this.kryptonLabel3.Location = new System.Drawing.Point(18, 119);
|
||||
this.kryptonLabel3.Name = "kryptonLabel3";
|
||||
this.kryptonLabel3.Size = new System.Drawing.Size(95, 20);
|
||||
this.kryptonLabel3.TabIndex = 20;
|
||||
this.kryptonLabel3.Values.Text = "PLC变量类型:";
|
||||
//
|
||||
// kryptonLabel2
|
||||
//
|
||||
this.kryptonLabel2.Location = new System.Drawing.Point(18, 64);
|
||||
this.kryptonLabel2.Name = "kryptonLabel2";
|
||||
this.kryptonLabel2.Size = new System.Drawing.Size(95, 20);
|
||||
this.kryptonLabel2.TabIndex = 21;
|
||||
this.kryptonLabel2.Values.Text = "PLC变量编码:";
|
||||
//
|
||||
// ktb_plcItemCode
|
||||
//
|
||||
this.ktb_plcItemCode.Location = new System.Drawing.Point(18, 35);
|
||||
this.ktb_plcItemCode.Name = "ktb_plcItemCode";
|
||||
this.ktb_plcItemCode.Size = new System.Drawing.Size(235, 23);
|
||||
this.ktb_plcItemCode.TabIndex = 24;
|
||||
//
|
||||
// kryptonLabel1
|
||||
//
|
||||
this.kryptonLabel1.Location = new System.Drawing.Point(18, 11);
|
||||
this.kryptonLabel1.Name = "kryptonLabel1";
|
||||
this.kryptonLabel1.Size = new System.Drawing.Size(95, 20);
|
||||
this.kryptonLabel1.TabIndex = 22;
|
||||
this.kryptonLabel1.Values.Text = "PLC变量编码:";
|
||||
//
|
||||
// kryptonButton2
|
||||
//
|
||||
this.kryptonButton2.Location = new System.Drawing.Point(163, 343);
|
||||
this.kryptonButton2.Name = "kryptonButton2";
|
||||
this.kryptonButton2.Size = new System.Drawing.Size(90, 36);
|
||||
this.kryptonButton2.TabIndex = 26;
|
||||
this.kryptonButton2.Values.Text = "取消";
|
||||
this.kryptonButton2.Click += new System.EventHandler(this.kryptonButton2_Click);
|
||||
//
|
||||
// frmEditPlcItem
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(274, 396);
|
||||
this.Controls.Add(this.kryptonPanel1);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "frmEditPlcItem";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||
this.Text = "Edit PLC variable";
|
||||
this.Load += new System.EventHandler(this.frmEditPlcItem_Load);
|
||||
((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).EndInit();
|
||||
this.kryptonPanel1.ResumeLayout(false);
|
||||
this.kryptonPanel1.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.kcmb_plcItemDataType)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.kcmb_plcItemType)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
public ComponentFactory.Krypton.Toolkit.KryptonManager kryptonManager;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonPanel kryptonPanel1;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonComboBox kcmb_plcItemDataType;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonComboBox kcmb_plcItemType;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonButton kryptonButton1;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonNumericUpDown knud_plcItemPriAddress;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonTextBox ktb_plcItemName;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonLabel kryptonLabel5;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonLabel kryptonLabel4;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonLabel kryptonLabel3;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonLabel kryptonLabel2;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonTextBox ktb_plcItemCode;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonLabel kryptonLabel1;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonNumericUpDown knud_plcItemDeviationAddress;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonLabel kryptonLabel6;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonButton kryptonButton2;
|
||||
}
|
||||
}
|
||||
226
CleanMachineHMI/frmChild/frmEditPlcItem.cs
Normal file
226
CleanMachineHMI/frmChild/frmEditPlcItem.cs
Normal file
@@ -0,0 +1,226 @@
|
||||
using CleanMachineHMI.FrmUserControl;
|
||||
using CleanMachineHMI.Utils;
|
||||
using ComponentFactory.Krypton.Toolkit;
|
||||
using LeadDataBaseUtility;
|
||||
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;
|
||||
|
||||
namespace CleanMachineHMI.frmChild
|
||||
{
|
||||
public partial class frmEditPlcItem : KryptonForm
|
||||
{
|
||||
public frmEditPlcItem()
|
||||
{
|
||||
InitializeComponent();
|
||||
_ComboBoxLanguageTextList = this.GetInfoLanguageText(GlobalHelper.LanguageCode, "KryptonComboBox");
|
||||
_InfoLanguageTextList = this.GetInfoLanguageText(GlobalHelper.LanguageCode);
|
||||
}
|
||||
private DataTable _ComboBoxLanguageTextList;
|
||||
private DataTable _InfoLanguageTextList;
|
||||
public string PlcItemId { get; set; }
|
||||
int modbusMinIndex = 0;
|
||||
private void txt_GotFocus(object sender, EventArgs e)
|
||||
{
|
||||
KeyboardAutoPopUp.ShowInputPanel();
|
||||
}
|
||||
private void txt_LostFocus(object sender, EventArgs e)
|
||||
{
|
||||
KeyboardAutoPopUp.HideInputPanel();
|
||||
}
|
||||
private void InitControlEvent()
|
||||
{
|
||||
ktb_plcItemCode.GotFocus += new EventHandler(txt_GotFocus); //获取焦点前发生事件
|
||||
ktb_plcItemCode.LostFocus += new EventHandler(txt_LostFocus); //失去焦点后发生事件
|
||||
|
||||
ktb_plcItemName.GotFocus += new EventHandler(txt_GotFocus); //获取焦点前发生事件
|
||||
ktb_plcItemName.LostFocus += new EventHandler(txt_LostFocus); //失去焦点后发生事件
|
||||
|
||||
knud_plcItemPriAddress.GotFocus += new EventHandler(txt_GotFocus); //获取焦点前发生事件
|
||||
knud_plcItemPriAddress.LostFocus += new EventHandler(txt_LostFocus); //失去焦点后发生事件
|
||||
|
||||
knud_plcItemDeviationAddress.GotFocus += new EventHandler(txt_GotFocus); //获取焦点前发生事件
|
||||
knud_plcItemDeviationAddress.LostFocus += new EventHandler(txt_LostFocus); //失去焦点后发生事件
|
||||
}
|
||||
private void frmEditPlcItem_Load(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
InitControlEvent();
|
||||
this.SetFormControlText(GlobalHelper.LanguageCode);
|
||||
if (GlobalHelper.LanguageCode == "English")
|
||||
{
|
||||
kcmb_plcItemType.Items.Clear();
|
||||
foreach (DataRow item in _ComboBoxLanguageTextList.GetComBoboxItemArr(kcmb_plcItemType.Name, "KryptonComboBox"))
|
||||
{
|
||||
kcmb_plcItemType.Items.Add(item["CONTROL_NAME"].ToString());
|
||||
}
|
||||
kcmb_plcItemDataType.Items.Clear();
|
||||
foreach (DataRow item in _ComboBoxLanguageTextList.GetComBoboxItemArr(kcmb_plcItemDataType.Name, "KryptonComboBox"))
|
||||
{
|
||||
kcmb_plcItemDataType.Items.Add(item["CONTROL_NAME"].ToString());
|
||||
}
|
||||
}
|
||||
kcmb_plcItemType.SelectedIndex = 0;
|
||||
kcmb_plcItemDataType.SelectedIndex = 0;
|
||||
string sql = $@"SELECT * FROM BAS_PLC_ITEM WHERE PLC_ITEM_ID = '{PlcItemId}'";
|
||||
DataTable dt = LeadDbHelperSQLite.Query(sql).Tables[0];
|
||||
if (dt != null && dt.Rows.Count > 0)
|
||||
{
|
||||
ktb_plcItemCode.Text = dt.Rows[0]["PLC_ITEM_CODE"].ToString();
|
||||
ktb_plcItemName.Text = dt.Rows[0]["PLC_ITEM_NAME"].ToString();
|
||||
kcmb_plcItemType.SelectedIndex = Convert.ToInt32(dt.Rows[0]["PLC_ITEM_TYPE"]);
|
||||
kcmb_plcItemDataType.SelectedIndex = Convert.ToInt32(dt.Rows[0]["PLC_ITEM_DATA_TYPE"]);
|
||||
knud_plcItemPriAddress.Value = Convert.ToInt32(dt.Rows[0]["PLC_ITEM_PRI_ADDRESS"]);
|
||||
knud_plcItemDeviationAddress.Value = Convert.ToInt32(dt.Rows[0]["PLC_ITEM_DEVIATION_ADDRESS"]);
|
||||
ktb_plcItemCode.Enabled = false;
|
||||
kcmb_plcItemDataType_SelectionChangeCommitted(sender, e);
|
||||
}
|
||||
kryptonPanel1.Focus();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("编辑PLC变量数据界面加载异常", "LoadEditFrmExp") + $":【{ex.Message}】!");
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 判断是否八进制格式字符串
|
||||
/// </summary>
|
||||
/// <param name="str"></param>
|
||||
/// <returns></returns>
|
||||
public bool IsOctal(string str)
|
||||
{
|
||||
string PATTERN = @"[0-7]+$";
|
||||
return System.Text.RegularExpressions.Regex.IsMatch(str, PATTERN);
|
||||
}
|
||||
private void kryptonButton1_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (string.IsNullOrEmpty(ktb_plcItemCode.Text))
|
||||
{
|
||||
//KryptonMessageBox.Show("请输入PLC编码");
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请输入PLC变量编码!", "EnterPlcItemCodeInfo"));
|
||||
return;
|
||||
}
|
||||
if (string.IsNullOrEmpty(ktb_plcItemName.Text))
|
||||
{
|
||||
//KryptonMessageBox.Show("请输入PLC名称");
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请输入PLC变量名称!", "EnterPlcItemNameInfo"));
|
||||
return;
|
||||
}
|
||||
if (string.IsNullOrEmpty(kcmb_plcItemType.Text))
|
||||
{
|
||||
//KryptonMessageBox.Show("请选择PLC类型");
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请选择PLC变量类型!", "SelectPlcItemTypeInfo"));
|
||||
return;
|
||||
}
|
||||
if (string.IsNullOrEmpty(kcmb_plcItemDataType.Text))
|
||||
{
|
||||
//KryptonMessageBox.Show("请选择PLC数据类型");
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请选择PLC变量数据类型!", "SelectPlcItemDataTypeInfo"));
|
||||
return;
|
||||
}
|
||||
int addPriIndex = Convert.ToInt32(knud_plcItemPriAddress.Value);
|
||||
if (kcmb_plcItemDataType.SelectedIndex == 0)
|
||||
{
|
||||
if (addPriIndex <= 1535)
|
||||
{
|
||||
modbusMinIndex = 2049;
|
||||
}
|
||||
else
|
||||
{
|
||||
modbusMinIndex = 5057;
|
||||
}
|
||||
}
|
||||
else if (kcmb_plcItemDataType.SelectedIndex == 1)
|
||||
{
|
||||
modbusMinIndex = 4097;
|
||||
}
|
||||
else if (kcmb_plcItemDataType.SelectedIndex == 2)
|
||||
{
|
||||
modbusMinIndex = 1025;
|
||||
if (!IsOctal(addPriIndex.ToString()))
|
||||
{
|
||||
//KryptonMessageBox.Show("当PLC数据类型为:【X】,输入的PLC地址只能是八进制的数字!");
|
||||
KryptonMessageBox.Show("When PLC item data type is【X】, input PLC address can only be octal number!");
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if (kcmb_plcItemDataType.SelectedIndex == 3)
|
||||
{
|
||||
modbusMinIndex = 1281;
|
||||
if (!IsOctal(addPriIndex.ToString()))
|
||||
{
|
||||
//KryptonMessageBox.Show("当PLC数据类型为:【Y】,输入的PLC地址只能是八进制的数字!");
|
||||
KryptonMessageBox.Show("When PLC item data type is【Y】, input PLC address can only be octal number!");
|
||||
return;
|
||||
}
|
||||
}
|
||||
int plcModbusAdd = modbusMinIndex + addPriIndex - 1;
|
||||
string sql = $@"
|
||||
UPDATE BAS_PLC_ITEM
|
||||
SET PLC_ITEM_NAME = '{ktb_plcItemName.Text}',
|
||||
PLC_ITEM_TYPE = '{kcmb_plcItemType.SelectedIndex}',
|
||||
PLC_ITEM_DATA_TYPE = '{kcmb_plcItemDataType.SelectedIndex}',
|
||||
PLC_ITEM_MODBUS_ADDRESS = '{plcModbusAdd}',
|
||||
PLC_ITEM_DEVIATION_ADDRESS = '{Convert.ToInt32(knud_plcItemDeviationAddress.Value)}',
|
||||
PLC_ITEM_PRI_ADDRESS = '{addPriIndex}',
|
||||
UPDATE_BY = '{GlobalHelper.UserInfo.USER_ID}',
|
||||
UPDATE_TIME = datetime('now', 'localtime'),
|
||||
DATA_VERSION = DATA_VERSION + 1
|
||||
WHERE
|
||||
PLC_ITEM_ID = '{PlcItemId}'
|
||||
";
|
||||
int row = LeadDbHelperSQLite.ExecuteSql(sql);
|
||||
if (row > 0)
|
||||
{
|
||||
//KryptonMessageBox.Show("编辑PLC变量数据成功!");
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("编辑PLC变量数据成功!", "EditSuccessInfo"));
|
||||
frmPlcItemConfig.RefreshFrmHost();
|
||||
this.Close();
|
||||
}
|
||||
else
|
||||
{
|
||||
//KryptonMessageBox.Show("编辑PLC变量数据失败!");
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("编辑PLC变量数据失败!", "EditFailInfo"));
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("编辑PLC变量数据发生异常", "EditPlcItemDataExp") + $":【{ex.Message}】!");
|
||||
}
|
||||
}
|
||||
|
||||
private void kcmb_plcItemDataType_SelectionChangeCommitted(object sender, EventArgs e)
|
||||
{
|
||||
if (kcmb_plcItemDataType.SelectedIndex == 0)
|
||||
{
|
||||
knud_plcItemPriAddress.Maximum = 4095;
|
||||
}
|
||||
else if (kcmb_plcItemDataType.SelectedIndex == 1)
|
||||
{
|
||||
knud_plcItemPriAddress.Maximum = 9999;
|
||||
}
|
||||
else if (kcmb_plcItemDataType.SelectedIndex == 2)
|
||||
{
|
||||
knud_plcItemPriAddress.Maximum = 377;
|
||||
}
|
||||
else if (kcmb_plcItemDataType.SelectedIndex == 3)
|
||||
{
|
||||
knud_plcItemPriAddress.Maximum = 377;
|
||||
}
|
||||
}
|
||||
|
||||
private void kryptonButton2_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
123
CleanMachineHMI/frmChild/frmEditPlcItem.resx
Normal file
123
CleanMachineHMI/frmChild/frmEditPlcItem.resx
Normal file
@@ -0,0 +1,123 @@
|
||||
<?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="kryptonManager.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
</root>
|
||||
197
CleanMachineHMI/frmChild/frmEditRole.Designer.cs
generated
Normal file
197
CleanMachineHMI/frmChild/frmEditRole.Designer.cs
generated
Normal file
@@ -0,0 +1,197 @@
|
||||
namespace CleanMachineHMI.frmChild
|
||||
{
|
||||
partial class frmEditRole
|
||||
{
|
||||
/// <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.kryptonPanel1 = new ComponentFactory.Krypton.Toolkit.KryptonPanel();
|
||||
this.btnClose = new ComponentFactory.Krypton.Toolkit.KryptonButton();
|
||||
this.btnAdd = new ComponentFactory.Krypton.Toolkit.KryptonButton();
|
||||
this.kcmb_roleGrade = new ComponentFactory.Krypton.Toolkit.KryptonComboBox();
|
||||
this.lbGender = new ComponentFactory.Krypton.Toolkit.KryptonLabel();
|
||||
this.txtRoleName = new ComponentFactory.Krypton.Toolkit.KryptonTextBox();
|
||||
this.lbName = new ComponentFactory.Krypton.Toolkit.KryptonLabel();
|
||||
this.txtRoleCode = new ComponentFactory.Krypton.Toolkit.KryptonTextBox();
|
||||
this.lbAccount = new ComponentFactory.Krypton.Toolkit.KryptonLabel();
|
||||
((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit();
|
||||
this.kryptonPanel1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.kcmb_roleGrade)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// kryptonPanel1
|
||||
//
|
||||
this.kryptonPanel1.Controls.Add(this.btnClose);
|
||||
this.kryptonPanel1.Controls.Add(this.btnAdd);
|
||||
this.kryptonPanel1.Controls.Add(this.kcmb_roleGrade);
|
||||
this.kryptonPanel1.Controls.Add(this.lbGender);
|
||||
this.kryptonPanel1.Controls.Add(this.txtRoleName);
|
||||
this.kryptonPanel1.Controls.Add(this.lbName);
|
||||
this.kryptonPanel1.Controls.Add(this.txtRoleCode);
|
||||
this.kryptonPanel1.Controls.Add(this.lbAccount);
|
||||
this.kryptonPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.kryptonPanel1.Location = new System.Drawing.Point(0, 0);
|
||||
this.kryptonPanel1.Name = "kryptonPanel1";
|
||||
this.kryptonPanel1.Size = new System.Drawing.Size(289, 266);
|
||||
this.kryptonPanel1.TabIndex = 2;
|
||||
//
|
||||
// btnClose
|
||||
//
|
||||
this.btnClose.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.btnClose.Location = new System.Drawing.Point(179, 214);
|
||||
this.btnClose.Name = "btnClose";
|
||||
this.btnClose.Size = new System.Drawing.Size(82, 40);
|
||||
this.btnClose.StateCommon.Content.ShortText.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.btnClose.TabIndex = 35;
|
||||
this.btnClose.Values.Text = "取消";
|
||||
this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
|
||||
//
|
||||
// btnAdd
|
||||
//
|
||||
this.btnAdd.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.btnAdd.Location = new System.Drawing.Point(29, 214);
|
||||
this.btnAdd.Name = "btnAdd";
|
||||
this.btnAdd.Size = new System.Drawing.Size(82, 40);
|
||||
this.btnAdd.StateCommon.Content.ShortText.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.btnAdd.TabIndex = 34;
|
||||
this.btnAdd.Values.Text = "确认";
|
||||
this.btnAdd.Click += new System.EventHandler(this.btnAdd_Click);
|
||||
//
|
||||
// kcmb_roleGrade
|
||||
//
|
||||
this.kcmb_roleGrade.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.kcmb_roleGrade.DropDownWidth = 271;
|
||||
this.kcmb_roleGrade.Items.AddRange(new object[] {
|
||||
"请选择",
|
||||
"管理员",
|
||||
"普通用户"});
|
||||
this.kcmb_roleGrade.Location = new System.Drawing.Point(29, 172);
|
||||
this.kcmb_roleGrade.Name = "kcmb_roleGrade";
|
||||
this.kcmb_roleGrade.Size = new System.Drawing.Size(232, 31);
|
||||
this.kcmb_roleGrade.StateCommon.ComboBox.Content.Font = new System.Drawing.Font("微软雅黑", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.kcmb_roleGrade.TabIndex = 33;
|
||||
//
|
||||
// lbGender
|
||||
//
|
||||
this.lbGender.LabelStyle = ComponentFactory.Krypton.Toolkit.LabelStyle.TitleControl;
|
||||
this.lbGender.Location = new System.Drawing.Point(29, 145);
|
||||
this.lbGender.Name = "lbGender";
|
||||
this.lbGender.Size = new System.Drawing.Size(82, 26);
|
||||
this.lbGender.StateCommon.ShortText.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.lbGender.TabIndex = 30;
|
||||
this.lbGender.Values.Text = "角色级别:";
|
||||
//
|
||||
// txtRoleName
|
||||
//
|
||||
this.txtRoleName.AlwaysActive = false;
|
||||
this.txtRoleName.Location = new System.Drawing.Point(29, 104);
|
||||
this.txtRoleName.Name = "txtRoleName";
|
||||
this.txtRoleName.PaletteMode = ComponentFactory.Krypton.Toolkit.PaletteMode.ProfessionalOffice2003;
|
||||
this.txtRoleName.Size = new System.Drawing.Size(232, 35);
|
||||
this.txtRoleName.StateActive.Border.Color1 = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(255)))));
|
||||
this.txtRoleName.StateActive.Border.DrawBorders = ((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders)((((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Top | ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Bottom)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Left)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Right)));
|
||||
this.txtRoleName.StateCommon.Border.DrawBorders = ((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders)((((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Top | ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Bottom)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Left)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Right)));
|
||||
this.txtRoleName.StateCommon.Border.GraphicsHint = ComponentFactory.Krypton.Toolkit.PaletteGraphicsHint.AntiAlias;
|
||||
this.txtRoleName.StateCommon.Border.Rounding = 4;
|
||||
this.txtRoleName.StateCommon.Border.Width = 2;
|
||||
this.txtRoleName.StateCommon.Content.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.txtRoleName.TabIndex = 25;
|
||||
//
|
||||
// lbName
|
||||
//
|
||||
this.lbName.LabelStyle = ComponentFactory.Krypton.Toolkit.LabelStyle.TitleControl;
|
||||
this.lbName.Location = new System.Drawing.Point(29, 78);
|
||||
this.lbName.Name = "lbName";
|
||||
this.lbName.Size = new System.Drawing.Size(82, 26);
|
||||
this.lbName.StateCommon.ShortText.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.lbName.TabIndex = 24;
|
||||
this.lbName.Values.Text = "角色名称:";
|
||||
//
|
||||
// txtRoleCode
|
||||
//
|
||||
this.txtRoleCode.AlwaysActive = false;
|
||||
this.txtRoleCode.Location = new System.Drawing.Point(29, 37);
|
||||
this.txtRoleCode.Name = "txtRoleCode";
|
||||
this.txtRoleCode.PaletteMode = ComponentFactory.Krypton.Toolkit.PaletteMode.ProfessionalOffice2003;
|
||||
this.txtRoleCode.Size = new System.Drawing.Size(232, 35);
|
||||
this.txtRoleCode.StateActive.Border.Color1 = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(255)))));
|
||||
this.txtRoleCode.StateActive.Border.DrawBorders = ((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders)((((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Top | ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Bottom)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Left)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Right)));
|
||||
this.txtRoleCode.StateCommon.Border.DrawBorders = ((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders)((((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Top | ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Bottom)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Left)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Right)));
|
||||
this.txtRoleCode.StateCommon.Border.GraphicsHint = ComponentFactory.Krypton.Toolkit.PaletteGraphicsHint.AntiAlias;
|
||||
this.txtRoleCode.StateCommon.Border.Rounding = 4;
|
||||
this.txtRoleCode.StateCommon.Border.Width = 2;
|
||||
this.txtRoleCode.StateCommon.Content.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.txtRoleCode.TabIndex = 23;
|
||||
//
|
||||
// lbAccount
|
||||
//
|
||||
this.lbAccount.LabelStyle = ComponentFactory.Krypton.Toolkit.LabelStyle.TitleControl;
|
||||
this.lbAccount.Location = new System.Drawing.Point(29, 10);
|
||||
this.lbAccount.Name = "lbAccount";
|
||||
this.lbAccount.Size = new System.Drawing.Size(82, 26);
|
||||
this.lbAccount.StateCommon.ShortText.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.lbAccount.TabIndex = 22;
|
||||
this.lbAccount.Values.Text = "角色编码:";
|
||||
//
|
||||
// frmEditRole
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(289, 266);
|
||||
this.Controls.Add(this.kryptonPanel1);
|
||||
this.Name = "frmEditRole";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||
this.Text = "frmEditRole";
|
||||
this.Load += new System.EventHandler(this.frmEditRole_Load);
|
||||
((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).EndInit();
|
||||
this.kryptonPanel1.ResumeLayout(false);
|
||||
this.kryptonPanel1.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.kcmb_roleGrade)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonPanel kryptonPanel1;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonButton btnClose;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonButton btnAdd;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonComboBox kcmb_roleGrade;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonLabel lbGender;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonTextBox txtRoleName;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonLabel lbName;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonTextBox txtRoleCode;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonLabel lbAccount;
|
||||
}
|
||||
}
|
||||
143
CleanMachineHMI/frmChild/frmEditRole.cs
Normal file
143
CleanMachineHMI/frmChild/frmEditRole.cs
Normal file
@@ -0,0 +1,143 @@
|
||||
using CleanMachineHMI.forms;
|
||||
using CleanMachineHMI.FrmUserControl;
|
||||
using CleanMachineHMI.Utils;
|
||||
using ComponentFactory.Krypton.Toolkit;
|
||||
using LeadDataBaseUtility;
|
||||
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;
|
||||
|
||||
namespace CleanMachineHMI.frmChild
|
||||
{
|
||||
public partial class frmEditRole : KryptonForm
|
||||
{
|
||||
public frmEditRole()
|
||||
{
|
||||
InitializeComponent();
|
||||
_ComboBoxLanguageTextList = this.GetInfoLanguageText(GlobalHelper.LanguageCode, "KryptonComboBox");
|
||||
_InfoLanguageTextList = this.GetInfoLanguageText(GlobalHelper.LanguageCode);
|
||||
}
|
||||
private DataTable _ComboBoxLanguageTextList;
|
||||
private DataTable _InfoLanguageTextList;
|
||||
public string RoleId { get; set; }
|
||||
private void txt_GotFocus(object sender, EventArgs e)
|
||||
{
|
||||
KeyboardAutoPopUp.ShowInputPanel();
|
||||
}
|
||||
private void txt_LostFocus(object sender, EventArgs e)
|
||||
{
|
||||
KeyboardAutoPopUp.HideInputPanel();
|
||||
}
|
||||
private void InitControlEvent()
|
||||
{
|
||||
txtRoleCode.GotFocus += new EventHandler(txt_GotFocus); //获取焦点前发生事件
|
||||
txtRoleCode.LostFocus += new EventHandler(txt_LostFocus); //失去焦点后发生事件
|
||||
|
||||
txtRoleName.GotFocus += new EventHandler(txt_GotFocus); //获取焦点前发生事件
|
||||
txtRoleName.LostFocus += new EventHandler(txt_LostFocus); //失去焦点后发生事件
|
||||
}
|
||||
private void frmEditRole_Load(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
InitControlEvent();
|
||||
this.SetFormControlText(GlobalHelper.LanguageCode);
|
||||
if (GlobalHelper.LanguageCode == "English")
|
||||
{
|
||||
kcmb_roleGrade.Items.Clear();
|
||||
foreach (DataRow item in _ComboBoxLanguageTextList.GetComBoboxItemArr(kcmb_roleGrade.Name, "KryptonComboBox"))
|
||||
{
|
||||
kcmb_roleGrade.Items.Add(item["CONTROL_NAME"].ToString());
|
||||
}
|
||||
}
|
||||
kcmb_roleGrade.SelectedIndex = 0;
|
||||
string sql = $@"SELECT * FROM SYS_ROLE WHERE ROLE_ID = '{RoleId}'";
|
||||
DataTable dt = LeadDbHelperSQLite.Query(sql).Tables[0];
|
||||
if (dt != null && dt.Rows.Count > 0)
|
||||
{
|
||||
txtRoleCode.Text = dt.Rows[0]["ROLE_CODE"].ToString();
|
||||
txtRoleCode.Enabled = false;
|
||||
txtRoleName.Text = dt.Rows[0]["ROLE_NAME"].ToString();
|
||||
if (Convert.ToInt32(dt.Rows[0]["ROLE_GRADE"]) == 100)
|
||||
{
|
||||
kcmb_roleGrade.SelectedIndex = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
kcmb_roleGrade.SelectedIndex = 2;
|
||||
}
|
||||
kcmb_roleGrade.Enabled = false;
|
||||
}
|
||||
kryptonPanel1.Focus();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("编辑角色数据界面加载异常", "LoadEditFrmExp") + $":【{ex.Message}】!");
|
||||
}
|
||||
}
|
||||
|
||||
private void btnAdd_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (string.IsNullOrEmpty(txtRoleName.Text))
|
||||
{
|
||||
//KryptonMessageBox.Show("请输入角色名称!");
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请输入角色名称!", "EnterRoleNameInfo"));
|
||||
return;
|
||||
}
|
||||
int roleGrade = 0;
|
||||
if (kcmb_roleGrade.SelectedIndex == 0)
|
||||
{
|
||||
//KryptonMessageBox.Show("请选择角色级别!");
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请选择角色级别!", "SelectRoleGradeInfo"));
|
||||
return;
|
||||
}
|
||||
else if (kcmb_roleGrade.SelectedIndex == 1)
|
||||
{
|
||||
//string sqlIsExistAdmin = $@"SELECT 1 FROM SYS_ROLE WHERE ROLE_GRADE = '100'";
|
||||
//DataTable dtIsExistAdmin = LeadDbHelperSQLite.Query(sqlIsExistAdmin).Tables[0];
|
||||
//if (dtIsExistAdmin != null && dtIsExistAdmin.Rows.Count > 0)
|
||||
//{
|
||||
// KryptonMessageBox.Show($"管理员角色只能存在一个,请重新选择!");
|
||||
// return;
|
||||
//}
|
||||
roleGrade = 100;
|
||||
}
|
||||
else
|
||||
{
|
||||
roleGrade = 1;
|
||||
}
|
||||
string sql = $@"update SYS_ROLE set ROLE_CODE = '{txtRoleCode.Text}',ROLE_NAME = '{txtRoleName.Text}',ROLE_GRADE = '{roleGrade}',UPDATE_BY = '{GlobalHelper.UserInfo.USER_ID}',UPDATE_TIME = datetime('now', 'localtime') where ROLE_ID = '{RoleId}'";
|
||||
int row = LeadDbHelperSQLite.ExecuteSql(sql);
|
||||
if (row > 0)
|
||||
{
|
||||
//KryptonMessageBox.Show("修改角色数据成功!");
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("修改角色数据成功!", "EditSuccessInfo"));
|
||||
frmRole.RefreshFrmHost();
|
||||
this.Close();
|
||||
}
|
||||
else
|
||||
{
|
||||
//KryptonMessageBox.Show("修改角色数据失败!");
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("修改角色数据失败!", "EditFailInfo"));
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("编辑角色数据发生异常", "EditRoleDataExp") + $":【{ex.Message}】!");
|
||||
}
|
||||
}
|
||||
|
||||
private void btnClose_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
120
CleanMachineHMI/frmChild/frmEditRole.resx
Normal file
120
CleanMachineHMI/frmChild/frmEditRole.resx
Normal file
@@ -0,0 +1,120 @@
|
||||
<?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>
|
||||
168
CleanMachineHMI/frmChild/frmEditSheetType.Designer.cs
generated
Normal file
168
CleanMachineHMI/frmChild/frmEditSheetType.Designer.cs
generated
Normal file
@@ -0,0 +1,168 @@
|
||||
namespace CleanMachineHMI.frmChild
|
||||
{
|
||||
partial class frmEditSheetType
|
||||
{
|
||||
/// <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.kryptonPanel1 = new ComponentFactory.Krypton.Toolkit.KryptonPanel();
|
||||
this.txtSheetTypeName = new ComponentFactory.Krypton.Toolkit.KryptonTextBox();
|
||||
this.lbSheetTypeName = new ComponentFactory.Krypton.Toolkit.KryptonLabel();
|
||||
this.txtSheetTypeCode = new ComponentFactory.Krypton.Toolkit.KryptonTextBox();
|
||||
this.lbSheetTypeCode = new ComponentFactory.Krypton.Toolkit.KryptonLabel();
|
||||
this.btnEdit = new ComponentFactory.Krypton.Toolkit.KryptonButton();
|
||||
this.btnAdd = new ComponentFactory.Krypton.Toolkit.KryptonButton();
|
||||
((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit();
|
||||
this.kryptonPanel1.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// kryptonPanel1
|
||||
//
|
||||
this.kryptonPanel1.Controls.Add(this.txtSheetTypeName);
|
||||
this.kryptonPanel1.Controls.Add(this.lbSheetTypeName);
|
||||
this.kryptonPanel1.Controls.Add(this.txtSheetTypeCode);
|
||||
this.kryptonPanel1.Controls.Add(this.lbSheetTypeCode);
|
||||
this.kryptonPanel1.Controls.Add(this.btnEdit);
|
||||
this.kryptonPanel1.Controls.Add(this.btnAdd);
|
||||
this.kryptonPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.kryptonPanel1.Location = new System.Drawing.Point(0, 0);
|
||||
this.kryptonPanel1.Name = "kryptonPanel1";
|
||||
this.kryptonPanel1.Size = new System.Drawing.Size(289, 227);
|
||||
this.kryptonPanel1.TabIndex = 2;
|
||||
//
|
||||
// txtSheetTypeName
|
||||
//
|
||||
this.txtSheetTypeName.AlwaysActive = false;
|
||||
this.txtSheetTypeName.Location = new System.Drawing.Point(23, 114);
|
||||
this.txtSheetTypeName.Name = "txtSheetTypeName";
|
||||
this.txtSheetTypeName.PaletteMode = ComponentFactory.Krypton.Toolkit.PaletteMode.ProfessionalOffice2003;
|
||||
this.txtSheetTypeName.Size = new System.Drawing.Size(243, 35);
|
||||
this.txtSheetTypeName.StateActive.Border.Color1 = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(255)))));
|
||||
this.txtSheetTypeName.StateActive.Border.DrawBorders = ((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders)((((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Top | ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Bottom)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Left)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Right)));
|
||||
this.txtSheetTypeName.StateCommon.Border.DrawBorders = ((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders)((((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Top | ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Bottom)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Left)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Right)));
|
||||
this.txtSheetTypeName.StateCommon.Border.GraphicsHint = ComponentFactory.Krypton.Toolkit.PaletteGraphicsHint.AntiAlias;
|
||||
this.txtSheetTypeName.StateCommon.Border.Rounding = 4;
|
||||
this.txtSheetTypeName.StateCommon.Border.Width = 2;
|
||||
this.txtSheetTypeName.StateCommon.Content.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.txtSheetTypeName.TabIndex = 39;
|
||||
//
|
||||
// lbSheetTypeName
|
||||
//
|
||||
this.lbSheetTypeName.LabelStyle = ComponentFactory.Krypton.Toolkit.LabelStyle.TitleControl;
|
||||
this.lbSheetTypeName.Location = new System.Drawing.Point(22, 87);
|
||||
this.lbSheetTypeName.Name = "lbSheetTypeName";
|
||||
this.lbSheetTypeName.Size = new System.Drawing.Size(115, 26);
|
||||
this.lbSheetTypeName.StateCommon.ShortText.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.lbSheetTypeName.TabIndex = 38;
|
||||
this.lbSheetTypeName.Values.Text = "板材类型名称:";
|
||||
//
|
||||
// txtSheetTypeCode
|
||||
//
|
||||
this.txtSheetTypeCode.AlwaysActive = false;
|
||||
this.txtSheetTypeCode.Location = new System.Drawing.Point(23, 43);
|
||||
this.txtSheetTypeCode.Name = "txtSheetTypeCode";
|
||||
this.txtSheetTypeCode.PaletteMode = ComponentFactory.Krypton.Toolkit.PaletteMode.ProfessionalOffice2003;
|
||||
this.txtSheetTypeCode.Size = new System.Drawing.Size(243, 35);
|
||||
this.txtSheetTypeCode.StateActive.Border.Color1 = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(255)))));
|
||||
this.txtSheetTypeCode.StateActive.Border.DrawBorders = ((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders)((((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Top | ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Bottom)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Left)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Right)));
|
||||
this.txtSheetTypeCode.StateCommon.Border.DrawBorders = ((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders)((((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Top | ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Bottom)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Left)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Right)));
|
||||
this.txtSheetTypeCode.StateCommon.Border.GraphicsHint = ComponentFactory.Krypton.Toolkit.PaletteGraphicsHint.AntiAlias;
|
||||
this.txtSheetTypeCode.StateCommon.Border.Rounding = 4;
|
||||
this.txtSheetTypeCode.StateCommon.Border.Width = 2;
|
||||
this.txtSheetTypeCode.StateCommon.Content.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.txtSheetTypeCode.TabIndex = 37;
|
||||
//
|
||||
// lbSheetTypeCode
|
||||
//
|
||||
this.lbSheetTypeCode.LabelStyle = ComponentFactory.Krypton.Toolkit.LabelStyle.TitleControl;
|
||||
this.lbSheetTypeCode.Location = new System.Drawing.Point(23, 16);
|
||||
this.lbSheetTypeCode.Name = "lbSheetTypeCode";
|
||||
this.lbSheetTypeCode.Size = new System.Drawing.Size(115, 26);
|
||||
this.lbSheetTypeCode.StateCommon.ShortText.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.lbSheetTypeCode.TabIndex = 36;
|
||||
this.lbSheetTypeCode.Values.Text = "板材类型编码:";
|
||||
//
|
||||
// btnEdit
|
||||
//
|
||||
this.btnEdit.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.btnEdit.Location = new System.Drawing.Point(183, 166);
|
||||
this.btnEdit.Name = "btnEdit";
|
||||
this.btnEdit.Size = new System.Drawing.Size(82, 40);
|
||||
this.btnEdit.StateCommon.Content.ShortText.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.btnEdit.TabIndex = 35;
|
||||
this.btnEdit.Values.Text = "取消";
|
||||
this.btnEdit.Click += new System.EventHandler(this.btnEdit_Click);
|
||||
//
|
||||
// btnAdd
|
||||
//
|
||||
this.btnAdd.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.btnAdd.Location = new System.Drawing.Point(23, 166);
|
||||
this.btnAdd.Name = "btnAdd";
|
||||
this.btnAdd.Size = new System.Drawing.Size(82, 40);
|
||||
this.btnAdd.StateCommon.Content.ShortText.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.btnAdd.TabIndex = 34;
|
||||
this.btnAdd.Values.Text = "确认";
|
||||
this.btnAdd.Click += new System.EventHandler(this.btnAdd_Click);
|
||||
//
|
||||
// frmEditSheetType
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(289, 227);
|
||||
this.Controls.Add(this.kryptonPanel1);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "frmEditSheetType";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||
this.Text = "frmEditSheetType";
|
||||
this.Load += new System.EventHandler(this.frmEditSheetType_Load);
|
||||
((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).EndInit();
|
||||
this.kryptonPanel1.ResumeLayout(false);
|
||||
this.kryptonPanel1.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonPanel kryptonPanel1;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonTextBox txtSheetTypeName;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonLabel lbSheetTypeName;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonTextBox txtSheetTypeCode;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonLabel lbSheetTypeCode;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonButton btnEdit;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonButton btnAdd;
|
||||
}
|
||||
}
|
||||
102
CleanMachineHMI/frmChild/frmEditSheetType.cs
Normal file
102
CleanMachineHMI/frmChild/frmEditSheetType.cs
Normal file
@@ -0,0 +1,102 @@
|
||||
using CleanMachineHMI.forms;
|
||||
using CleanMachineHMI.FrmUserControl;
|
||||
using CleanMachineHMI.Utils;
|
||||
using ComponentFactory.Krypton.Toolkit;
|
||||
using LeadDataBaseUtility;
|
||||
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;
|
||||
|
||||
namespace CleanMachineHMI.frmChild
|
||||
{
|
||||
public partial class frmEditSheetType : KryptonForm
|
||||
{
|
||||
public frmEditSheetType()
|
||||
{
|
||||
InitializeComponent();
|
||||
_InfoLanguageTextList = this.GetInfoLanguageText(GlobalHelper.LanguageCode);
|
||||
}
|
||||
private DataTable _InfoLanguageTextList;
|
||||
public string SheetTypeId { get; set; }
|
||||
private void txt_GotFocus(object sender, EventArgs e)
|
||||
{
|
||||
KeyboardAutoPopUp.ShowInputPanel();
|
||||
}
|
||||
private void txt_LostFocus(object sender, EventArgs e)
|
||||
{
|
||||
KeyboardAutoPopUp.HideInputPanel();
|
||||
}
|
||||
private void InitControlEvent()
|
||||
{
|
||||
txtSheetTypeCode.GotFocus += new EventHandler(txt_GotFocus); //获取焦点前发生事件
|
||||
txtSheetTypeCode.LostFocus += new EventHandler(txt_LostFocus); //失去焦点后发生事件
|
||||
|
||||
txtSheetTypeName.GotFocus += new EventHandler(txt_GotFocus); //获取焦点前发生事件
|
||||
txtSheetTypeName.LostFocus += new EventHandler(txt_LostFocus); //失去焦点后发生事件
|
||||
}
|
||||
|
||||
private void frmEditSheetType_Load(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
InitControlEvent();
|
||||
this.SetFormControlText(GlobalHelper.LanguageCode);
|
||||
string sql = $@"SELECT * FROM BAS_SHEET_TYPE WHERE SHEET_TYPE_ID = '{SheetTypeId}'";
|
||||
DataTable dt = LeadDbHelperSQLite.Query(sql).Tables[0];
|
||||
if (dt != null && dt.Rows.Count > 0)
|
||||
{
|
||||
txtSheetTypeCode.Text = dt.Rows[0]["SHEET_TYPE_CODE"].ToString();
|
||||
txtSheetTypeCode.Enabled = false;
|
||||
txtSheetTypeName.Text = dt.Rows[0]["SHEET_TYPE_NAME"].ToString();
|
||||
}
|
||||
kryptonPanel1.Focus();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("编辑板材数据界面加载异常", "LoadEditFrmExp") + $":【{ex.Message}】!");
|
||||
}
|
||||
}
|
||||
|
||||
private void btnAdd_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (string.IsNullOrEmpty(txtSheetTypeName.Text))
|
||||
{
|
||||
//KryptonMessageBox.Show("请输入板材名称!");
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请输入板材名称!", "EnterSheetTypeNameInfo"));
|
||||
return;
|
||||
}
|
||||
string sql = $@"update BAS_SHEET_TYPE set SHEET_TYPE_NAME = '{txtSheetTypeName.Text}',UPDATE_BY = '{GlobalHelper.UserInfo.USER_ID}',UPDATE_TIME = datetime('now', 'localtime') where SHEET_TYPE_ID = '{SheetTypeId}'";
|
||||
int row = LeadDbHelperSQLite.ExecuteSql(sql);
|
||||
if (row > 0)
|
||||
{
|
||||
//KryptonMessageBox.Show("修改板材数据成功!");
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("编辑板材数据成功!", "EditSuccessInfo"));
|
||||
frmSheetType.RefreshFrmHost();
|
||||
this.Close();
|
||||
}
|
||||
else
|
||||
{
|
||||
//KryptonMessageBox.Show("修改板材数据失败!");
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("编辑板材数据失败!", "EditFailInfo"));
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("编辑板材类型数据发生异常", "EditSheetTypeDataExp") + $":【{ex.Message}】!");
|
||||
}
|
||||
}
|
||||
|
||||
private void btnEdit_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
120
CleanMachineHMI/frmChild/frmEditSheetType.resx
Normal file
120
CleanMachineHMI/frmChild/frmEditSheetType.resx
Normal file
@@ -0,0 +1,120 @@
|
||||
<?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>
|
||||
300
CleanMachineHMI/frmChild/frmEditUser.Designer.cs
generated
Normal file
300
CleanMachineHMI/frmChild/frmEditUser.Designer.cs
generated
Normal file
@@ -0,0 +1,300 @@
|
||||
namespace CleanMachineHMI.frmChild
|
||||
{
|
||||
partial class frmEditUser
|
||||
{
|
||||
/// <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.kryptonPanel1 = new ComponentFactory.Krypton.Toolkit.KryptonPanel();
|
||||
this.btnClose = new ComponentFactory.Krypton.Toolkit.KryptonButton();
|
||||
this.btnAdd = new ComponentFactory.Krypton.Toolkit.KryptonButton();
|
||||
this.cmbGender = new ComponentFactory.Krypton.Toolkit.KryptonComboBox();
|
||||
this.lbGender = new ComponentFactory.Krypton.Toolkit.KryptonLabel();
|
||||
this.txtPS1 = new ComponentFactory.Krypton.Toolkit.KryptonTextBox();
|
||||
this.lbPS1 = new ComponentFactory.Krypton.Toolkit.KryptonLabel();
|
||||
this.txtPS = new ComponentFactory.Krypton.Toolkit.KryptonTextBox();
|
||||
this.lbPS = new ComponentFactory.Krypton.Toolkit.KryptonLabel();
|
||||
this.txtName = new ComponentFactory.Krypton.Toolkit.KryptonTextBox();
|
||||
this.lbName = new ComponentFactory.Krypton.Toolkit.KryptonLabel();
|
||||
this.txtAccount = new ComponentFactory.Krypton.Toolkit.KryptonTextBox();
|
||||
this.lbAccount = new ComponentFactory.Krypton.Toolkit.KryptonLabel();
|
||||
this.kcmb_Role = new ComponentFactory.Krypton.Toolkit.KryptonComboBox();
|
||||
this.klb_Role = new ComponentFactory.Krypton.Toolkit.KryptonLabel();
|
||||
((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit();
|
||||
this.kryptonPanel1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.cmbGender)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.kcmb_Role)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// kryptonPanel1
|
||||
//
|
||||
this.kryptonPanel1.Controls.Add(this.kcmb_Role);
|
||||
this.kryptonPanel1.Controls.Add(this.klb_Role);
|
||||
this.kryptonPanel1.Controls.Add(this.btnClose);
|
||||
this.kryptonPanel1.Controls.Add(this.btnAdd);
|
||||
this.kryptonPanel1.Controls.Add(this.cmbGender);
|
||||
this.kryptonPanel1.Controls.Add(this.lbGender);
|
||||
this.kryptonPanel1.Controls.Add(this.txtPS1);
|
||||
this.kryptonPanel1.Controls.Add(this.lbPS1);
|
||||
this.kryptonPanel1.Controls.Add(this.txtPS);
|
||||
this.kryptonPanel1.Controls.Add(this.lbPS);
|
||||
this.kryptonPanel1.Controls.Add(this.txtName);
|
||||
this.kryptonPanel1.Controls.Add(this.lbName);
|
||||
this.kryptonPanel1.Controls.Add(this.txtAccount);
|
||||
this.kryptonPanel1.Controls.Add(this.lbAccount);
|
||||
this.kryptonPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.kryptonPanel1.Location = new System.Drawing.Point(0, 0);
|
||||
this.kryptonPanel1.Name = "kryptonPanel1";
|
||||
this.kryptonPanel1.Size = new System.Drawing.Size(289, 479);
|
||||
this.kryptonPanel1.TabIndex = 1;
|
||||
//
|
||||
// btnClose
|
||||
//
|
||||
this.btnClose.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.btnClose.Location = new System.Drawing.Point(179, 418);
|
||||
this.btnClose.Name = "btnClose";
|
||||
this.btnClose.Size = new System.Drawing.Size(82, 40);
|
||||
this.btnClose.StateCommon.Content.ShortText.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.btnClose.TabIndex = 35;
|
||||
this.btnClose.Values.Text = "取消";
|
||||
this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
|
||||
//
|
||||
// btnAdd
|
||||
//
|
||||
this.btnAdd.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.btnAdd.Location = new System.Drawing.Point(29, 418);
|
||||
this.btnAdd.Name = "btnAdd";
|
||||
this.btnAdd.Size = new System.Drawing.Size(82, 40);
|
||||
this.btnAdd.StateCommon.Content.ShortText.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.btnAdd.TabIndex = 34;
|
||||
this.btnAdd.Values.Text = "确认";
|
||||
this.btnAdd.Click += new System.EventHandler(this.btnAdd_Click);
|
||||
//
|
||||
// cmbGender
|
||||
//
|
||||
this.cmbGender.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.cmbGender.DropDownWidth = 271;
|
||||
this.cmbGender.Items.AddRange(new object[] {
|
||||
"请选择",
|
||||
"男",
|
||||
"女"});
|
||||
this.cmbGender.Location = new System.Drawing.Point(29, 305);
|
||||
this.cmbGender.Name = "cmbGender";
|
||||
this.cmbGender.Size = new System.Drawing.Size(232, 31);
|
||||
this.cmbGender.StateCommon.ComboBox.Content.Font = new System.Drawing.Font("微软雅黑", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.cmbGender.TabIndex = 33;
|
||||
//
|
||||
// lbGender
|
||||
//
|
||||
this.lbGender.LabelStyle = ComponentFactory.Krypton.Toolkit.LabelStyle.TitleControl;
|
||||
this.lbGender.Location = new System.Drawing.Point(29, 278);
|
||||
this.lbGender.Name = "lbGender";
|
||||
this.lbGender.Size = new System.Drawing.Size(49, 26);
|
||||
this.lbGender.StateCommon.ShortText.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.lbGender.TabIndex = 30;
|
||||
this.lbGender.Values.Text = "性别:";
|
||||
//
|
||||
// txtPS1
|
||||
//
|
||||
this.txtPS1.AlwaysActive = false;
|
||||
this.txtPS1.Location = new System.Drawing.Point(29, 237);
|
||||
this.txtPS1.Name = "txtPS1";
|
||||
this.txtPS1.PaletteMode = ComponentFactory.Krypton.Toolkit.PaletteMode.ProfessionalOffice2003;
|
||||
this.txtPS1.Size = new System.Drawing.Size(232, 35);
|
||||
this.txtPS1.StateActive.Border.Color1 = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(255)))));
|
||||
this.txtPS1.StateActive.Border.DrawBorders = ((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders)((((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Top | ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Bottom)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Left)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Right)));
|
||||
this.txtPS1.StateCommon.Border.DrawBorders = ((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders)((((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Top | ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Bottom)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Left)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Right)));
|
||||
this.txtPS1.StateCommon.Border.GraphicsHint = ComponentFactory.Krypton.Toolkit.PaletteGraphicsHint.AntiAlias;
|
||||
this.txtPS1.StateCommon.Border.Rounding = 4;
|
||||
this.txtPS1.StateCommon.Border.Width = 2;
|
||||
this.txtPS1.StateCommon.Content.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.txtPS1.TabIndex = 29;
|
||||
//
|
||||
// lbPS1
|
||||
//
|
||||
this.lbPS1.LabelStyle = ComponentFactory.Krypton.Toolkit.LabelStyle.TitleControl;
|
||||
this.lbPS1.Location = new System.Drawing.Point(29, 211);
|
||||
this.lbPS1.Name = "lbPS1";
|
||||
this.lbPS1.Size = new System.Drawing.Size(82, 26);
|
||||
this.lbPS1.StateCommon.ShortText.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.lbPS1.TabIndex = 28;
|
||||
this.lbPS1.Values.Text = "密码确认:";
|
||||
//
|
||||
// txtPS
|
||||
//
|
||||
this.txtPS.AlwaysActive = false;
|
||||
this.txtPS.Location = new System.Drawing.Point(29, 170);
|
||||
this.txtPS.Name = "txtPS";
|
||||
this.txtPS.PaletteMode = ComponentFactory.Krypton.Toolkit.PaletteMode.ProfessionalOffice2003;
|
||||
this.txtPS.Size = new System.Drawing.Size(232, 35);
|
||||
this.txtPS.StateActive.Border.Color1 = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(255)))));
|
||||
this.txtPS.StateActive.Border.DrawBorders = ((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders)((((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Top | ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Bottom)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Left)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Right)));
|
||||
this.txtPS.StateCommon.Border.DrawBorders = ((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders)((((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Top | ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Bottom)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Left)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Right)));
|
||||
this.txtPS.StateCommon.Border.GraphicsHint = ComponentFactory.Krypton.Toolkit.PaletteGraphicsHint.AntiAlias;
|
||||
this.txtPS.StateCommon.Border.Rounding = 4;
|
||||
this.txtPS.StateCommon.Border.Width = 2;
|
||||
this.txtPS.StateCommon.Content.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.txtPS.TabIndex = 27;
|
||||
//
|
||||
// lbPS
|
||||
//
|
||||
this.lbPS.LabelStyle = ComponentFactory.Krypton.Toolkit.LabelStyle.TitleControl;
|
||||
this.lbPS.Location = new System.Drawing.Point(29, 145);
|
||||
this.lbPS.Name = "lbPS";
|
||||
this.lbPS.Size = new System.Drawing.Size(82, 26);
|
||||
this.lbPS.StateCommon.ShortText.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.lbPS.TabIndex = 26;
|
||||
this.lbPS.Values.Text = "登陆密码:";
|
||||
//
|
||||
// txtName
|
||||
//
|
||||
this.txtName.AlwaysActive = false;
|
||||
this.txtName.Location = new System.Drawing.Point(29, 104);
|
||||
this.txtName.Name = "txtName";
|
||||
this.txtName.PaletteMode = ComponentFactory.Krypton.Toolkit.PaletteMode.ProfessionalOffice2003;
|
||||
this.txtName.Size = new System.Drawing.Size(232, 35);
|
||||
this.txtName.StateActive.Border.Color1 = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(255)))));
|
||||
this.txtName.StateActive.Border.DrawBorders = ((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders)((((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Top | ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Bottom)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Left)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Right)));
|
||||
this.txtName.StateCommon.Border.DrawBorders = ((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders)((((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Top | ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Bottom)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Left)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Right)));
|
||||
this.txtName.StateCommon.Border.GraphicsHint = ComponentFactory.Krypton.Toolkit.PaletteGraphicsHint.AntiAlias;
|
||||
this.txtName.StateCommon.Border.Rounding = 4;
|
||||
this.txtName.StateCommon.Border.Width = 2;
|
||||
this.txtName.StateCommon.Content.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.txtName.TabIndex = 25;
|
||||
//
|
||||
// lbName
|
||||
//
|
||||
this.lbName.LabelStyle = ComponentFactory.Krypton.Toolkit.LabelStyle.TitleControl;
|
||||
this.lbName.Location = new System.Drawing.Point(29, 78);
|
||||
this.lbName.Name = "lbName";
|
||||
this.lbName.Size = new System.Drawing.Size(82, 26);
|
||||
this.lbName.StateCommon.ShortText.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.lbName.TabIndex = 24;
|
||||
this.lbName.Values.Text = "用户姓名:";
|
||||
//
|
||||
// txtAccount
|
||||
//
|
||||
this.txtAccount.AlwaysActive = false;
|
||||
this.txtAccount.Location = new System.Drawing.Point(29, 37);
|
||||
this.txtAccount.Name = "txtAccount";
|
||||
this.txtAccount.PaletteMode = ComponentFactory.Krypton.Toolkit.PaletteMode.ProfessionalOffice2003;
|
||||
this.txtAccount.Size = new System.Drawing.Size(232, 35);
|
||||
this.txtAccount.StateActive.Border.Color1 = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(255)))));
|
||||
this.txtAccount.StateActive.Border.DrawBorders = ((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders)((((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Top | ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Bottom)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Left)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Right)));
|
||||
this.txtAccount.StateCommon.Border.DrawBorders = ((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders)((((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Top | ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Bottom)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Left)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Right)));
|
||||
this.txtAccount.StateCommon.Border.GraphicsHint = ComponentFactory.Krypton.Toolkit.PaletteGraphicsHint.AntiAlias;
|
||||
this.txtAccount.StateCommon.Border.Rounding = 4;
|
||||
this.txtAccount.StateCommon.Border.Width = 2;
|
||||
this.txtAccount.StateCommon.Content.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.txtAccount.TabIndex = 23;
|
||||
//
|
||||
// lbAccount
|
||||
//
|
||||
this.lbAccount.LabelStyle = ComponentFactory.Krypton.Toolkit.LabelStyle.TitleControl;
|
||||
this.lbAccount.Location = new System.Drawing.Point(29, 10);
|
||||
this.lbAccount.Name = "lbAccount";
|
||||
this.lbAccount.Size = new System.Drawing.Size(82, 26);
|
||||
this.lbAccount.StateCommon.ShortText.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.lbAccount.TabIndex = 22;
|
||||
this.lbAccount.Values.Text = "用户账号:";
|
||||
//
|
||||
// kcmb_Role
|
||||
//
|
||||
this.kcmb_Role.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.kcmb_Role.DropDownWidth = 271;
|
||||
this.kcmb_Role.Location = new System.Drawing.Point(29, 369);
|
||||
this.kcmb_Role.Name = "kcmb_Role";
|
||||
this.kcmb_Role.Size = new System.Drawing.Size(232, 31);
|
||||
this.kcmb_Role.StateCommon.ComboBox.Content.Font = new System.Drawing.Font("微软雅黑", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.kcmb_Role.TabIndex = 37;
|
||||
//
|
||||
// klb_Role
|
||||
//
|
||||
this.klb_Role.LabelStyle = ComponentFactory.Krypton.Toolkit.LabelStyle.TitleControl;
|
||||
this.klb_Role.Location = new System.Drawing.Point(29, 342);
|
||||
this.klb_Role.Name = "klb_Role";
|
||||
this.klb_Role.Size = new System.Drawing.Size(82, 26);
|
||||
this.klb_Role.StateCommon.ShortText.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.klb_Role.TabIndex = 36;
|
||||
this.klb_Role.Values.Text = "所属角色:";
|
||||
//
|
||||
// frmEditUser
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(289, 479);
|
||||
this.Controls.Add(this.kryptonPanel1);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "frmEditUser";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||
this.Text = "frmEditUser";
|
||||
this.Load += new System.EventHandler(this.frmEditUser_Load);
|
||||
((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).EndInit();
|
||||
this.kryptonPanel1.ResumeLayout(false);
|
||||
this.kryptonPanel1.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.cmbGender)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.kcmb_Role)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonPanel kryptonPanel1;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonButton btnClose;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonButton btnAdd;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonComboBox cmbGender;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonLabel lbGender;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonTextBox txtPS1;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonLabel lbPS1;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonTextBox txtPS;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonLabel lbPS;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonTextBox txtName;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonLabel lbName;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonTextBox txtAccount;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonLabel lbAccount;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonComboBox kcmb_Role;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonLabel klb_Role;
|
||||
}
|
||||
}
|
||||
168
CleanMachineHMI/frmChild/frmEditUser.cs
Normal file
168
CleanMachineHMI/frmChild/frmEditUser.cs
Normal file
@@ -0,0 +1,168 @@
|
||||
using CleanMachineHMI.forms;
|
||||
using CleanMachineHMI.FrmUserControl;
|
||||
using CleanMachineHMI.Utils;
|
||||
using ComponentFactory.Krypton.Toolkit;
|
||||
using LeadDataBaseUtility;
|
||||
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.Web.UI.WebControls;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace CleanMachineHMI.frmChild
|
||||
{
|
||||
public partial class frmEditUser : KryptonForm
|
||||
{
|
||||
public frmEditUser()
|
||||
{
|
||||
InitializeComponent();
|
||||
_ComboBoxLanguageTextList = this.GetInfoLanguageText(GlobalHelper.LanguageCode, "KryptonComboBox");
|
||||
_InfoLanguageTextList = this.GetInfoLanguageText(GlobalHelper.LanguageCode);
|
||||
}
|
||||
private DataTable _ComboBoxLanguageTextList;
|
||||
private DataTable _InfoLanguageTextList;
|
||||
public string UserId { get; set; }
|
||||
private void txt_GotFocus(object sender, EventArgs e)
|
||||
{
|
||||
KeyboardAutoPopUp.ShowInputPanel();
|
||||
}
|
||||
private void txt_LostFocus(object sender, EventArgs e)
|
||||
{
|
||||
KeyboardAutoPopUp.HideInputPanel();
|
||||
}
|
||||
private void InitControlEvent()
|
||||
{
|
||||
txtAccount.GotFocus += new EventHandler(txt_GotFocus); //获取焦点前发生事件
|
||||
txtAccount.LostFocus += new EventHandler(txt_LostFocus); //失去焦点后发生事件
|
||||
|
||||
txtName.GotFocus += new EventHandler(txt_GotFocus); //获取焦点前发生事件
|
||||
txtName.LostFocus += new EventHandler(txt_LostFocus); //失去焦点后发生事件
|
||||
|
||||
txtPS.GotFocus += new EventHandler(txt_GotFocus); //获取焦点前发生事件
|
||||
txtPS.LostFocus += new EventHandler(txt_LostFocus); //失去焦点后发生事件
|
||||
|
||||
txtPS1.GotFocus += new EventHandler(txt_GotFocus); //获取焦点前发生事件
|
||||
txtPS1.LostFocus += new EventHandler(txt_LostFocus); //失去焦点后发生事件
|
||||
|
||||
}
|
||||
|
||||
private void frmEditUser_Load(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
InitControlEvent();
|
||||
this.SetFormControlText(GlobalHelper.LanguageCode);
|
||||
if (GlobalHelper.LanguageCode == "English")
|
||||
{
|
||||
cmbGender.Items.Clear();
|
||||
foreach (DataRow item in _ComboBoxLanguageTextList.GetComBoboxItemArr(cmbGender.Name, "KryptonComboBox"))
|
||||
{
|
||||
cmbGender.Items.Add(item["CONTROL_NAME"].ToString());
|
||||
}
|
||||
}
|
||||
string sql1 = $"SELECT ROLE_ID,ROLE_CODE,ROLE_NAME FROM SYS_ROLE ";
|
||||
DataTable dt1 = LeadDbHelperSQLite.Query(sql1).Tables[0];
|
||||
if (dt1 != null && dt1.Rows.Count > 0)
|
||||
{
|
||||
kcmb_Role.Items.Clear();
|
||||
foreach (DataRow item in dt1.Rows)
|
||||
{
|
||||
kcmb_Role.Items.Add(new ListItem
|
||||
{
|
||||
Value = item["ROLE_ID"].ToString(),
|
||||
Text = item["ROLE_CODE"].ToString(),
|
||||
});
|
||||
}
|
||||
}
|
||||
cmbGender.SelectedIndex = 0;
|
||||
string sql = $@"SELECT A.USER_ID,A.USER_CODE,A.USER_NAME,A.GENDER,A.ROLE_ID,B.ROLE_CODE,B.ROLE_NAME,A.PASSWORD FROM SYS_USER A LEFT JOIN SYS_ROLE B on A.ROLE_ID = B.ROLE_ID WHERE A.USER_ID = '{UserId}'";
|
||||
DataTable dt = LeadDbHelperSQLite.Query(sql).Tables[0];
|
||||
if (dt != null && dt.Rows.Count > 0)
|
||||
{
|
||||
txtAccount.Text = dt.Rows[0]["USER_CODE"].ToString();
|
||||
txtAccount.Enabled = false;
|
||||
txtName.Text = dt.Rows[0]["USER_NAME"].ToString();
|
||||
txtPS.Text = dt.Rows[0]["PASSWORD"].ToString();
|
||||
txtPS1.Text = dt.Rows[0]["PASSWORD"].ToString();
|
||||
cmbGender.SelectedIndex = Convert.ToInt32(dt.Rows[0]["GENDER"]);
|
||||
kcmb_Role.Text = dt.Rows[0]["ROLE_CODE"].ToString();
|
||||
}
|
||||
kryptonPanel1.Focus();
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("编辑用户数据界面加载异常", "LoadEditFrmExp") + $":【{ex.Message}】!");
|
||||
}
|
||||
}
|
||||
|
||||
private void btnAdd_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (string.IsNullOrEmpty(txtAccount.Text))
|
||||
{
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请输入用户编码!", "EnterUserCodeInfo"));
|
||||
return;
|
||||
}
|
||||
if (string.IsNullOrEmpty(txtName.Text))
|
||||
{
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请输入用户名称!", "EnterUserNameInfo"));
|
||||
return;
|
||||
}
|
||||
if (string.IsNullOrEmpty(txtPS.Text))
|
||||
{
|
||||
//KryptonMessageBox.Show("请输入用户密码!");
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请输入用户密码!", "EnterUserPasswordInfo"));
|
||||
return;
|
||||
}
|
||||
if (string.IsNullOrEmpty(txtPS1.Text))
|
||||
{
|
||||
//KryptonMessageBox.Show("请确认用户密码!");
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请确认用户密码!", "ConfirmUserPasswordInfo"));
|
||||
return;
|
||||
}
|
||||
if (cmbGender.SelectedIndex == 0)
|
||||
{
|
||||
//KryptonMessageBox.Show("请选择性别!");
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请选择性别!", "SelectUserGenderInfo"));
|
||||
return;
|
||||
}
|
||||
if (txtPS1.Text != txtPS.Text)
|
||||
{
|
||||
//KryptonMessageBox.Show("两次输入的密码不同,请重新输入!");
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("两次输入的密码不同,请重新输入!", "ConfirmUserPasswordErrInfo"));
|
||||
return;
|
||||
}
|
||||
string sql = $@"update SYS_USER set USER_CODE = '{txtAccount.Text}',USER_NAME = '{txtName.Text}',PASSWORD = '{txtPS1.Text}',GENDER = '{cmbGender.SelectedIndex}',ROLE_ID = '{((ListItem)kcmb_Role.SelectedItem).Value}',UPDATE_BY = '{GlobalHelper.UserInfo.USER_ID}',UPDATE_TIME = datetime('now', 'localtime') where USER_ID = '{UserId}'";
|
||||
int row = LeadDbHelperSQLite.ExecuteSql(sql);
|
||||
if (row > 0)
|
||||
{
|
||||
//KryptonMessageBox.Show("修改用户数据成功!");
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("修改用户数据成功!", "EditSuccessInfo"));
|
||||
frmUser.RefreshFrmHost();
|
||||
this.Close();
|
||||
}
|
||||
else
|
||||
{
|
||||
//KryptonMessageBox.Show("修改用户数据失败!");
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("修改用户数据失败!", "EditFailInfo"));
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("编辑用户数据发生异常", "EditUserDataExp") + $":【{ex.Message}】!");
|
||||
}
|
||||
}
|
||||
|
||||
private void btnClose_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
120
CleanMachineHMI/frmChild/frmEditUser.resx
Normal file
120
CleanMachineHMI/frmChild/frmEditUser.resx
Normal file
@@ -0,0 +1,120 @@
|
||||
<?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>
|
||||
280
CleanMachineHMI/frmChild/frmEditWaringMsg.Designer.cs
generated
Normal file
280
CleanMachineHMI/frmChild/frmEditWaringMsg.Designer.cs
generated
Normal file
@@ -0,0 +1,280 @@
|
||||
namespace CleanMachineHMI.frmChild
|
||||
{
|
||||
partial class frmEditWaringMsg
|
||||
{
|
||||
/// <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.kryptonPanel1 = new ComponentFactory.Krypton.Toolkit.KryptonPanel();
|
||||
this.kcmb_WarningType = new ComponentFactory.Krypton.Toolkit.KryptonComboBox();
|
||||
this.ktb_PlcCode = new ComponentFactory.Krypton.Toolkit.KryptonTextBox();
|
||||
this.txtWarningMessage = new ComponentFactory.Krypton.Toolkit.KryptonTextBox();
|
||||
this.kryptonLabel2 = new ComponentFactory.Krypton.Toolkit.KryptonLabel();
|
||||
this.kryptonLabel1 = new ComponentFactory.Krypton.Toolkit.KryptonLabel();
|
||||
this.lbWarningMessage = new ComponentFactory.Krypton.Toolkit.KryptonLabel();
|
||||
this.txtWarningName = new ComponentFactory.Krypton.Toolkit.KryptonTextBox();
|
||||
this.lbWarningName = new ComponentFactory.Krypton.Toolkit.KryptonLabel();
|
||||
this.txtWarningCode = new ComponentFactory.Krypton.Toolkit.KryptonTextBox();
|
||||
this.lbWarningCode = new ComponentFactory.Krypton.Toolkit.KryptonLabel();
|
||||
this.btnEdit = new ComponentFactory.Krypton.Toolkit.KryptonButton();
|
||||
this.btnAdd = new ComponentFactory.Krypton.Toolkit.KryptonButton();
|
||||
((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit();
|
||||
this.kryptonPanel1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.kcmb_WarningType)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// kryptonPanel1
|
||||
//
|
||||
this.kryptonPanel1.Controls.Add(this.kcmb_WarningType);
|
||||
this.kryptonPanel1.Controls.Add(this.ktb_PlcCode);
|
||||
this.kryptonPanel1.Controls.Add(this.txtWarningMessage);
|
||||
this.kryptonPanel1.Controls.Add(this.kryptonLabel2);
|
||||
this.kryptonPanel1.Controls.Add(this.kryptonLabel1);
|
||||
this.kryptonPanel1.Controls.Add(this.lbWarningMessage);
|
||||
this.kryptonPanel1.Controls.Add(this.txtWarningName);
|
||||
this.kryptonPanel1.Controls.Add(this.lbWarningName);
|
||||
this.kryptonPanel1.Controls.Add(this.txtWarningCode);
|
||||
this.kryptonPanel1.Controls.Add(this.lbWarningCode);
|
||||
this.kryptonPanel1.Controls.Add(this.btnEdit);
|
||||
this.kryptonPanel1.Controls.Add(this.btnAdd);
|
||||
this.kryptonPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.kryptonPanel1.Location = new System.Drawing.Point(0, 0);
|
||||
this.kryptonPanel1.Name = "kryptonPanel1";
|
||||
this.kryptonPanel1.Size = new System.Drawing.Size(289, 441);
|
||||
this.kryptonPanel1.TabIndex = 7;
|
||||
//
|
||||
// kcmb_WarningType
|
||||
//
|
||||
this.kcmb_WarningType.DropDownWidth = 236;
|
||||
this.kcmb_WarningType.Items.AddRange(new object[] {
|
||||
"请选择",
|
||||
"清洁机报警",
|
||||
"变频器报警"});
|
||||
this.kcmb_WarningType.Location = new System.Drawing.Point(23, 329);
|
||||
this.kcmb_WarningType.Name = "kcmb_WarningType";
|
||||
this.kcmb_WarningType.Size = new System.Drawing.Size(242, 33);
|
||||
this.kcmb_WarningType.StateActive.ComboBox.Border.Color1 = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(255)))));
|
||||
this.kcmb_WarningType.StateActive.ComboBox.Border.DrawBorders = ((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders)((((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Top | ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Bottom)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Left)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Right)));
|
||||
this.kcmb_WarningType.StateCommon.ComboBox.Border.DrawBorders = ((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders)((((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Top | ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Bottom)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Left)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Right)));
|
||||
this.kcmb_WarningType.StateCommon.ComboBox.Border.Rounding = 4;
|
||||
this.kcmb_WarningType.StateCommon.ComboBox.Border.Width = 2;
|
||||
this.kcmb_WarningType.StateCommon.ComboBox.Content.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.kcmb_WarningType.TabIndex = 52;
|
||||
//
|
||||
// ktb_PlcCode
|
||||
//
|
||||
this.ktb_PlcCode.AlwaysActive = false;
|
||||
this.ktb_PlcCode.Location = new System.Drawing.Point(23, 255);
|
||||
this.ktb_PlcCode.Name = "ktb_PlcCode";
|
||||
this.ktb_PlcCode.PaletteMode = ComponentFactory.Krypton.Toolkit.PaletteMode.ProfessionalOffice2003;
|
||||
this.ktb_PlcCode.Size = new System.Drawing.Size(242, 35);
|
||||
this.ktb_PlcCode.StateActive.Border.Color1 = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(255)))));
|
||||
this.ktb_PlcCode.StateActive.Border.DrawBorders = ((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders)((((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Top | ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Bottom)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Left)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Right)));
|
||||
this.ktb_PlcCode.StateCommon.Border.DrawBorders = ((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders)((((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Top | ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Bottom)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Left)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Right)));
|
||||
this.ktb_PlcCode.StateCommon.Border.GraphicsHint = ComponentFactory.Krypton.Toolkit.PaletteGraphicsHint.AntiAlias;
|
||||
this.ktb_PlcCode.StateCommon.Border.Rounding = 4;
|
||||
this.ktb_PlcCode.StateCommon.Border.Width = 2;
|
||||
this.ktb_PlcCode.StateCommon.Content.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.ktb_PlcCode.TabIndex = 50;
|
||||
//
|
||||
// txtWarningMessage
|
||||
//
|
||||
this.txtWarningMessage.AlwaysActive = false;
|
||||
this.txtWarningMessage.Location = new System.Drawing.Point(23, 184);
|
||||
this.txtWarningMessage.Name = "txtWarningMessage";
|
||||
this.txtWarningMessage.PaletteMode = ComponentFactory.Krypton.Toolkit.PaletteMode.ProfessionalOffice2003;
|
||||
this.txtWarningMessage.Size = new System.Drawing.Size(242, 35);
|
||||
this.txtWarningMessage.StateActive.Border.Color1 = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(255)))));
|
||||
this.txtWarningMessage.StateActive.Border.DrawBorders = ((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders)((((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Top | ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Bottom)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Left)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Right)));
|
||||
this.txtWarningMessage.StateCommon.Border.DrawBorders = ((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders)((((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Top | ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Bottom)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Left)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Right)));
|
||||
this.txtWarningMessage.StateCommon.Border.GraphicsHint = ComponentFactory.Krypton.Toolkit.PaletteGraphicsHint.AntiAlias;
|
||||
this.txtWarningMessage.StateCommon.Border.Rounding = 4;
|
||||
this.txtWarningMessage.StateCommon.Border.Width = 2;
|
||||
this.txtWarningMessage.StateCommon.Content.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.txtWarningMessage.TabIndex = 51;
|
||||
//
|
||||
// kryptonLabel2
|
||||
//
|
||||
this.kryptonLabel2.LabelStyle = ComponentFactory.Krypton.Toolkit.LabelStyle.TitleControl;
|
||||
this.kryptonLabel2.Location = new System.Drawing.Point(23, 296);
|
||||
this.kryptonLabel2.Name = "kryptonLabel2";
|
||||
this.kryptonLabel2.Size = new System.Drawing.Size(82, 26);
|
||||
this.kryptonLabel2.StateCommon.ShortText.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.kryptonLabel2.TabIndex = 47;
|
||||
this.kryptonLabel2.Values.Text = "报警类型:";
|
||||
//
|
||||
// kryptonLabel1
|
||||
//
|
||||
this.kryptonLabel1.LabelStyle = ComponentFactory.Krypton.Toolkit.LabelStyle.TitleControl;
|
||||
this.kryptonLabel1.Location = new System.Drawing.Point(23, 225);
|
||||
this.kryptonLabel1.Name = "kryptonLabel1";
|
||||
this.kryptonLabel1.Size = new System.Drawing.Size(80, 26);
|
||||
this.kryptonLabel1.StateCommon.ShortText.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.kryptonLabel1.TabIndex = 48;
|
||||
this.kryptonLabel1.Values.Text = "PLC信息:";
|
||||
//
|
||||
// lbWarningMessage
|
||||
//
|
||||
this.lbWarningMessage.LabelStyle = ComponentFactory.Krypton.Toolkit.LabelStyle.TitleControl;
|
||||
this.lbWarningMessage.Location = new System.Drawing.Point(23, 154);
|
||||
this.lbWarningMessage.Name = "lbWarningMessage";
|
||||
this.lbWarningMessage.Size = new System.Drawing.Size(82, 26);
|
||||
this.lbWarningMessage.StateCommon.ShortText.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.lbWarningMessage.TabIndex = 49;
|
||||
this.lbWarningMessage.Values.Text = "报警消息:";
|
||||
//
|
||||
// txtWarningName
|
||||
//
|
||||
this.txtWarningName.AlwaysActive = false;
|
||||
this.txtWarningName.Location = new System.Drawing.Point(23, 111);
|
||||
this.txtWarningName.Name = "txtWarningName";
|
||||
this.txtWarningName.PaletteMode = ComponentFactory.Krypton.Toolkit.PaletteMode.ProfessionalOffice2003;
|
||||
this.txtWarningName.Size = new System.Drawing.Size(242, 35);
|
||||
this.txtWarningName.StateActive.Border.Color1 = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(255)))));
|
||||
this.txtWarningName.StateActive.Border.DrawBorders = ((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders)((((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Top | ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Bottom)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Left)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Right)));
|
||||
this.txtWarningName.StateCommon.Border.DrawBorders = ((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders)((((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Top | ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Bottom)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Left)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Right)));
|
||||
this.txtWarningName.StateCommon.Border.GraphicsHint = ComponentFactory.Krypton.Toolkit.PaletteGraphicsHint.AntiAlias;
|
||||
this.txtWarningName.StateCommon.Border.Rounding = 4;
|
||||
this.txtWarningName.StateCommon.Border.Width = 2;
|
||||
this.txtWarningName.StateCommon.Content.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.txtWarningName.TabIndex = 46;
|
||||
//
|
||||
// lbWarningName
|
||||
//
|
||||
this.lbWarningName.LabelStyle = ComponentFactory.Krypton.Toolkit.LabelStyle.TitleControl;
|
||||
this.lbWarningName.Location = new System.Drawing.Point(23, 85);
|
||||
this.lbWarningName.Name = "lbWarningName";
|
||||
this.lbWarningName.Size = new System.Drawing.Size(82, 26);
|
||||
this.lbWarningName.StateCommon.ShortText.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.lbWarningName.TabIndex = 45;
|
||||
this.lbWarningName.Values.Text = "报警名称:";
|
||||
//
|
||||
// txtWarningCode
|
||||
//
|
||||
this.txtWarningCode.AlwaysActive = false;
|
||||
this.txtWarningCode.Location = new System.Drawing.Point(23, 44);
|
||||
this.txtWarningCode.Name = "txtWarningCode";
|
||||
this.txtWarningCode.PaletteMode = ComponentFactory.Krypton.Toolkit.PaletteMode.ProfessionalOffice2003;
|
||||
this.txtWarningCode.Size = new System.Drawing.Size(242, 35);
|
||||
this.txtWarningCode.StateActive.Border.Color1 = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(255)))));
|
||||
this.txtWarningCode.StateActive.Border.DrawBorders = ((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders)((((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Top | ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Bottom)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Left)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Right)));
|
||||
this.txtWarningCode.StateCommon.Border.DrawBorders = ((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders)((((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Top | ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Bottom)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Left)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Right)));
|
||||
this.txtWarningCode.StateCommon.Border.GraphicsHint = ComponentFactory.Krypton.Toolkit.PaletteGraphicsHint.AntiAlias;
|
||||
this.txtWarningCode.StateCommon.Border.Rounding = 4;
|
||||
this.txtWarningCode.StateCommon.Border.Width = 2;
|
||||
this.txtWarningCode.StateCommon.Content.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.txtWarningCode.TabIndex = 44;
|
||||
//
|
||||
// lbWarningCode
|
||||
//
|
||||
this.lbWarningCode.LabelStyle = ComponentFactory.Krypton.Toolkit.LabelStyle.TitleControl;
|
||||
this.lbWarningCode.Location = new System.Drawing.Point(23, 12);
|
||||
this.lbWarningCode.Name = "lbWarningCode";
|
||||
this.lbWarningCode.Size = new System.Drawing.Size(82, 26);
|
||||
this.lbWarningCode.StateCommon.ShortText.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.lbWarningCode.TabIndex = 43;
|
||||
this.lbWarningCode.Values.Text = "报警编码:";
|
||||
//
|
||||
// btnEdit
|
||||
//
|
||||
this.btnEdit.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.btnEdit.Location = new System.Drawing.Point(183, 382);
|
||||
this.btnEdit.Name = "btnEdit";
|
||||
this.btnEdit.Size = new System.Drawing.Size(82, 40);
|
||||
this.btnEdit.StateCommon.Content.ShortText.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.btnEdit.TabIndex = 35;
|
||||
this.btnEdit.Values.Text = "取消";
|
||||
this.btnEdit.Click += new System.EventHandler(this.btnEdit_Click);
|
||||
//
|
||||
// btnAdd
|
||||
//
|
||||
this.btnAdd.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.btnAdd.Location = new System.Drawing.Point(23, 382);
|
||||
this.btnAdd.Name = "btnAdd";
|
||||
this.btnAdd.Size = new System.Drawing.Size(82, 40);
|
||||
this.btnAdd.StateCommon.Content.ShortText.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.btnAdd.TabIndex = 34;
|
||||
this.btnAdd.Values.Text = "确认";
|
||||
this.btnAdd.Click += new System.EventHandler(this.btnAdd_Click);
|
||||
//
|
||||
// frmEditWaringMsg
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(289, 441);
|
||||
this.Controls.Add(this.kryptonPanel1);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "frmEditWaringMsg";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||
this.Text = "EditWaringMsg";
|
||||
this.Load += new System.EventHandler(this.frmEditWaringMsg_Load);
|
||||
((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).EndInit();
|
||||
this.kryptonPanel1.ResumeLayout(false);
|
||||
this.kryptonPanel1.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.kcmb_WarningType)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonPanel kryptonPanel1;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonButton btnEdit;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonButton btnAdd;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonComboBox kcmb_WarningType;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonTextBox ktb_PlcCode;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonTextBox txtWarningMessage;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonLabel kryptonLabel2;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonLabel kryptonLabel1;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonLabel lbWarningMessage;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonTextBox txtWarningName;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonLabel lbWarningName;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonTextBox txtWarningCode;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonLabel lbWarningCode;
|
||||
}
|
||||
}
|
||||
142
CleanMachineHMI/frmChild/frmEditWaringMsg.cs
Normal file
142
CleanMachineHMI/frmChild/frmEditWaringMsg.cs
Normal file
@@ -0,0 +1,142 @@
|
||||
using CleanMachineHMI.forms;
|
||||
using CleanMachineHMI.FrmUserControl;
|
||||
using CleanMachineHMI.Utils;
|
||||
using ComponentFactory.Krypton.Toolkit;
|
||||
using LeadDataBaseUtility;
|
||||
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;
|
||||
|
||||
namespace CleanMachineHMI.frmChild
|
||||
{
|
||||
public partial class frmEditWaringMsg : KryptonForm
|
||||
{
|
||||
public frmEditWaringMsg()
|
||||
{
|
||||
InitializeComponent();
|
||||
_ComboBoxLanguageTextList = this.GetInfoLanguageText(GlobalHelper.LanguageCode, "KryptonComboBox");
|
||||
_InfoLanguageTextList = this.GetInfoLanguageText(GlobalHelper.LanguageCode);
|
||||
}
|
||||
private DataTable _ComboBoxLanguageTextList;
|
||||
private DataTable _InfoLanguageTextList;
|
||||
public string WarningId { get; set; }
|
||||
private void txt_GotFocus(object sender, EventArgs e)
|
||||
{
|
||||
KeyboardAutoPopUp.ShowInputPanel();
|
||||
}
|
||||
private void txt_LostFocus(object sender, EventArgs e)
|
||||
{
|
||||
KeyboardAutoPopUp.HideInputPanel();
|
||||
}
|
||||
private void InitControlEvent()
|
||||
{
|
||||
txtWarningCode.GotFocus += new EventHandler(txt_GotFocus); //获取焦点前发生事件
|
||||
txtWarningCode.LostFocus += new EventHandler(txt_LostFocus); //失去焦点后发生事件
|
||||
|
||||
txtWarningName.GotFocus += new EventHandler(txt_GotFocus); //获取焦点前发生事件
|
||||
txtWarningName.LostFocus += new EventHandler(txt_LostFocus); //失去焦点后发生事件
|
||||
|
||||
txtWarningMessage.GotFocus += new EventHandler(txt_GotFocus); //获取焦点前发生事件
|
||||
txtWarningMessage.LostFocus += new EventHandler(txt_LostFocus); //失去焦点后发生事件
|
||||
|
||||
ktb_PlcCode.GotFocus += new EventHandler(txt_GotFocus); //获取焦点前发生事件
|
||||
ktb_PlcCode.LostFocus += new EventHandler(txt_LostFocus); //失去焦点后发生事件
|
||||
}
|
||||
|
||||
private void frmEditWaringMsg_Load(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
InitControlEvent();
|
||||
this.SetFormControlText(GlobalHelper.LanguageCode);
|
||||
if (GlobalHelper.LanguageCode == "English")
|
||||
{
|
||||
kcmb_WarningType.Items.Clear();
|
||||
foreach (DataRow item in _ComboBoxLanguageTextList.GetComBoboxItemArr(kcmb_WarningType.Name, "KryptonComboBox"))
|
||||
{
|
||||
kcmb_WarningType.Items.Add(item["CONTROL_NAME"].ToString());
|
||||
}
|
||||
}
|
||||
kcmb_WarningType.SelectedIndex = 0;
|
||||
string sql1 = $@"select WARNING_ID,WARNING_CODE,WARNING_NAME,PLC_ITEM_CODE,WARNING_TYPE,WARNING_MESSAGE,CREATE_TIME from BAS_WARNING where WARNING_ID = '{WarningId}'";
|
||||
DataTable dt1 = LeadDbHelperSQLite.Query(sql1).Tables[0];
|
||||
if (dt1 != null && dt1.Rows.Count > 0)
|
||||
{
|
||||
txtWarningCode.Text = dt1.Rows[0]["WARNING_CODE"].ToString();
|
||||
txtWarningCode.Enabled = false;
|
||||
txtWarningName.Text = dt1.Rows[0]["WARNING_NAME"].ToString();
|
||||
txtWarningMessage.Text = dt1.Rows[0]["WARNING_MESSAGE"].ToString();
|
||||
ktb_PlcCode.Text = dt1.Rows[0]["PLC_ITEM_CODE"].ToString();
|
||||
kcmb_WarningType.SelectedIndex = Convert.ToInt32(dt1.Rows[0]["WARNING_TYPE"]);
|
||||
}
|
||||
kryptonPanel1.Focus();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("编辑基础报警数据界面加载异常", "LoadEditFrmExp") + $":【{ex.Message}】!");
|
||||
}
|
||||
}
|
||||
|
||||
private void btnAdd_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (string.IsNullOrEmpty(txtWarningCode.Text))
|
||||
{
|
||||
//KryptonMessageBox.Show("请输入报警条码!");
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请输入报警条码!", "EnterWarningCodeInfo"));
|
||||
return;
|
||||
}
|
||||
if (string.IsNullOrEmpty(txtWarningName.Text))
|
||||
{
|
||||
//KryptonMessageBox.Show("请输入报警名称!");
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请输入报警名称!", "EnterWarningNameInfo"));
|
||||
return;
|
||||
}
|
||||
if (kcmb_WarningType.SelectedIndex == 0)
|
||||
{
|
||||
//KryptonMessageBox.Show("请选择报警类型!");
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请选择报警类型!", "SelectWarningTypeInfo"));
|
||||
return;
|
||||
}
|
||||
string sqlIsExistCode = $@"SELECT 1 FROM BAS_WARNING WHERE WARNING_TYPE = '{kcmb_WarningType.SelectedIndex}' AND PLC_ITEM_CODE = '{ktb_PlcCode.Text}' AND WARNING_CODE = '{txtWarningCode.Text}'";
|
||||
DataTable dtIsExistCode = LeadDbHelperSQLite.Query(sqlIsExistCode).Tables[0];
|
||||
if (dtIsExistCode != null && dtIsExistCode.Rows.Count > 0)
|
||||
{
|
||||
//KryptonMessageBox.Show($"相同报警类型;【{kcmb_WarningType.Text}】,PLC条码:【{ktb_PlcCode.Text}】下的报警编码:【{txtWarningCode.Text}】已经存在,请重新输入!");
|
||||
KryptonMessageBox.Show($"Same alarm type: [{kcmb_WarningType.Text}],PLC item code: [{ktb_PlcCode.Text}] alarm code: [{txtWarningCode.Text}] already exists, please re-enter!");
|
||||
return;
|
||||
}
|
||||
string sql = $@"update BAS_WARNING set WARNING_NAME = '{txtWarningName.Text}',WARNING_MESSAGE = '{txtWarningMessage.Text}',PLC_ITEM_CODE = '{ktb_PlcCode.Text}',WARNING_TYPE = '{kcmb_WarningType.SelectedIndex}',UPDATE_BY = '{GlobalHelper.UserInfo.USER_ID}',UPDATE_TIME = datetime('now', 'localtime') where WARNING_ID = '{WarningId}'";
|
||||
int row = LeadDbHelperSQLite.ExecuteSql(sql);
|
||||
if (row > 0)
|
||||
{
|
||||
//KryptonMessageBox.Show("修改基础报警数据成功!");
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("修改基础报警数据成功!", "EditSuccessInfo"));
|
||||
frmWarning.RefreshFrmHost();
|
||||
this.Close();
|
||||
}
|
||||
else
|
||||
{
|
||||
//KryptonMessageBox.Show("修改基础报警数据失败!");
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("修改基础报警数据失败!", "EditFailInfo"));
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("编辑基础报警数据发生异常", "EditWarningDataExp") + $":【{ex.Message}】!");
|
||||
}
|
||||
}
|
||||
|
||||
private void btnEdit_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
120
CleanMachineHMI/frmChild/frmEditWaringMsg.resx
Normal file
120
CleanMachineHMI/frmChild/frmEditWaringMsg.resx
Normal file
@@ -0,0 +1,120 @@
|
||||
<?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>
|
||||
266
CleanMachineHMI/frmChild/frmEditWorkingPalletData.Designer.cs
generated
Normal file
266
CleanMachineHMI/frmChild/frmEditWorkingPalletData.Designer.cs
generated
Normal file
@@ -0,0 +1,266 @@
|
||||
namespace CleanMachineHMI.frmChild
|
||||
{
|
||||
partial class frmEditWorkingPalletData
|
||||
{
|
||||
/// <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.kryptonGroupBox1 = new ComponentFactory.Krypton.Toolkit.KryptonGroupBox();
|
||||
this.kbtn_Cancel = new ComponentFactory.Krypton.Toolkit.KryptonButton();
|
||||
this.kbtn_Confirm = new ComponentFactory.Krypton.Toolkit.KryptonButton();
|
||||
this.kryptonGroupBox2 = new ComponentFactory.Krypton.Toolkit.KryptonGroupBox();
|
||||
this.kryptonDataGridView1 = new ComponentFactory.Krypton.Toolkit.KryptonDataGridView();
|
||||
this.序号 = new ComponentFactory.Krypton.Toolkit.KryptonDataGridViewTextBoxColumn();
|
||||
this.清洁方式 = new ComponentFactory.Krypton.Toolkit.KryptonDataGridViewTextBoxColumn();
|
||||
this.污染类型 = new ComponentFactory.Krypton.Toolkit.KryptonDataGridViewTextBoxColumn();
|
||||
this.污染明细 = new ComponentFactory.Krypton.Toolkit.KryptonDataGridViewTextBoxColumn();
|
||||
this.当前数量 = new ComponentFactory.Krypton.Toolkit.KryptonDataGridViewTextBoxColumn();
|
||||
this.更改数量 = new ComponentFactory.Krypton.Toolkit.KryptonDataGridViewTextBoxColumn();
|
||||
this.IR条码 = new ComponentFactory.Krypton.Toolkit.KryptonDataGridViewTextBoxColumn();
|
||||
this.托盘号 = new ComponentFactory.Krypton.Toolkit.KryptonDataGridViewTextBoxColumn();
|
||||
this.板材号 = new ComponentFactory.Krypton.Toolkit.KryptonDataGridViewTextBoxColumn();
|
||||
this.录入时间 = new ComponentFactory.Krypton.Toolkit.KryptonDataGridViewTextBoxColumn();
|
||||
this.kryptonButton1 = new ComponentFactory.Krypton.Toolkit.KryptonButton();
|
||||
((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox1)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox1.Panel)).BeginInit();
|
||||
this.kryptonGroupBox1.Panel.SuspendLayout();
|
||||
this.kryptonGroupBox1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox2)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox2.Panel)).BeginInit();
|
||||
this.kryptonGroupBox2.Panel.SuspendLayout();
|
||||
this.kryptonGroupBox2.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.kryptonDataGridView1)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// kryptonGroupBox1
|
||||
//
|
||||
this.kryptonGroupBox1.CaptionOverlap = 0D;
|
||||
this.kryptonGroupBox1.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
this.kryptonGroupBox1.Location = new System.Drawing.Point(0, 0);
|
||||
this.kryptonGroupBox1.Name = "kryptonGroupBox1";
|
||||
//
|
||||
// kryptonGroupBox1.Panel
|
||||
//
|
||||
this.kryptonGroupBox1.Panel.Controls.Add(this.kbtn_Cancel);
|
||||
this.kryptonGroupBox1.Panel.Controls.Add(this.kbtn_Confirm);
|
||||
this.kryptonGroupBox1.Size = new System.Drawing.Size(984, 73);
|
||||
this.kryptonGroupBox1.TabIndex = 0;
|
||||
this.kryptonGroupBox1.Values.Heading = "按钮操作:";
|
||||
//
|
||||
// kbtn_Cancel
|
||||
//
|
||||
this.kbtn_Cancel.Location = new System.Drawing.Point(145, 7);
|
||||
this.kbtn_Cancel.Name = "kbtn_Cancel";
|
||||
this.kbtn_Cancel.Size = new System.Drawing.Size(90, 35);
|
||||
this.kbtn_Cancel.TabIndex = 0;
|
||||
this.kbtn_Cancel.Values.Text = "取消";
|
||||
this.kbtn_Cancel.Click += new System.EventHandler(this.kbtn_Cancel_Click);
|
||||
//
|
||||
// kbtn_Confirm
|
||||
//
|
||||
this.kbtn_Confirm.Location = new System.Drawing.Point(25, 7);
|
||||
this.kbtn_Confirm.Name = "kbtn_Confirm";
|
||||
this.kbtn_Confirm.Size = new System.Drawing.Size(90, 35);
|
||||
this.kbtn_Confirm.TabIndex = 0;
|
||||
this.kbtn_Confirm.Values.Text = "确认";
|
||||
this.kbtn_Confirm.Click += new System.EventHandler(this.kbtn_Confirm_Click);
|
||||
//
|
||||
// kryptonGroupBox2
|
||||
//
|
||||
this.kryptonGroupBox2.CaptionOverlap = 0D;
|
||||
this.kryptonGroupBox2.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.kryptonGroupBox2.Location = new System.Drawing.Point(0, 73);
|
||||
this.kryptonGroupBox2.Name = "kryptonGroupBox2";
|
||||
//
|
||||
// kryptonGroupBox2.Panel
|
||||
//
|
||||
this.kryptonGroupBox2.Panel.Controls.Add(this.kryptonDataGridView1);
|
||||
this.kryptonGroupBox2.Panel.Controls.Add(this.kryptonButton1);
|
||||
this.kryptonGroupBox2.Size = new System.Drawing.Size(984, 518);
|
||||
this.kryptonGroupBox2.TabIndex = 6;
|
||||
this.kryptonGroupBox2.Values.Heading = "作业托盘明细数据:";
|
||||
//
|
||||
// kryptonDataGridView1
|
||||
//
|
||||
this.kryptonDataGridView1.AllowUserToAddRows = false;
|
||||
this.kryptonDataGridView1.AllowUserToDeleteRows = false;
|
||||
this.kryptonDataGridView1.AllowUserToResizeColumns = false;
|
||||
this.kryptonDataGridView1.AllowUserToResizeRows = false;
|
||||
this.kryptonDataGridView1.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.AllCells;
|
||||
this.kryptonDataGridView1.ClipboardCopyMode = System.Windows.Forms.DataGridViewClipboardCopyMode.EnableWithoutHeaderText;
|
||||
this.kryptonDataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
|
||||
this.序号,
|
||||
this.清洁方式,
|
||||
this.污染类型,
|
||||
this.污染明细,
|
||||
this.当前数量,
|
||||
this.更改数量,
|
||||
this.IR条码,
|
||||
this.托盘号,
|
||||
this.板材号,
|
||||
this.录入时间});
|
||||
this.kryptonDataGridView1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.kryptonDataGridView1.EditMode = System.Windows.Forms.DataGridViewEditMode.EditOnEnter;
|
||||
this.kryptonDataGridView1.Location = new System.Drawing.Point(0, 0);
|
||||
this.kryptonDataGridView1.MultiSelect = false;
|
||||
this.kryptonDataGridView1.Name = "kryptonDataGridView1";
|
||||
this.kryptonDataGridView1.RowTemplate.Height = 23;
|
||||
this.kryptonDataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
|
||||
this.kryptonDataGridView1.Size = new System.Drawing.Size(980, 494);
|
||||
this.kryptonDataGridView1.TabIndex = 0;
|
||||
this.kryptonDataGridView1.CellBeginEdit += new System.Windows.Forms.DataGridViewCellCancelEventHandler(this.kryptonDataGridView1_CellBeginEdit);
|
||||
this.kryptonDataGridView1.CellContentDoubleClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.kryptonDataGridView1_CellContentDoubleClick);
|
||||
this.kryptonDataGridView1.CellLeave += new System.Windows.Forms.DataGridViewCellEventHandler(this.kryptonDataGridView1_CellLeave);
|
||||
this.kryptonDataGridView1.DataError += new System.Windows.Forms.DataGridViewDataErrorEventHandler(this.kryptonDataGridView1_DataError);
|
||||
//
|
||||
// 序号
|
||||
//
|
||||
this.序号.HeaderText = "序号";
|
||||
this.序号.Name = "序号";
|
||||
this.序号.ReadOnly = true;
|
||||
this.序号.Width = 62;
|
||||
//
|
||||
// 清洁方式
|
||||
//
|
||||
this.清洁方式.HeaderText = "清洁方式";
|
||||
this.清洁方式.Name = "清洁方式";
|
||||
this.清洁方式.ReadOnly = true;
|
||||
this.清洁方式.Width = 88;
|
||||
//
|
||||
// 污染类型
|
||||
//
|
||||
this.污染类型.HeaderText = "污染类型";
|
||||
this.污染类型.Name = "污染类型";
|
||||
this.污染类型.ReadOnly = true;
|
||||
this.污染类型.Width = 88;
|
||||
//
|
||||
// 污染明细
|
||||
//
|
||||
this.污染明细.HeaderText = "污染明细";
|
||||
this.污染明细.Name = "污染明细";
|
||||
this.污染明细.ReadOnly = true;
|
||||
this.污染明细.Resizable = System.Windows.Forms.DataGridViewTriState.True;
|
||||
this.污染明细.Width = 88;
|
||||
//
|
||||
// 当前数量
|
||||
//
|
||||
this.当前数量.HeaderText = "当前数量";
|
||||
this.当前数量.Name = "当前数量";
|
||||
this.当前数量.ReadOnly = true;
|
||||
this.当前数量.Width = 88;
|
||||
//
|
||||
// 更改数量
|
||||
//
|
||||
this.更改数量.HeaderText = "更改数量";
|
||||
this.更改数量.Name = "更改数量";
|
||||
this.更改数量.Width = 88;
|
||||
//
|
||||
// IR条码
|
||||
//
|
||||
this.IR条码.HeaderText = "IR条码";
|
||||
this.IR条码.Name = "IR条码";
|
||||
this.IR条码.ReadOnly = true;
|
||||
this.IR条码.Width = 72;
|
||||
//
|
||||
// 托盘号
|
||||
//
|
||||
this.托盘号.HeaderText = "托盘号";
|
||||
this.托盘号.Name = "托盘号";
|
||||
this.托盘号.ReadOnly = true;
|
||||
this.托盘号.Width = 75;
|
||||
//
|
||||
// 板材号
|
||||
//
|
||||
this.板材号.HeaderText = "板材号";
|
||||
this.板材号.Name = "板材号";
|
||||
this.板材号.ReadOnly = true;
|
||||
this.板材号.Width = 75;
|
||||
//
|
||||
// 录入时间
|
||||
//
|
||||
this.录入时间.HeaderText = "录入时间";
|
||||
this.录入时间.Name = "录入时间";
|
||||
this.录入时间.ReadOnly = true;
|
||||
this.录入时间.Width = 88;
|
||||
//
|
||||
// kryptonButton1
|
||||
//
|
||||
this.kryptonButton1.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.kryptonButton1.Location = new System.Drawing.Point(728, 47);
|
||||
this.kryptonButton1.Name = "kryptonButton1";
|
||||
this.kryptonButton1.Size = new System.Drawing.Size(104, 387);
|
||||
this.kryptonButton1.TabIndex = 0;
|
||||
this.kryptonButton1.Values.Text = "重置条件";
|
||||
//
|
||||
// frmEditWorkingPalletData
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(984, 591);
|
||||
this.Controls.Add(this.kryptonGroupBox2);
|
||||
this.Controls.Add(this.kryptonGroupBox1);
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "frmEditWorkingPalletData";
|
||||
this.ShowIcon = false;
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||
this.Text = "frmEditWorkingPalletData";
|
||||
this.Load += new System.EventHandler(this.frmEditWorkingPalletData_Load);
|
||||
((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox1.Panel)).EndInit();
|
||||
this.kryptonGroupBox1.Panel.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox1)).EndInit();
|
||||
this.kryptonGroupBox1.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox2.Panel)).EndInit();
|
||||
this.kryptonGroupBox2.Panel.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox2)).EndInit();
|
||||
this.kryptonGroupBox2.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.kryptonDataGridView1)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonGroupBox kryptonGroupBox1;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonGroupBox kryptonGroupBox2;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonDataGridView kryptonDataGridView1;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonButton kryptonButton1;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonButton kbtn_Cancel;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonButton kbtn_Confirm;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonDataGridViewTextBoxColumn 序号;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonDataGridViewTextBoxColumn 清洁方式;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonDataGridViewTextBoxColumn 污染类型;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonDataGridViewTextBoxColumn 污染明细;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonDataGridViewTextBoxColumn 当前数量;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonDataGridViewTextBoxColumn 更改数量;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonDataGridViewTextBoxColumn IR条码;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonDataGridViewTextBoxColumn 托盘号;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonDataGridViewTextBoxColumn 板材号;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonDataGridViewTextBoxColumn 录入时间;
|
||||
}
|
||||
}
|
||||
130
CleanMachineHMI/frmChild/frmEditWorkingPalletData.cs
Normal file
130
CleanMachineHMI/frmChild/frmEditWorkingPalletData.cs
Normal file
@@ -0,0 +1,130 @@
|
||||
using ComponentFactory.Krypton.Toolkit;
|
||||
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 LeadDataBaseUtility;
|
||||
using System.Text.RegularExpressions;
|
||||
using CleanMachineHMI.Utils;
|
||||
using CleanMachineHMI.FrmUserControl;
|
||||
|
||||
namespace CleanMachineHMI.frmChild
|
||||
{
|
||||
public partial class frmEditWorkingPalletData : KryptonForm
|
||||
{
|
||||
public frmEditWorkingPalletData()
|
||||
{
|
||||
InitializeComponent();
|
||||
_InfoLanguageTextList = this.GetInfoLanguageText(GlobalHelper.LanguageCode);
|
||||
}
|
||||
private DataTable _InfoLanguageTextList;
|
||||
public string PalletCode { get; set; }
|
||||
private void frmEditWorkingPalletData_Load(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
this.SetFormControlText(GlobalHelper.LanguageCode);
|
||||
string sql = $@"select * from VW_WORKING_PALLET_MSG where WORKING_PALLET_CODE = '{PalletCode}'";
|
||||
DataTable dt = LeadDbHelperSQLite.Query(sql).Tables[0];
|
||||
if (dt != null && dt.Rows.Count > 0)
|
||||
{
|
||||
kryptonDataGridView1.Rows.Clear();
|
||||
foreach (DataRow item in dt.Rows)
|
||||
{
|
||||
int index = kryptonDataGridView1.Rows.Add();
|
||||
kryptonDataGridView1.Rows[index].Cells[0].Value = item["WORKING_PALLET_DTL_ID"].ToString();
|
||||
kryptonDataGridView1.Rows[index].Cells[1].Value = item["CLEAN_MODE_NAME"].ToString();
|
||||
kryptonDataGridView1.Rows[index].Cells[2].Value = item["CONTAMINATION_TYPE_NAME"].ToString();
|
||||
kryptonDataGridView1.Rows[index].Cells[3].Value = item["CONTAMINATION_DTL_NAME"].ToString();
|
||||
kryptonDataGridView1.Rows[index].Cells[4].Value = item["CURRENT_NUMBER"].ToString();
|
||||
kryptonDataGridView1.Rows[index].Cells[6].Value = item["IR_CODE"].ToString();
|
||||
kryptonDataGridView1.Rows[index].Cells[7].Value = item["WORKING_PALLET_CODE"].ToString();
|
||||
kryptonDataGridView1.Rows[index].Cells[8].Value = item["SHEET_TYPE_NAME"].ToString();
|
||||
kryptonDataGridView1.Rows[index].Cells[9].Value = item["INPUT_TIME"].ToString();
|
||||
}
|
||||
|
||||
kryptonDataGridView1.SetDataViewColumnText(this.Name, GlobalHelper.LanguageCode);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("编辑作业托盘数据界面加载异常", "LoadEditFrmExp") + $":【{ex.Message}】!");
|
||||
}
|
||||
}
|
||||
|
||||
private void kbtn_Confirm_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
int rowIndex = 0;
|
||||
foreach (DataGridViewRow item in kryptonDataGridView1.Rows)
|
||||
{
|
||||
rowIndex++;
|
||||
string workingDtlId = item.Cells[0].Value.ToString();
|
||||
if (item.Cells[5].Value != null)
|
||||
{
|
||||
if (Regex.IsMatch(item.Cells[5].Value.ToString(), "^([1-9][0-9]*)$"))
|
||||
{
|
||||
string sql = $@"update CM_WORKING_PALLET_DTL set CURRENT_NUMBER = '{item.Cells[5].Value}',OPERATE_USER_ID = '{GlobalHelper.UserInfo.USER_ID}',OPERATE_USER_TIME = datetime('now', 'localtime'),DATA_VERSION = DATA_VERSION + 1 where WORKING_PALLET_DTL_ID = '{workingDtlId}'";
|
||||
string sql1 = $@"update ZBK_WORKING_PALLET_DTL set CURRENT_NUMBER = '{item.Cells[5].Value}',OPERATE_USER_ID = '{GlobalHelper.UserInfo.USER_ID}',OPERATE_USER_TIME = datetime('now', 'localtime'),DATA_VERSION = DATA_VERSION + 1 where WORKING_PALLET_DTL_ID = '{workingDtlId}'";
|
||||
LeadDbHelperSQLite.ExecuteSql(sql);
|
||||
LeadDbHelperSQLite.ExecuteSql(sql1);
|
||||
}
|
||||
else
|
||||
{
|
||||
//KryptonMessageBox.Show($"第:{rowIndex}行输入的更改数量,不是正整数!");
|
||||
KryptonMessageBox.Show($"The number of changes entered in line: {rowIndex} is not a positive integer!");
|
||||
}
|
||||
}
|
||||
}
|
||||
frmPrinterMain.RefreshFrmHost();
|
||||
KryptonMessageBox.Show($"Edit Success!");
|
||||
this.Close();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("编辑作业托盘数据异常", "EditWorkingPalletDataExp") + $":【{ex.Message}】!");
|
||||
}
|
||||
}
|
||||
|
||||
private void kbtn_Cancel_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
|
||||
private void kryptonDataGridView1_CellLeave(object sender, DataGridViewCellEventArgs e)
|
||||
{
|
||||
if (e.ColumnIndex == 5)
|
||||
{
|
||||
BeginInvoke(new Action(() => {
|
||||
KeyboardAutoPopUp.HideInputPanel();
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
private void kryptonDataGridView1_DataError(object sender, DataGridViewDataErrorEventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void kryptonDataGridView1_CellBeginEdit(object sender, DataGridViewCellCancelEventArgs e)
|
||||
{
|
||||
if (e.ColumnIndex == 5)
|
||||
{
|
||||
BeginInvoke(new Action(() => {
|
||||
KeyboardAutoPopUp.ShowInputPanel();
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
private void kryptonDataGridView1_CellContentDoubleClick(object sender, DataGridViewCellEventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
120
CleanMachineHMI/frmChild/frmEditWorkingPalletData.resx
Normal file
120
CleanMachineHMI/frmChild/frmEditWorkingPalletData.resx
Normal file
@@ -0,0 +1,120 @@
|
||||
<?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>
|
||||
160
CleanMachineHMI/frmChild/frmPopupWarningMsg.Designer.cs
generated
Normal file
160
CleanMachineHMI/frmChild/frmPopupWarningMsg.Designer.cs
generated
Normal file
@@ -0,0 +1,160 @@
|
||||
|
||||
namespace CleanMachineHMI.frmChild
|
||||
{
|
||||
partial class frmPopupWarningMsg
|
||||
{
|
||||
/// <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.kryptonGroupBox1 = new ComponentFactory.Krypton.Toolkit.KryptonGroupBox();
|
||||
this.kryptonDataGridView1 = new ComponentFactory.Krypton.Toolkit.KryptonDataGridView();
|
||||
this.kryptonPanel1 = new ComponentFactory.Krypton.Toolkit.KryptonPanel();
|
||||
this.kryptonButton1 = new ComponentFactory.Krypton.Toolkit.KryptonButton();
|
||||
this.Column1 = new ComponentFactory.Krypton.Toolkit.KryptonDataGridViewTextBoxColumn();
|
||||
this.Column2 = new ComponentFactory.Krypton.Toolkit.KryptonDataGridViewTextBoxColumn();
|
||||
((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox1)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox1.Panel)).BeginInit();
|
||||
this.kryptonGroupBox1.Panel.SuspendLayout();
|
||||
this.kryptonGroupBox1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.kryptonDataGridView1)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit();
|
||||
this.kryptonPanel1.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// kryptonGroupBox1
|
||||
//
|
||||
this.kryptonGroupBox1.CaptionOverlap = 0D;
|
||||
this.kryptonGroupBox1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.kryptonGroupBox1.Location = new System.Drawing.Point(0, 0);
|
||||
this.kryptonGroupBox1.Name = "kryptonGroupBox1";
|
||||
//
|
||||
// kryptonGroupBox1.Panel
|
||||
//
|
||||
this.kryptonGroupBox1.Panel.Controls.Add(this.kryptonDataGridView1);
|
||||
this.kryptonGroupBox1.Panel.Controls.Add(this.kryptonPanel1);
|
||||
this.kryptonGroupBox1.Size = new System.Drawing.Size(675, 426);
|
||||
this.kryptonGroupBox1.StateCommon.Border.DrawBorders = ((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders)((((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Top | ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Bottom)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Left)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Right)));
|
||||
this.kryptonGroupBox1.StateCommon.Border.Rounding = 0;
|
||||
this.kryptonGroupBox1.StateCommon.Border.Width = 1;
|
||||
this.kryptonGroupBox1.TabIndex = 0;
|
||||
this.kryptonGroupBox1.Values.Heading = "Alarm Message:";
|
||||
this.kryptonGroupBox1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.kryptonGroupBox1_MouseDown);
|
||||
//
|
||||
// kryptonDataGridView1
|
||||
//
|
||||
this.kryptonDataGridView1.AllowUserToAddRows = false;
|
||||
this.kryptonDataGridView1.AllowUserToDeleteRows = false;
|
||||
this.kryptonDataGridView1.AllowUserToResizeRows = false;
|
||||
this.kryptonDataGridView1.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
|
||||
this.kryptonDataGridView1.ColumnHeadersHeight = 30;
|
||||
this.kryptonDataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing;
|
||||
this.kryptonDataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
|
||||
this.Column1,
|
||||
this.Column2});
|
||||
this.kryptonDataGridView1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.kryptonDataGridView1.Location = new System.Drawing.Point(0, 0);
|
||||
this.kryptonDataGridView1.Name = "kryptonDataGridView1";
|
||||
this.kryptonDataGridView1.ReadOnly = true;
|
||||
this.kryptonDataGridView1.RowHeadersVisible = false;
|
||||
this.kryptonDataGridView1.RowHeadersWidth = 30;
|
||||
this.kryptonDataGridView1.RowHeadersWidthSizeMode = System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.DisableResizing;
|
||||
this.kryptonDataGridView1.RowTemplate.Height = 23;
|
||||
this.kryptonDataGridView1.Size = new System.Drawing.Size(673, 362);
|
||||
this.kryptonDataGridView1.TabIndex = 2;
|
||||
//
|
||||
// kryptonPanel1
|
||||
//
|
||||
this.kryptonPanel1.Controls.Add(this.kryptonButton1);
|
||||
this.kryptonPanel1.Dock = System.Windows.Forms.DockStyle.Bottom;
|
||||
this.kryptonPanel1.Location = new System.Drawing.Point(0, 362);
|
||||
this.kryptonPanel1.Name = "kryptonPanel1";
|
||||
this.kryptonPanel1.Size = new System.Drawing.Size(673, 41);
|
||||
this.kryptonPanel1.TabIndex = 3;
|
||||
//
|
||||
// kryptonButton1
|
||||
//
|
||||
this.kryptonButton1.Location = new System.Drawing.Point(276, 8);
|
||||
this.kryptonButton1.Name = "kryptonButton1";
|
||||
this.kryptonButton1.Size = new System.Drawing.Size(122, 25);
|
||||
this.kryptonButton1.TabIndex = 0;
|
||||
this.kryptonButton1.Values.Text = "Confirm";
|
||||
this.kryptonButton1.Click += new System.EventHandler(this.kryptonButton1_Click);
|
||||
//
|
||||
// Column1
|
||||
//
|
||||
this.Column1.FillWeight = 30.45685F;
|
||||
this.Column1.HeaderText = "Numerical Order";
|
||||
this.Column1.Name = "Column1";
|
||||
this.Column1.ReadOnly = true;
|
||||
this.Column1.Width = 102;
|
||||
//
|
||||
// Column2
|
||||
//
|
||||
this.Column2.FillWeight = 169.5432F;
|
||||
this.Column2.HeaderText = "Alarm prompt message";
|
||||
this.Column2.Name = "Column2";
|
||||
this.Column2.ReadOnly = true;
|
||||
this.Column2.Width = 570;
|
||||
//
|
||||
// frmPopupWarningMsg
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(675, 426);
|
||||
this.Controls.Add(this.kryptonGroupBox1);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "frmPopupWarningMsg";
|
||||
this.ShowIcon = false;
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Text = "Alarm prompt message";
|
||||
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.frmPopupWarningMsg_FormClosing);
|
||||
this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.frmPopupWarningMsg_FormClosed);
|
||||
this.Load += new System.EventHandler(this.frmPopupWarningMsg_Load);
|
||||
((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox1.Panel)).EndInit();
|
||||
this.kryptonGroupBox1.Panel.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox1)).EndInit();
|
||||
this.kryptonGroupBox1.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.kryptonDataGridView1)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).EndInit();
|
||||
this.kryptonPanel1.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonGroupBox kryptonGroupBox1;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonDataGridView kryptonDataGridView1;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonPanel kryptonPanel1;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonButton kryptonButton1;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonDataGridViewTextBoxColumn Column1;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonDataGridViewTextBoxColumn Column2;
|
||||
}
|
||||
}
|
||||
120
CleanMachineHMI/frmChild/frmPopupWarningMsg.cs
Normal file
120
CleanMachineHMI/frmChild/frmPopupWarningMsg.cs
Normal file
@@ -0,0 +1,120 @@
|
||||
using ComponentFactory.Krypton.Toolkit;
|
||||
using NX_LogUtility;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace CleanMachineHMI.frmChild
|
||||
{
|
||||
public partial class frmPopupWarningMsg : KryptonForm
|
||||
{
|
||||
public frmPopupWarningMsg()
|
||||
{
|
||||
InitializeComponent();
|
||||
RefreshFrmHost = new dlgRefreshFrmHost(SetDataGridView);
|
||||
}
|
||||
public delegate void dlgRefreshFrmHost();
|
||||
public static dlgRefreshFrmHost RefreshFrmHost;
|
||||
public static List<Bas_WarningMd> warnLst = new List<Bas_WarningMd>();
|
||||
private void frmPopupWarningMsg_Load(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
private void SetDataGridView()
|
||||
{
|
||||
try
|
||||
{
|
||||
Invoke(new Action(() =>
|
||||
{
|
||||
if (warnLst.Count > 0)
|
||||
{
|
||||
kryptonDataGridView1.Rows.Clear();
|
||||
foreach (Bas_WarningMd item in warnLst)
|
||||
{
|
||||
int index = kryptonDataGridView1.Rows.Add();
|
||||
kryptonDataGridView1.Rows[index].Cells[0].Value = index + 1;
|
||||
kryptonDataGridView1.Rows[index].Cells[1].Value = item.WarningMessage.ToString();
|
||||
}
|
||||
}
|
||||
}));
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLog($"刷新报警信息发生异常:【{ex.Message}】", LogTypeEum.Err);
|
||||
}
|
||||
}
|
||||
private void frmPopupWarningMsg_FormClosing(object sender, FormClosingEventArgs e)
|
||||
{
|
||||
//try
|
||||
//{
|
||||
// Task.Run(async delegate
|
||||
// {
|
||||
// if (PlcOperationHelper.Instance.WritePlcItem("AlarmPopUpMsg", "0", PlcItemTypeDesc.D))
|
||||
// {
|
||||
// LogHelper.WriteLog($"清空PLC报警提示变量成功!", LogTypeEum.Run);
|
||||
// }
|
||||
// await Task.Delay(100);
|
||||
// GlobalHelper.PopupWarningMsgForm = null;
|
||||
// });
|
||||
//}
|
||||
//catch (Exception ex)
|
||||
//{
|
||||
// LogHelper.WriteLog($"关闭报警信息弹出页面发生异常:【{ex.Message}】", LogTypeEum.Err);
|
||||
//}
|
||||
}
|
||||
|
||||
private void frmPopupWarningMsg_FormClosed(object sender, FormClosedEventArgs e)
|
||||
{
|
||||
//if (PlcOperationHelper.Instance.WritePlcItem("AlarmPopUpMsg", "0", PlcItemTypeDesc.D))
|
||||
//{
|
||||
// LogHelper.WriteLog($"清空PLC报警提示变量成功!", LogTypeEum.Run);
|
||||
//}
|
||||
}
|
||||
|
||||
private void kryptonButton1_Click(object sender, EventArgs e)
|
||||
{
|
||||
kryptonButton1.Enabled = false;
|
||||
try
|
||||
{
|
||||
Task.Run(async delegate
|
||||
{
|
||||
if (PlcOperationHelper.Instance.WritePlcItem("AlarmPopUpMsg", "0", PlcItemTypeDesc.D))
|
||||
{
|
||||
LogHelper.WriteLog($"清空PLC报警提示变量成功!", LogTypeEum.Run);
|
||||
}
|
||||
await Task.Delay(500);
|
||||
GlobalHelper.PopupWarningMsgForm = null;
|
||||
this.Close();
|
||||
});
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLog($"关闭报警信息弹出页面发生异常:【{ex.Message}】", LogTypeEum.Err);
|
||||
//kryptonButton1.Enabled = true;
|
||||
}
|
||||
//kryptonButton1.Enabled = true;
|
||||
}
|
||||
[DllImport("user32.dll")]
|
||||
public static extern bool ReleaseCapture();
|
||||
|
||||
[DllImport("user32.dll")]
|
||||
public static extern bool SendMessage(IntPtr hwnd, int wMsg, int wParam, int lParam);
|
||||
public const int WM_SYSCOMMAND = 0x0112;
|
||||
public const int SC_MOVE = 0xF010;
|
||||
public const int HTCAPTION = 0x0002;
|
||||
public bool isFrmStateNormal = true;
|
||||
private void kryptonGroupBox1_MouseDown(object sender, MouseEventArgs e)
|
||||
{
|
||||
ReleaseCapture();
|
||||
SendMessage(this.Handle, WM_SYSCOMMAND, SC_MOVE + HTCAPTION, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
120
CleanMachineHMI/frmChild/frmPopupWarningMsg.resx
Normal file
120
CleanMachineHMI/frmChild/frmPopupWarningMsg.resx
Normal file
@@ -0,0 +1,120 @@
|
||||
<?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>
|
||||
102
CleanMachineHMI/frmChild/frmSetRoleMenuPermission.Designer.cs
generated
Normal file
102
CleanMachineHMI/frmChild/frmSetRoleMenuPermission.Designer.cs
generated
Normal file
@@ -0,0 +1,102 @@
|
||||
namespace CleanMachineHMI.frmChild
|
||||
{
|
||||
partial class frmSetRoleMenuPermission
|
||||
{
|
||||
/// <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.kryptonPanel1 = new ComponentFactory.Krypton.Toolkit.KryptonPanel();
|
||||
this.kbtn_Cancel = new ComponentFactory.Krypton.Toolkit.KryptonButton();
|
||||
this.kbtn_Confirm = new ComponentFactory.Krypton.Toolkit.KryptonButton();
|
||||
this.kryptonTreeView1 = new ComponentFactory.Krypton.Toolkit.KryptonTreeView();
|
||||
((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit();
|
||||
this.kryptonPanel1.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// kryptonPanel1
|
||||
//
|
||||
this.kryptonPanel1.Controls.Add(this.kbtn_Cancel);
|
||||
this.kryptonPanel1.Controls.Add(this.kbtn_Confirm);
|
||||
this.kryptonPanel1.Controls.Add(this.kryptonTreeView1);
|
||||
this.kryptonPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.kryptonPanel1.Location = new System.Drawing.Point(0, 0);
|
||||
this.kryptonPanel1.Name = "kryptonPanel1";
|
||||
this.kryptonPanel1.Size = new System.Drawing.Size(299, 614);
|
||||
this.kryptonPanel1.TabIndex = 0;
|
||||
//
|
||||
// kbtn_Cancel
|
||||
//
|
||||
this.kbtn_Cancel.Location = new System.Drawing.Point(175, 566);
|
||||
this.kbtn_Cancel.Name = "kbtn_Cancel";
|
||||
this.kbtn_Cancel.Size = new System.Drawing.Size(90, 39);
|
||||
this.kbtn_Cancel.TabIndex = 1;
|
||||
this.kbtn_Cancel.Values.Text = "取消";
|
||||
this.kbtn_Cancel.Click += new System.EventHandler(this.kbtn_Cancel_Click);
|
||||
//
|
||||
// kbtn_Confirm
|
||||
//
|
||||
this.kbtn_Confirm.Location = new System.Drawing.Point(29, 566);
|
||||
this.kbtn_Confirm.Name = "kbtn_Confirm";
|
||||
this.kbtn_Confirm.Size = new System.Drawing.Size(90, 39);
|
||||
this.kbtn_Confirm.TabIndex = 1;
|
||||
this.kbtn_Confirm.Values.Text = "确认";
|
||||
this.kbtn_Confirm.Click += new System.EventHandler(this.kbtn_Confirm_Click);
|
||||
//
|
||||
// kryptonTreeView1
|
||||
//
|
||||
this.kryptonTreeView1.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
this.kryptonTreeView1.Location = new System.Drawing.Point(0, 0);
|
||||
this.kryptonTreeView1.Name = "kryptonTreeView1";
|
||||
this.kryptonTreeView1.Size = new System.Drawing.Size(299, 557);
|
||||
this.kryptonTreeView1.TabIndex = 0;
|
||||
this.kryptonTreeView1.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.kryptonTreeView1_AfterSelect);
|
||||
//
|
||||
// frmSetRoleMenuPermission
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(299, 614);
|
||||
this.Controls.Add(this.kryptonPanel1);
|
||||
this.MaximizeBox = false;
|
||||
this.Name = "frmSetRoleMenuPermission";
|
||||
this.ShowIcon = false;
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||
this.Text = "frmSetRoleMenuPermission";
|
||||
this.Load += new System.EventHandler(this.frmSetRoleMenuPermission_Load);
|
||||
((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).EndInit();
|
||||
this.kryptonPanel1.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonPanel kryptonPanel1;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonTreeView kryptonTreeView1;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonButton kbtn_Cancel;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonButton kbtn_Confirm;
|
||||
}
|
||||
}
|
||||
232
CleanMachineHMI/frmChild/frmSetRoleMenuPermission.cs
Normal file
232
CleanMachineHMI/frmChild/frmSetRoleMenuPermission.cs
Normal file
@@ -0,0 +1,232 @@
|
||||
using CleanMachineHMI.Utils;
|
||||
using ComponentFactory.Krypton.Toolkit;
|
||||
using LeadDataBaseUtility;
|
||||
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;
|
||||
|
||||
namespace CleanMachineHMI.frmChild
|
||||
{
|
||||
public partial class frmSetRoleMenuPermission : KryptonForm
|
||||
{
|
||||
public frmSetRoleMenuPermission()
|
||||
{
|
||||
InitializeComponent();
|
||||
_InfoLanguageTextList = this.GetInfoLanguageText(GlobalHelper.LanguageCode);
|
||||
}
|
||||
private DataTable _InfoLanguageTextList;
|
||||
public string RoleId { get; set; }
|
||||
DataTable allMenuData = new DataTable();
|
||||
private void frmSetRoleMenuPermission_Load(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
this.SetFormControlText(GlobalHelper.LanguageCode);
|
||||
string sql = $@"SELECT * FROM SYS_MENU";
|
||||
allMenuData = LeadDbHelperSQLite.Query(sql).Tables[0];
|
||||
if (allMenuData != null && allMenuData.Rows.Count > 0)
|
||||
{
|
||||
DataRow[] drs = allMenuData.Select(" MENU_PID = '-1'");
|
||||
foreach (DataRow item in drs)
|
||||
{
|
||||
TreeNode tn = kryptonTreeView1.Nodes.Add(item["MENU_NAME"].ToString());
|
||||
DataRow[] drs1 = allMenuData.Select($" MENU_PID = '{item["MENU_ID"]}'");
|
||||
foreach (DataRow item1 in drs1)
|
||||
{
|
||||
tn.Nodes.Add(item1["MENU_NAME"].ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
kryptonTreeView1.ExpandAll();
|
||||
kryptonTreeView1.CheckBoxes = true;
|
||||
sql = $@"SELECT A.ROLE_ID,A.ROLE_CODE,A.ROLE_NAME,B.MENU_ID,C.MENU_CODE,C.MENU_NAME,C.MENU_URL,C.MENU_PID FROM SYS_ROLE A LEFT JOIN SYS_ROLE_MENU_PERMISSION B on A.ROLE_ID = B.ROLE_ID LEFT JOIN SYS_MENU C on B.MENU_ID = C.MENU_ID WHERE A.ROLE_ID = '{RoleId}'";
|
||||
|
||||
DataTable dt = LeadDbHelperSQLite.Query(sql).Tables[0];
|
||||
if (dt != null && dt.Rows.Count > 0)
|
||||
{
|
||||
for (int i = 0; i < kryptonTreeView1.Nodes.Count; i++)
|
||||
{
|
||||
string str = kryptonTreeView1.Nodes[i].Text;
|
||||
DataRow[] drs = dt.Select($" MENU_NAME = '{str}'");
|
||||
if (drs.Length > 0)
|
||||
{
|
||||
kryptonTreeView1.Nodes[i].Checked = true;
|
||||
}
|
||||
for (int j = 0; j < kryptonTreeView1.Nodes[i].Nodes.Count; j++)
|
||||
{
|
||||
string str1 = kryptonTreeView1.Nodes[i].Nodes[j].Text;
|
||||
DataRow[] drs1 = dt.Select($" MENU_NAME = '{str1}'");
|
||||
if (drs1.Length > 0)
|
||||
{
|
||||
kryptonTreeView1.Nodes[i].Nodes[j].Checked = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
kryptonTreeView1.Nodes[i].Nodes[j].Checked = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("角色菜单权限配置界面加载异常", "LoadEditFrmExp") + $":【{ex.Message}】!");
|
||||
}
|
||||
}
|
||||
|
||||
private void kryptonTreeView1_AfterSelect(object sender, TreeViewEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
TreeNode nd = e.Node;
|
||||
if (nd.Checked)
|
||||
{
|
||||
if (nd.Parent != null)//存在父节点
|
||||
{
|
||||
if (!nd.Parent.Checked)//当前选中节点存在父节点,选中子节点时,自动选中父节点
|
||||
{
|
||||
nd.Parent.Checked = true;
|
||||
}
|
||||
}
|
||||
else//不存在父节点,当前选中节点为父节点
|
||||
{
|
||||
bool b = true;
|
||||
foreach (TreeNode ite in nd.Nodes)
|
||||
{
|
||||
if (ite.Checked)
|
||||
{
|
||||
b = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (b)
|
||||
{
|
||||
//选中当前父节点下的所有子节点
|
||||
foreach (TreeNode item in nd.Nodes)
|
||||
{
|
||||
item.Checked = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (nd.Parent != null)//存在父节点
|
||||
{
|
||||
if (nd.Parent.Checked)//当前释放节点存在父节点,释放子节点时,根据父节点下是否还有选中的子节点,判断父节点是否同时释放
|
||||
{
|
||||
bool b = true;
|
||||
foreach (TreeNode item in nd.Parent.Nodes)
|
||||
{
|
||||
if (item.Checked)
|
||||
{
|
||||
b = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (b)
|
||||
{
|
||||
nd.Parent.Checked = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
else//不存在父节点,当前释放的节点为父节点
|
||||
{
|
||||
//释放当前父节点下的所有子节点
|
||||
foreach (TreeNode item in nd.Nodes)
|
||||
{
|
||||
item.Checked = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private void kbtn_Cancel_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
|
||||
private void kbtn_Confirm_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
for (int i = 0; i < kryptonTreeView1.Nodes.Count; i++)
|
||||
{
|
||||
bool ischeck = false;
|
||||
for (int j = 0; j < kryptonTreeView1.Nodes[i].Nodes.Count; j++)
|
||||
{
|
||||
string str1 = kryptonTreeView1.Nodes[i].Nodes[j].Text;
|
||||
if (!kryptonTreeView1.Nodes[i].Nodes[j].Checked)
|
||||
{
|
||||
DataRow[] drs = allMenuData.Select($" MENU_NAME = '{str1}'");
|
||||
if (drs.Length > 0)
|
||||
{
|
||||
allMenuData.Rows.Remove(drs[0]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ischeck = true;
|
||||
}
|
||||
}
|
||||
if (!ischeck)
|
||||
{
|
||||
string str = kryptonTreeView1.Nodes[i].Text;
|
||||
if (!kryptonTreeView1.Nodes[i].Checked)
|
||||
{
|
||||
DataRow[] drs = allMenuData.Select($" MENU_NAME = '{str}'");
|
||||
if (drs.Length > 0)
|
||||
{
|
||||
allMenuData.Rows.Remove(drs[0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (allMenuData.Rows.Count > 0)
|
||||
{
|
||||
string sqlDeleteOldData = $@"delete from SYS_ROLE_MENU_PERMISSION where ROLE_ID = '{RoleId}'";
|
||||
LeadDbHelperSQLite.ExecuteSql(sqlDeleteOldData);
|
||||
int rowSum = 0;
|
||||
foreach (DataRow item in allMenuData.Rows)
|
||||
{
|
||||
string sqlAddNewData = $@"INSERT INTO main.SYS_ROLE_MENU_PERMISSION (ROLE_ID, MENU_ID, CREATE_BY, CREATE_TIME, UPDATE_BY, UPDATE_TIME, DATA_VERSION, REMARKS1, REMARKS2, REMARKS3, REMARKS4, REMARKS5 ) VALUES ( '{RoleId}', '{item["MENU_ID"]}', '{GlobalHelper.UserInfo.USER_ID}', '2020-11-13 15:22:34', '{GlobalHelper.UserInfo.USER_ID}', '2020-11-13 15:22:34', 0, NULL, NULL, NULL, NULL, NULL );";
|
||||
rowSum += LeadDbHelperSQLite.ExecuteSql(sqlAddNewData);
|
||||
}
|
||||
if (rowSum > 0)
|
||||
{
|
||||
//KryptonMessageBox.Show("该角色菜单授权成功!");
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("该角色的菜单权限授权成功!", "EditSuccessInfo"));
|
||||
this.Close();
|
||||
}
|
||||
else
|
||||
{
|
||||
//KryptonMessageBox.Show("该角色菜单授权失败!");
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("该角色的菜单权限授权失败!", "EditFailInfo"));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//KryptonMessageBox.Show("未选择任何菜单项,无法配置权限。");
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("未选择任何菜单项,无法配置权限!", "EmptyMenuDataInfo"));
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("编辑角色的菜单权限授权异常", "EditRoleMenuPermissionExp") + $":【{ex.Message}】!");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
120
CleanMachineHMI/frmChild/frmSetRoleMenuPermission.resx
Normal file
120
CleanMachineHMI/frmChild/frmSetRoleMenuPermission.resx
Normal file
@@ -0,0 +1,120 @@
|
||||
<?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>
|
||||
166
CleanMachineHMI/frmChild/frmSwitchRunDirection.Designer.cs
generated
Normal file
166
CleanMachineHMI/frmChild/frmSwitchRunDirection.Designer.cs
generated
Normal file
@@ -0,0 +1,166 @@
|
||||
|
||||
namespace CleanMachineHMI.frmChild
|
||||
{
|
||||
partial class frmSwitchRunDirection
|
||||
{
|
||||
/// <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.kryptonPanel1 = new ComponentFactory.Krypton.Toolkit.KryptonPanel();
|
||||
this.kcmb_SwitchRunDirection = new ComponentFactory.Krypton.Toolkit.KryptonComboBox();
|
||||
this.ktb_CurrRunDirection = new ComponentFactory.Krypton.Toolkit.KryptonTextBox();
|
||||
this.lbCleanModeName = new ComponentFactory.Krypton.Toolkit.KryptonLabel();
|
||||
this.lbCleanModeCode = new ComponentFactory.Krypton.Toolkit.KryptonLabel();
|
||||
this.btnEdit = new ComponentFactory.Krypton.Toolkit.KryptonButton();
|
||||
this.btnAdd = new ComponentFactory.Krypton.Toolkit.KryptonButton();
|
||||
((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit();
|
||||
this.kryptonPanel1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.kcmb_SwitchRunDirection)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// kryptonPanel1
|
||||
//
|
||||
this.kryptonPanel1.Controls.Add(this.kcmb_SwitchRunDirection);
|
||||
this.kryptonPanel1.Controls.Add(this.ktb_CurrRunDirection);
|
||||
this.kryptonPanel1.Controls.Add(this.lbCleanModeName);
|
||||
this.kryptonPanel1.Controls.Add(this.lbCleanModeCode);
|
||||
this.kryptonPanel1.Controls.Add(this.btnEdit);
|
||||
this.kryptonPanel1.Controls.Add(this.btnAdd);
|
||||
this.kryptonPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.kryptonPanel1.Location = new System.Drawing.Point(0, 0);
|
||||
this.kryptonPanel1.Name = "kryptonPanel1";
|
||||
this.kryptonPanel1.Size = new System.Drawing.Size(289, 227);
|
||||
this.kryptonPanel1.TabIndex = 4;
|
||||
//
|
||||
// kcmb_SwitchRunDirection
|
||||
//
|
||||
this.kcmb_SwitchRunDirection.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.kcmb_SwitchRunDirection.DropDownWidth = 271;
|
||||
this.kcmb_SwitchRunDirection.Items.AddRange(new object[] {
|
||||
"请选择",
|
||||
"正方向",
|
||||
"反方向"});
|
||||
this.kcmb_SwitchRunDirection.Location = new System.Drawing.Point(21, 114);
|
||||
this.kcmb_SwitchRunDirection.Name = "kcmb_SwitchRunDirection";
|
||||
this.kcmb_SwitchRunDirection.Size = new System.Drawing.Size(250, 27);
|
||||
this.kcmb_SwitchRunDirection.StateCommon.ComboBox.Content.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.kcmb_SwitchRunDirection.TabIndex = 42;
|
||||
//
|
||||
// ktb_CurrRunDirection
|
||||
//
|
||||
this.ktb_CurrRunDirection.AlwaysActive = false;
|
||||
this.ktb_CurrRunDirection.Enabled = false;
|
||||
this.ktb_CurrRunDirection.Location = new System.Drawing.Point(21, 39);
|
||||
this.ktb_CurrRunDirection.Name = "ktb_CurrRunDirection";
|
||||
this.ktb_CurrRunDirection.PaletteMode = ComponentFactory.Krypton.Toolkit.PaletteMode.ProfessionalOffice2003;
|
||||
this.ktb_CurrRunDirection.Size = new System.Drawing.Size(250, 35);
|
||||
this.ktb_CurrRunDirection.StateActive.Border.Color1 = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(255)))));
|
||||
this.ktb_CurrRunDirection.StateActive.Border.DrawBorders = ((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders)((((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Top | ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Bottom)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Left)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Right)));
|
||||
this.ktb_CurrRunDirection.StateCommon.Border.DrawBorders = ((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders)((((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Top | ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Bottom)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Left)
|
||||
| ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Right)));
|
||||
this.ktb_CurrRunDirection.StateCommon.Border.GraphicsHint = ComponentFactory.Krypton.Toolkit.PaletteGraphicsHint.AntiAlias;
|
||||
this.ktb_CurrRunDirection.StateCommon.Border.Rounding = 4;
|
||||
this.ktb_CurrRunDirection.StateCommon.Border.Width = 2;
|
||||
this.ktb_CurrRunDirection.StateCommon.Content.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.ktb_CurrRunDirection.TabIndex = 38;
|
||||
//
|
||||
// lbCleanModeName
|
||||
//
|
||||
this.lbCleanModeName.LabelStyle = ComponentFactory.Krypton.Toolkit.LabelStyle.TitleControl;
|
||||
this.lbCleanModeName.Location = new System.Drawing.Point(20, 82);
|
||||
this.lbCleanModeName.Name = "lbCleanModeName";
|
||||
this.lbCleanModeName.Size = new System.Drawing.Size(115, 26);
|
||||
this.lbCleanModeName.StateCommon.ShortText.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.lbCleanModeName.TabIndex = 37;
|
||||
this.lbCleanModeName.Values.Text = "选择切换方向:";
|
||||
//
|
||||
// lbCleanModeCode
|
||||
//
|
||||
this.lbCleanModeCode.LabelStyle = ComponentFactory.Krypton.Toolkit.LabelStyle.TitleControl;
|
||||
this.lbCleanModeCode.Location = new System.Drawing.Point(20, 11);
|
||||
this.lbCleanModeCode.Name = "lbCleanModeCode";
|
||||
this.lbCleanModeCode.Size = new System.Drawing.Size(115, 26);
|
||||
this.lbCleanModeCode.StateCommon.ShortText.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.lbCleanModeCode.TabIndex = 36;
|
||||
this.lbCleanModeCode.Values.Text = "当前运行方向:";
|
||||
//
|
||||
// btnEdit
|
||||
//
|
||||
this.btnEdit.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.btnEdit.Location = new System.Drawing.Point(183, 166);
|
||||
this.btnEdit.Name = "btnEdit";
|
||||
this.btnEdit.Size = new System.Drawing.Size(82, 40);
|
||||
this.btnEdit.StateCommon.Content.ShortText.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.btnEdit.TabIndex = 35;
|
||||
this.btnEdit.Values.Text = "取消";
|
||||
this.btnEdit.Click += new System.EventHandler(this.btnEdit_Click);
|
||||
//
|
||||
// btnAdd
|
||||
//
|
||||
this.btnAdd.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.btnAdd.Location = new System.Drawing.Point(21, 166);
|
||||
this.btnAdd.Name = "btnAdd";
|
||||
this.btnAdd.Size = new System.Drawing.Size(82, 40);
|
||||
this.btnAdd.StateCommon.Content.ShortText.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.btnAdd.TabIndex = 34;
|
||||
this.btnAdd.Values.Text = "确认";
|
||||
this.btnAdd.Click += new System.EventHandler(this.btnAdd_Click);
|
||||
//
|
||||
// frmSwitchRunDirection
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(289, 227);
|
||||
this.Controls.Add(this.kryptonPanel1);
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "frmSwitchRunDirection";
|
||||
this.ShowIcon = false;
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||
this.Text = "frmSwitchRunDirection";
|
||||
this.Load += new System.EventHandler(this.frmSwitchRunDirection_Load);
|
||||
((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).EndInit();
|
||||
this.kryptonPanel1.ResumeLayout(false);
|
||||
this.kryptonPanel1.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.kcmb_SwitchRunDirection)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonPanel kryptonPanel1;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonTextBox ktb_CurrRunDirection;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonLabel lbCleanModeName;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonLabel lbCleanModeCode;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonButton btnEdit;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonButton btnAdd;
|
||||
private ComponentFactory.Krypton.Toolkit.KryptonComboBox kcmb_SwitchRunDirection;
|
||||
}
|
||||
}
|
||||
112
CleanMachineHMI/frmChild/frmSwitchRunDirection.cs
Normal file
112
CleanMachineHMI/frmChild/frmSwitchRunDirection.cs
Normal file
@@ -0,0 +1,112 @@
|
||||
using CleanMachineHMI.Utils;
|
||||
using ComponentFactory.Krypton.Toolkit;
|
||||
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.Web.UI.WebControls;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace CleanMachineHMI.frmChild
|
||||
{
|
||||
public partial class frmSwitchRunDirection : KryptonForm
|
||||
{
|
||||
public frmSwitchRunDirection()
|
||||
{
|
||||
InitializeComponent();
|
||||
_InfoLanguageTextList = this.GetInfoLanguageText(GlobalHelper.LanguageCode);
|
||||
}
|
||||
private DataTable _InfoLanguageTextList;
|
||||
|
||||
private void frmSwitchRunDirection_Load(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
this.SetFormControlText(GlobalHelper.LanguageCode);
|
||||
int directNum = Convert.ToInt32(PlcOperationHelper.Instance.ReadPlcItem("DischargeDirectionSelection", PlcItemTypeDesc.D));
|
||||
if (GlobalHelper.LanguageCode == "English")
|
||||
{
|
||||
if (directNum == 0)
|
||||
{
|
||||
ktb_CurrRunDirection.Text = "Positive direction";
|
||||
}
|
||||
else
|
||||
{
|
||||
ktb_CurrRunDirection.Text = "Negative direction";
|
||||
}
|
||||
kcmb_SwitchRunDirection.Items.Clear();
|
||||
kcmb_SwitchRunDirection.Items.Add(new ListItem
|
||||
{
|
||||
Value = "",
|
||||
Text = "Please Select",
|
||||
});
|
||||
kcmb_SwitchRunDirection.Items.Add(new ListItem
|
||||
{
|
||||
Value = "1",
|
||||
Text = "Positive direction",
|
||||
});
|
||||
kcmb_SwitchRunDirection.Items.Add(new ListItem
|
||||
{
|
||||
Value = "2",
|
||||
Text = "Negative direction",
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
if (directNum == 0)
|
||||
{
|
||||
ktb_CurrRunDirection.Text = "正方向";
|
||||
}
|
||||
else
|
||||
{
|
||||
ktb_CurrRunDirection.Text = "反方向";
|
||||
}
|
||||
}
|
||||
kcmb_SwitchRunDirection.SelectedIndex = 0;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("加载出料运行方向切换界面发生异常", "LoadSwitchRunDirectionExp") + $":【{ex.Message}】!");
|
||||
}
|
||||
}
|
||||
|
||||
private void btnAdd_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (kcmb_SwitchRunDirection.SelectedIndex == 0)
|
||||
{
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请选择切换方向!", "SelectSwitchDirectionInfo"));
|
||||
return;
|
||||
}
|
||||
if (!PlcOperationHelper.Instance.isConn)
|
||||
{
|
||||
KryptonMessageBox.Show("The PLC is disconnected and unable to operate the equipment.");
|
||||
return;
|
||||
}
|
||||
if (PlcOperationHelper.Instance.WritePlcItem("DischargeDirectionSelection", (kcmb_SwitchRunDirection.SelectedIndex - 1).ToString(), PlcItemTypeDesc.D))
|
||||
{
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("切换出料运行方向成功!", "SwitchDirectionSuccessInfo"));
|
||||
this.Close();
|
||||
}
|
||||
else
|
||||
{
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("切换出料运行方向失败!", "SwitchDirectionFailInfo"));
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("切换出料运行方向的函数发生异常", "SwitchRunDirectionExp") + $":【{ex.Message}】!");
|
||||
}
|
||||
}
|
||||
|
||||
private void btnEdit_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
120
CleanMachineHMI/frmChild/frmSwitchRunDirection.resx
Normal file
120
CleanMachineHMI/frmChild/frmSwitchRunDirection.resx
Normal file
@@ -0,0 +1,120 @@
|
||||
<?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>
|
||||
Reference in New Issue
Block a user