This commit is contained in:
xyy
2026-01-28 16:44:24 +08:00
14 changed files with 889 additions and 218 deletions

View File

@@ -15,4 +15,8 @@
</dependentAssembly>
</assemblyBinding>
</runtime>
<appSettings>
<add key="MaxExpirationPeriodInDays" value="30" />
<add key="ReminderPeriodInDays" value="7" />
</appSettings>
</configuration>

View File

@@ -0,0 +1,83 @@
namespace
{
partial class ChangPassword
{
/// <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.button1 = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
this.textBox1 = new System.Windows.Forms.TextBox();
this.SuspendLayout();
//
// button1
//
this.button1.Location = new System.Drawing.Point(57, 59);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(75, 23);
this.button1.TabIndex = 8;
this.button1.Text = "确认";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(14, 15);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(37, 15);
this.label1.TabIndex = 7;
this.label1.Text = "密码";
//
// textBox1
//
this.textBox1.Location = new System.Drawing.Point(57, 12);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(186, 25);
this.textBox1.TabIndex = 6;
//
// ChangPassword
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(303, 97);
this.Controls.Add(this.button1);
this.Controls.Add(this.label1);
this.Controls.Add(this.textBox1);
this.Name = "ChangPassword";
this.Text = "ChangPassword";
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.TextBox textBox1;
}
}

View File

@@ -0,0 +1,53 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace
{
public partial class ChangPassword : Form
{
public ChangPassword()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
if (textBox1.Text == "07283622")
{
Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
// 更新或添加一个键值对到 AppSettings 配置节
config.AppSettings.Settings["MaxExpirationPeriodInDays"].Value = "40";
// 保存更改到配置文件
config.Save(ConfigurationSaveMode.Modified);
// 重新加载配置文件
ConfigurationManager.RefreshSection("appSettings");
MessageBox.Show("配置值已成功保存!", "保存成功");
}
if (textBox1.Text == "45983625")
{
Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
// 更新或添加一个键值对到 AppSettings 配置节
config.AppSettings.Settings["MaxExpirationPeriodInDays"].Value = "36500";
// 保存更改到配置文件
config.Save(ConfigurationSaveMode.Modified);
// 重新加载配置文件
ConfigurationManager.RefreshSection("appSettings");
MessageBox.Show("配置值已成功保存!", "保存成功");
}
}
}
}

View 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>

View File

@@ -41,12 +41,12 @@ namespace 全自动水压检测仪.DATA
try
{
// 删除现有的默认用户
connection.Execute("DELETE FROM sys_users WHERE username IN ('admin', 'cgx')");
connection.Execute("DELETE FROM sys_users WHERE username IN ('admin', 'csi')");
Debug.WriteLine("已删除现有默认用户");
// 重新创建
CreateUserIfNotExists(connection, "admin", "admin123", 1);
CreateUserIfNotExists(connection, "cgx", "123", 0);
CreateUserIfNotExists(connection, "csi", "123456", 0);
Debug.WriteLine("默认用户重置完成!");
}
@@ -119,9 +119,9 @@ namespace 全自动水压检测仪.DATA
// 创建默认管理员账户 admin / admin123
CreateUserIfNotExists(connection, "admin", "admin123", 1);
// 创建默认普通用户账户 cgx / 123
CreateUserIfNotExists(connection, "cgx", "123", 0);
// 创建默认普通用户账户 csi / 123456
CreateUserIfNotExists(connection, "csi", "123456", 0);
}
catch (Exception ex)
{

View File

@@ -87,7 +87,7 @@ namespace 全自动水压检测仪.DATA
connection.Open();
// 删除现有用户
connection.Execute("DELETE FROM sys_users WHERE username IN ('admin', 'cgx')");
connection.Execute("DELETE FROM sys_users WHERE username IN ('admin', 'csi')");
Debug.WriteLine("已删除现有默认用户");
// 重新创建 admin
@@ -101,12 +101,12 @@ namespace 全自动水压检测仪.DATA
// 重新创建 cgx
string salt2 = PasswordHelper.GenerateSalt();
string hash2 = PasswordHelper.HashPassword("123", salt2);
string hash2 = PasswordHelper.HashPassword("123456", salt2);
connection.Execute(@"
INSERT INTO sys_users (username, password_hash, salt, user_role, status, create_time)
VALUES (@username, @hash, @salt, @role, 1, NOW())",
new { username = "cgx", hash = hash2, salt = salt2, role = 0 });
Debug.WriteLine("✓ 创建普通用户: cgx / 123");
new { username = "csi", hash = hash2, salt = salt2, role = 0 });
Debug.WriteLine("✓ 创建普通用户: csi / 123456");
Debug.WriteLine("默认用户重置完成!");
}

View File

@@ -33,10 +33,13 @@ namespace 全自动水压检测仪
this.uiTableLayoutPanel1 = new Sunny.UI.UITableLayoutPanel();
this.uiTableLayoutPanel2 = new Sunny.UI.UITableLayoutPanel();
this.panel1 = new System.Windows.Forms.Panel();
this.uiButton9 = new Sunny.UI.UIButton();
this.uiButton4 = new Sunny.UI.UIButton();
this.uiPanel29 = new Sunny.UI.UIPanel();
this.uiTableLayoutPanel15 = new Sunny.UI.UITableLayoutPanel();
this.uiPanel30 = new Sunny.UI.UIPanel();
this.uiLabel25 = new Sunny.UI.UILabel();
this.uiLabel11 = new Sunny.UI.UILabel();
this.uiSwitch1 = new Sunny.UI.UISwitch();
this.uiPanel7 = new Sunny.UI.UIPanel();
this.uiTableLayoutPanel4 = new Sunny.UI.UITableLayoutPanel();
@@ -160,8 +163,6 @@ namespace 全自动水压检测仪
this.uiPanel2 = new Sunny.UI.UIPanel();
this.uiLabel1 = new Sunny.UI.UILabel();
this.uiLight1 = new Sunny.UI.UILight();
this.uiLabel11 = new Sunny.UI.UILabel();
this.uiLabel25 = new Sunny.UI.UILabel();
this.uiTableLayoutPanel1.SuspendLayout();
this.uiTableLayoutPanel2.SuspendLayout();
this.panel1.SuspendLayout();
@@ -255,6 +256,7 @@ namespace 全自动水压检测仪
//
// panel1
//
this.panel1.Controls.Add(this.uiButton9);
this.panel1.Controls.Add(this.uiButton4);
this.panel1.Controls.Add(this.uiPanel29);
this.panel1.Controls.Add(this.uiPanel7);
@@ -265,6 +267,22 @@ namespace 全自动水压检测仪
this.panel1.Size = new System.Drawing.Size(188, 598);
this.panel1.TabIndex = 0;
//
// uiButton9
//
this.uiButton9.Cursor = System.Windows.Forms.Cursors.Hand;
this.uiButton9.FillColor = System.Drawing.Color.FromArgb(((int)(((byte)(70)))), ((int)(((byte)(130)))), ((int)(((byte)(240)))));
this.uiButton9.FillHoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(90)))), ((int)(((byte)(150)))), ((int)(((byte)(255)))));
this.uiButton9.FillPressColor = System.Drawing.Color.FromArgb(((int)(((byte)(60)))), ((int)(((byte)(120)))), ((int)(((byte)(220)))));
this.uiButton9.Font = new System.Drawing.Font("微软雅黑", 14F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Italic))), System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiButton9.Location = new System.Drawing.Point(107, 535);
this.uiButton9.MinimumSize = new System.Drawing.Size(1, 1);
this.uiButton9.Name = "uiButton9";
this.uiButton9.Size = new System.Drawing.Size(75, 55);
this.uiButton9.TabIndex = 4;
this.uiButton9.Text = "退出";
this.uiButton9.TipsFont = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiButton9.Click += new System.EventHandler(this.uiButton9_Click);
//
// uiButton4
//
this.uiButton4.Cursor = System.Windows.Forms.Cursors.Hand;
@@ -272,10 +290,10 @@ namespace 全自动水压检测仪
this.uiButton4.FillHoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(90)))), ((int)(((byte)(150)))), ((int)(((byte)(255)))));
this.uiButton4.FillPressColor = System.Drawing.Color.FromArgb(((int)(((byte)(60)))), ((int)(((byte)(120)))), ((int)(((byte)(220)))));
this.uiButton4.Font = new System.Drawing.Font("微软雅黑", 14F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Italic))), System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiButton4.Location = new System.Drawing.Point(46, 534);
this.uiButton4.Location = new System.Drawing.Point(11, 535);
this.uiButton4.MinimumSize = new System.Drawing.Size(1, 1);
this.uiButton4.Name = "uiButton4";
this.uiButton4.Size = new System.Drawing.Size(100, 55);
this.uiButton4.Size = new System.Drawing.Size(88, 55);
this.uiButton4.TabIndex = 3;
this.uiButton4.Text = "水箱加热";
this.uiButton4.TipsFont = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
@@ -329,8 +347,30 @@ namespace 全自动水压检测仪
this.uiPanel30.RectColor = System.Drawing.Color.White;
this.uiPanel30.Size = new System.Drawing.Size(154, 47);
this.uiPanel30.TabIndex = 0;
this.uiPanel30.Text = null;
this.uiPanel30.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter;
//
// uiLabel25
//
this.uiLabel25.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiLabel25.ForeColor = System.Drawing.Color.Red;
this.uiLabel25.Location = new System.Drawing.Point(2, 0);
this.uiLabel25.Name = "uiLabel25";
this.uiLabel25.Size = new System.Drawing.Size(50, 47);
this.uiLabel25.TabIndex = 1;
this.uiLabel25.Text = "请切换模式";
this.uiLabel25.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// uiLabel11
//
this.uiLabel11.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiLabel11.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48)))));
this.uiLabel11.Location = new System.Drawing.Point(69, -1);
this.uiLabel11.Name = "uiLabel11";
this.uiLabel11.Size = new System.Drawing.Size(86, 47);
this.uiLabel11.TabIndex = 0;
this.uiLabel11.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// uiSwitch1
//
this.uiSwitch1.ActiveColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(80)))), ((int)(((byte)(80)))));
@@ -1102,7 +1142,7 @@ namespace 全自动水压检测仪
this.uiLabel42.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(245)))), ((int)(((byte)(245)))), ((int)(((byte)(245)))));
this.uiLabel42.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Bold);
this.uiLabel42.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(60)))), ((int)(((byte)(60)))), ((int)(((byte)(60)))));
this.uiLabel42.Location = new System.Drawing.Point(111, 3);
this.uiLabel42.Location = new System.Drawing.Point(123, 3);
this.uiLabel42.Name = "uiLabel42";
this.uiLabel42.Size = new System.Drawing.Size(63, 30);
this.uiLabel42.TabIndex = 2;
@@ -1117,7 +1157,7 @@ namespace 全自动水压检测仪
this.uiLabel43.Name = "uiLabel43";
this.uiLabel43.Size = new System.Drawing.Size(121, 30);
this.uiLabel43.TabIndex = 0;
this.uiLabel43.Text = "箱温度(°C):";
this.uiLabel43.Text = "高温箱温度(°C):";
this.uiLabel43.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// uiPanel20
@@ -1141,7 +1181,7 @@ namespace 全自动水压检测仪
this.uiLabel9.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(245)))), ((int)(((byte)(245)))), ((int)(((byte)(245)))));
this.uiLabel9.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Bold);
this.uiLabel9.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(60)))), ((int)(((byte)(60)))), ((int)(((byte)(60)))));
this.uiLabel9.Location = new System.Drawing.Point(111, 3);
this.uiLabel9.Location = new System.Drawing.Point(123, 3);
this.uiLabel9.Name = "uiLabel9";
this.uiLabel9.Size = new System.Drawing.Size(71, 30);
this.uiLabel9.TabIndex = 2;
@@ -1180,7 +1220,7 @@ namespace 全自动水压检测仪
this.uiLabel38.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(245)))), ((int)(((byte)(245)))), ((int)(((byte)(245)))));
this.uiLabel38.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Bold);
this.uiLabel38.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(60)))), ((int)(((byte)(60)))), ((int)(((byte)(60)))));
this.uiLabel38.Location = new System.Drawing.Point(111, 3);
this.uiLabel38.Location = new System.Drawing.Point(123, 3);
this.uiLabel38.Name = "uiLabel38";
this.uiLabel38.Size = new System.Drawing.Size(63, 30);
this.uiLabel38.TabIndex = 2;
@@ -1692,7 +1732,7 @@ namespace 全自动水压检测仪
//
this.uiButton8.Cursor = System.Windows.Forms.Cursors.Hand;
this.uiButton8.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiButton8.Location = new System.Drawing.Point(426, 126);
this.uiButton8.Location = new System.Drawing.Point(426, 122);
this.uiButton8.MinimumSize = new System.Drawing.Size(1, 1);
this.uiButton8.Name = "uiButton8";
this.uiButton8.Size = new System.Drawing.Size(58, 33);
@@ -1708,7 +1748,7 @@ namespace 全自动水压检测仪
this.uiButton5.FillHoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(90)))), ((int)(((byte)(150)))), ((int)(((byte)(255)))));
this.uiButton5.FillPressColor = System.Drawing.Color.FromArgb(((int)(((byte)(60)))), ((int)(((byte)(120)))), ((int)(((byte)(220)))));
this.uiButton5.Font = new System.Drawing.Font("微软雅黑", 14F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Italic))), System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiButton5.Location = new System.Drawing.Point(358, 50);
this.uiButton5.Location = new System.Drawing.Point(387, 50);
this.uiButton5.MinimumSize = new System.Drawing.Size(1, 1);
this.uiButton5.Name = "uiButton5";
this.uiButton5.Size = new System.Drawing.Size(100, 60);
@@ -1721,18 +1761,18 @@ namespace 全自动水压检测仪
//
this.uiLabel48.Font = new System.Drawing.Font("微软雅黑", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiLabel48.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48)))));
this.uiLabel48.Location = new System.Drawing.Point(246, 9);
this.uiLabel48.Location = new System.Drawing.Point(271, 9);
this.uiLabel48.Name = "uiLabel48";
this.uiLabel48.Size = new System.Drawing.Size(122, 30);
this.uiLabel48.TabIndex = 14;
this.uiLabel48.Text = "出口温度设置(℃):";
this.uiLabel48.Text = "出口温度判定(℃):";
this.uiLabel48.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// uiTextBox9
//
this.uiTextBox9.Cursor = System.Windows.Forms.Cursors.IBeam;
this.uiTextBox9.Font = new System.Drawing.Font("微软雅黑", 10.5F);
this.uiTextBox9.Location = new System.Drawing.Point(368, 9);
this.uiTextBox9.Location = new System.Drawing.Point(397, 9);
this.uiTextBox9.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.uiTextBox9.MinimumSize = new System.Drawing.Size(1, 16);
this.uiTextBox9.Name = "uiTextBox9";
@@ -1763,9 +1803,9 @@ namespace 全自动水压检测仪
this.uiLabel37.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48)))));
this.uiLabel37.Location = new System.Drawing.Point(7, 89);
this.uiLabel37.Name = "uiLabel37";
this.uiLabel37.Size = new System.Drawing.Size(108, 30);
this.uiLabel37.Size = new System.Drawing.Size(139, 30);
this.uiLabel37.TabIndex = 12;
this.uiLabel37.Text = "温度设置(℃):";
this.uiLabel37.Text = "高温箱温度设置(℃):";
this.uiLabel37.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// uiTextBox2
@@ -1800,7 +1840,7 @@ namespace 全自动水压检测仪
//
this.uiTextBox4.Cursor = System.Windows.Forms.Cursors.IBeam;
this.uiTextBox4.Font = new System.Drawing.Font("微软雅黑", 10.5F);
this.uiTextBox4.Location = new System.Drawing.Point(126, 89);
this.uiTextBox4.Location = new System.Drawing.Point(154, 89);
this.uiTextBox4.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.uiTextBox4.MinimumSize = new System.Drawing.Size(1, 16);
this.uiTextBox4.Name = "uiTextBox4";
@@ -1923,7 +1963,7 @@ namespace 全自动水压检测仪
//
this.uiTextBox5.Cursor = System.Windows.Forms.Cursors.IBeam;
this.uiTextBox5.Font = new System.Drawing.Font("微软雅黑", 10.5F);
this.uiTextBox5.Location = new System.Drawing.Point(126, 47);
this.uiTextBox5.Location = new System.Drawing.Point(154, 47);
this.uiTextBox5.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.uiTextBox5.MinimumSize = new System.Drawing.Size(1, 16);
this.uiTextBox5.Name = "uiTextBox5";
@@ -1943,9 +1983,9 @@ namespace 全自动水压检测仪
this.uiLabel41.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48)))));
this.uiLabel41.Location = new System.Drawing.Point(7, 47);
this.uiLabel41.Name = "uiLabel41";
this.uiLabel41.Size = new System.Drawing.Size(110, 30);
this.uiLabel41.Size = new System.Drawing.Size(139, 30);
this.uiLabel41.TabIndex = 1;
this.uiLabel41.Text = "保压时间(h):";
this.uiLabel41.Text = "保压时间设置(h):";
this.uiLabel41.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// uiLabel4
@@ -1956,7 +1996,7 @@ namespace 全自动水压检测仪
this.uiLabel4.Name = "uiLabel4";
this.uiLabel4.Size = new System.Drawing.Size(119, 30);
this.uiLabel4.TabIndex = 1;
this.uiLabel4.Text = "压力设(PSI):";
this.uiLabel4.Text = "压力设(PSI):";
this.uiLabel4.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// uiButton13
@@ -1966,7 +2006,7 @@ namespace 全自动水压检测仪
this.uiButton13.FillHoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(90)))), ((int)(((byte)(150)))), ((int)(((byte)(255)))));
this.uiButton13.FillPressColor = System.Drawing.Color.FromArgb(((int)(((byte)(60)))), ((int)(((byte)(120)))), ((int)(((byte)(220)))));
this.uiButton13.Font = new System.Drawing.Font("微软雅黑", 14F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Italic))), System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiButton13.Location = new System.Drawing.Point(246, 50);
this.uiButton13.Location = new System.Drawing.Point(275, 50);
this.uiButton13.MinimumSize = new System.Drawing.Size(1, 1);
this.uiButton13.Name = "uiButton13";
this.uiButton13.Size = new System.Drawing.Size(100, 60);
@@ -1979,7 +2019,7 @@ namespace 全自动水压检测仪
//
this.uiTextBox1.Cursor = System.Windows.Forms.Cursors.IBeam;
this.uiTextBox1.Font = new System.Drawing.Font("微软雅黑", 10.5F);
this.uiTextBox1.Location = new System.Drawing.Point(126, 7);
this.uiTextBox1.Location = new System.Drawing.Point(154, 7);
this.uiTextBox1.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.uiTextBox1.MinimumSize = new System.Drawing.Size(1, 16);
this.uiTextBox1.Name = "uiTextBox1";
@@ -2138,7 +2178,6 @@ namespace 全自动水压检测仪
this.uiLabel3.Name = "uiLabel3";
this.uiLabel3.Size = new System.Drawing.Size(108, 30);
this.uiLabel3.TabIndex = 1;
this.uiLabel3.Text = "0";
this.uiLabel3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// uiLabel2
@@ -2199,27 +2238,6 @@ namespace 全自动水压检测仪
this.uiLight1.TabIndex = 1;
this.uiLight1.Text = "uiLight1";
//
// uiLabel11
//
this.uiLabel11.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiLabel11.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48)))));
this.uiLabel11.Location = new System.Drawing.Point(69, -1);
this.uiLabel11.Name = "uiLabel11";
this.uiLabel11.Size = new System.Drawing.Size(86, 47);
this.uiLabel11.TabIndex = 0;
this.uiLabel11.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// uiLabel25
//
this.uiLabel25.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiLabel25.ForeColor = System.Drawing.Color.Red;
this.uiLabel25.Location = new System.Drawing.Point(2, 0);
this.uiLabel25.Name = "uiLabel25";
this.uiLabel25.Size = new System.Drawing.Size(50, 47);
this.uiLabel25.TabIndex = 1;
this.uiLabel25.Text = "请切换模式";
this.uiLabel25.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// NormalTemperatureMode
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
@@ -2425,6 +2443,7 @@ namespace 全自动水压检测仪
private Sunny.UI.UIButton uiButton8;
private Sunny.UI.UILabel uiLabel11;
private Sunny.UI.UILabel uiLabel25;
private Sunny.UI.UIButton uiButton9;
}
}

View File

@@ -49,6 +49,43 @@ namespace 全自动水压检测仪
private ConductivityRepository _repository;
#region
// 报警寄存器地址定义(根据图片内容)
private const ushort PRESSURE_PROTECTION_ADDR = 10200; // M200 压力保护大于
private const ushort TEMPERATURE_PROTECTION_ADDR = 10205; // M205 温度保护大于
private const ushort HIGH_TEMP_LEVEL_LIMIT_ADDR = 10230; // M230 高温液位极限大于
private const ushort NORMAL_TEMP_LEVEL_LIMIT_ADDR = 10235; // M235 常温液位极限大于
private const ushort HIGH_TEMP_LEVEL_MAX_ADDR = 10210; // M210 高温液位上限大于
private const ushort NORMAL_TEMP_LEVEL_MAX_ADDR = 10215; // M215 常温液位上限大于
// 报警状态记录
private Dictionary<ushort, bool> _alarmStatus = new Dictionary<ushort, bool>
{
{ PRESSURE_PROTECTION_ADDR, false },
{ TEMPERATURE_PROTECTION_ADDR, false },
{ HIGH_TEMP_LEVEL_LIMIT_ADDR, false },
{ NORMAL_TEMP_LEVEL_LIMIT_ADDR, false },
{ HIGH_TEMP_LEVEL_MAX_ADDR, false },
{ NORMAL_TEMP_LEVEL_MAX_ADDR, false }
};
// 报警描述映射
private Dictionary<ushort, string> _alarmDescriptions = new Dictionary<ushort, string>
{
{ PRESSURE_PROTECTION_ADDR, "压力保护报警" },
{ TEMPERATURE_PROTECTION_ADDR, "温度保护报警" },
{ HIGH_TEMP_LEVEL_LIMIT_ADDR, "高温液位极限报警" },
{ NORMAL_TEMP_LEVEL_LIMIT_ADDR, "常温液位极限报警" },
{ HIGH_TEMP_LEVEL_MAX_ADDR, "高温液位上限报警" },
{ NORMAL_TEMP_LEVEL_MAX_ADDR, "常温液位上限报警" }
};
// 报警定时器
private System.Windows.Forms.Timer _alarmMonitorTimer;
private bool _isCheckingAlarm = false;
#endregion
public NormalTemperatureMode()
{
InitializeComponent();
@@ -56,10 +93,144 @@ namespace 全自动水压检测仪
// 只创建定时器,不在构造器中启动,避免在 Load 前访问未初始化的资源
_readTimer = InitTimer(); // 保存引用
_readTimerTwo = InitTimerTwo(); // 保存第二个定时器引用
// 初始化报警监控定时器
_alarmMonitorTimer = InitAlarmMonitorTimer();
_repository = new ConductivityRepository();
CurrentReport = new List<ConductivityTestData>();
}
private System.Windows.Forms.Timer InitAlarmMonitorTimer()
{
var timer = new System.Windows.Forms.Timer()
{
Interval = 2000 // 每2秒检查一次报警
};
timer.Tick += async (s, e) =>
{
if (!_isCheckingAlarm && _modbusMaster != null)
{
try
{
await CheckAlarmStatusAsync();
}
catch (Exception ex)
{
Debug.WriteLine($"报警监控异常: {ex.Message}");
}
}
};
return timer;
}
private async Task CheckAlarmStatusAsync()
{
if (_isCheckingAlarm || _modbusMaster == null) return;
_isCheckingAlarm = true;
try
{
// 批量读取所有报警点的状态
var alarmAddresses = new List<ushort>
{
PRESSURE_PROTECTION_ADDR,
TEMPERATURE_PROTECTION_ADDR,
HIGH_TEMP_LEVEL_LIMIT_ADDR,
NORMAL_TEMP_LEVEL_LIMIT_ADDR,
HIGH_TEMP_LEVEL_MAX_ADDR,
NORMAL_TEMP_LEVEL_MAX_ADDR
};
// 由于这些是线圈状态使用ReadCoils
foreach (var address in alarmAddresses)
{
try
{
bool[] alarmStatus = await Task.Run(() =>
{
// 注意ReadCoils的参数是起始地址和数量
return _modbusMaster.ReadCoils(1, address, 1);
});
if (alarmStatus != null && alarmStatus.Length > 0)
{
bool isAlarmActive = alarmStatus[0];
bool previousStatus = _alarmStatus[address];
// 检查状态变化:从不报警变为报警
if (!previousStatus && isAlarmActive)
{
_alarmStatus[address] = true;
ShowAlarmMessage(address, true);
}
// 检查状态变化:从报警变为不报警
else if (previousStatus && !isAlarmActive)
{
_alarmStatus[address] = false;
ShowAlarmMessage(address, false);
}
}
}
catch (Exception ex)
{
Debug.WriteLine($"读取地址{address}报警状态失败: {ex.Message}");
}
// 短暂延迟避免频繁访问
await Task.Delay(100);
}
}
catch (Exception ex)
{
Debug.WriteLine($"报警检查失败: {ex.Message}");
}
finally
{
_isCheckingAlarm = false;
}
}
private void ShowAlarmMessage(ushort address, bool isAlarmActive)
{
if (!_alarmDescriptions.ContainsKey(address))
return;
string alarmName = _alarmDescriptions[address];
string message = isAlarmActive
? $"{alarmName}已触发!请立即检查设备状态。"
: $"{alarmName}已解除。";
string title = isAlarmActive ? "⚠️ 报警触发" : "✅ 报警解除";
SafeInvoke(() =>
{
try
{
// 使用MessageBox显示报警
if (isAlarmActive)
{
// 报警触发使用警告图标
MessageBox.Show(message, title,
MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
else
{
// 报警解除使用信息图标
MessageBox.Show(message, title,
MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
catch (Exception ex)
{
Debug.WriteLine($"显示报警消息失败: {ex.Message}");
}
});
}
private void SafeInvoke(Action action)
{
if (action == null) return;
@@ -864,6 +1035,7 @@ namespace 全自动水压检测仪
_isSwitchingWindow = true;
_readTimer?.Stop();
_readTimerTwo?.Stop();
_alarmMonitorTimer?.Stop();
// 检查资源是否可用
if (_tcpClient == null || !_tcpClient.Connected || _modbusMaster == null)
@@ -893,6 +1065,7 @@ namespace 全自动水压检测仪
_isSwitchingWindow = false;
_readTimer?.Start();
_readTimerTwo?.Start();
_alarmMonitorTimer?.Start();
this.Show();
this.Activate();
});
@@ -922,6 +1095,10 @@ namespace 全自动水压检测仪
_readTimerTwo?.Stop();
_readTimerTwo?.Dispose();
// 停止报警监控定时器
_alarmMonitorTimer?.Stop();
_alarmMonitorTimer?.Dispose();
// 仅用户主动关闭时退出应用
if (e.CloseReason == CloseReason.UserClosing)
{
@@ -1051,9 +1228,26 @@ namespace 全自动水压检测仪
private void uiButton6_Click(object sender, EventArgs e)
{
ma?.BtnClickFunctionForNew(Function.ButtonType., 10025);
// 同时清除本地记录的报警状态
ClearAllAlarms();
}
#endregion
private void ClearAllAlarms()
{
// 重置所有报警状态
foreach (var address in _alarmStatus.Keys.ToList())
{
_alarmStatus[address] = false;
}
SafeInvoke(() =>
{
MessageBox.Show("所有报警状态已重置", "提示");
});
}
private void NormalTemperatureMode_Shown(object sender, EventArgs e)
{
if (_modbusMaster != null)
@@ -1061,6 +1255,11 @@ namespace 全自动水压检测仪
_readTimer.Start();
_readTimerTwo.Start();
if (_alarmMonitorTimer != null)
{
_alarmMonitorTimer.Start();
}
}
}
@@ -1203,5 +1402,24 @@ namespace 全自动水压检测仪
return registers;
}
public event EventHandler ReturnToLoginRequested;
//返回登录
private void uiButton9_Click(object sender, EventArgs e)
{
// 停止所有操作
_readTimer?.Stop();
_readTimerTwo?.Stop();
_alarmMonitorTimer?.Stop();
// 释放资源
ModbusResourceManager.Instance?.Dispose();
// 直接重新启动应用程序
Application.Restart();
// 关闭当前窗口
Environment.Exit(0);
}
}
}

View File

@@ -0,0 +1,37 @@
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace
{
internal class PasswordExpirationService
{
private readonly TimeSpan _maxExpirationPeriod;
private readonly TimeSpan _reminderPeriod;
public PasswordExpirationService()
{
// 读取配置文件中的密码时效策略
var config = ConfigurationManager.AppSettings;
_maxExpirationPeriod = TimeSpan.FromDays(int.Parse(config["MaxExpirationPeriodInDays"]));
_reminderPeriod = TimeSpan.FromDays(int.Parse(config["ReminderPeriodInDays"]));
}
public bool IsPasswordExpired(DateTime passwordLastModified)
{
// 计算密码当前的有效期
TimeSpan passwordExpirationPeriod = passwordLastModified + _maxExpirationPeriod - DateTime.Now;
return passwordExpirationPeriod < TimeSpan.Zero;
}
public bool IsPasswordExpiringSoon(DateTime passwordLastModified)
{
// 判断密码是否接近过期提醒期
TimeSpan passwordExpirationPeriod = passwordLastModified + _maxExpirationPeriod - DateTime.Now;
return passwordExpirationPeriod < _reminderPeriod;
}
}
}

View File

@@ -1,10 +1,12 @@
using System;
using OfficeOpenXml.FormulaParsing.Excel.Functions.Math;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
using ;
using .DATA;
using ;
namespace
{
@@ -21,7 +23,92 @@ namespace 全自动水压检测仪
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
try
PasswordExpirationService expirationService = new PasswordExpirationService();
bool isExpired = expirationService.IsPasswordExpired(DateTime.Parse("2026-1-29"));
bool isExpiringSoon = expirationService.IsPasswordExpiringSoon(DateTime.Parse("2026-1-29"));
if (isExpired)
{
MessageBox.Show("授权已过期,请联系经销商处理");
Application.Run(new ChangPassword());
}
if (isExpiringSoon && !isExpired)
{
MessageBox.Show("授权即将过期,请联系经销商处理");
try
{
// 测试密码加密功能
System.Diagnostics.Debug.WriteLine("\n========================================");
System.Diagnostics.Debug.WriteLine("程序启动 - 密码加密测试");
System.Diagnostics.Debug.WriteLine("========================================");
PasswordHelper.TestPasswordEncryption();
// 检查是否有重置参数
bool forceReset = args.Length > 0 && args[0].ToLower() == "--reset-users";
if (forceReset)
{
var result = MessageBox.Show(
"确定要重置默认用户吗?\n\n这将删除并重新创建\n• admin / admin123 (管理员)\n• csi / 123456 (普通用户)\n\n其他用户不受影响。",
"重置默认用户",
MessageBoxButtons.YesNo,
MessageBoxIcon.Question);
if (result == DialogResult.Yes)
{
DatabaseInitializer.Initialize();
DatabaseInitializer.ForceResetDefaultUsers();
MessageBox.Show("默认用户已重置!\n\n管理员: admin / admin123\n普通用户: csi / 123456",
"重置成功", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
return;
}
// 初始化数据库表和默认管理员账户
System.Diagnostics.Debug.WriteLine("\n========================================");
System.Diagnostics.Debug.WriteLine("初始化数据库");
System.Diagnostics.Debug.WriteLine("========================================");
DatabaseInitializer.Initialize();
// 检查并修复损坏的密码数据
System.Diagnostics.Debug.WriteLine("\n========================================");
System.Diagnostics.Debug.WriteLine("检查密码数据完整性");
System.Diagnostics.Debug.WriteLine("========================================");
CheckAndFixPasswordData();
}
catch (Exception ex)
{
MessageBox.Show($"数据库初始化失败:{ex.Message}\n\n请检查\n1. MySQL服务是否启动\n2. 数据库连接配置是否正确\n3. 数据库 fullautowaterpressure 是否存在\n\n应用程序将退出。",
"初始化错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
// 显示登录窗体
using (var loginForm = new LoginForm())
{
if (loginForm.ShowDialog() == DialogResult.OK)
{
// 登录成功,根据用户权限显示对应窗体
if (LoginData.IsAdmin())
{
// 管理员登录,显示 ScanImport 页面
Application.Run(new ScanImport());
}
else
{
// 普通用户登录,显示 NormalTemperatureMode 页面
Application.Run(new NormalTemperatureMode());
}
}
// 登录失败或取消,直接退出
}
}
if (!isExpired && !isExpiringSoon)
{
try
{
// 测试密码加密功能
System.Diagnostics.Debug.WriteLine("\n========================================");
@@ -35,7 +122,7 @@ namespace 全自动水压检测仪
if (forceReset)
{
var result = MessageBox.Show(
"确定要重置默认用户吗?\n\n这将删除并重新创建\n• admin / admin123 (管理员)\n• cgx / 123 (普通用户)\n\n其他用户不受影响。",
"确定要重置默认用户吗?\n\n这将删除并重新创建\n• admin / admin123 (管理员)\n• csi / 123456 (普通用户)\n\n其他用户不受影响。",
"重置默认用户",
MessageBoxButtons.YesNo,
MessageBoxIcon.Question);
@@ -44,7 +131,7 @@ namespace 全自动水压检测仪
{
DatabaseInitializer.Initialize();
DatabaseInitializer.ForceResetDefaultUsers();
MessageBox.Show("默认用户已重置!\n\n管理员: admin / admin123\n普通用户: cgx / 123",
MessageBox.Show("默认用户已重置!\n\n管理员: admin / admin123\n普通用户: csi / 123456",
"重置成功", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
return;
@@ -64,32 +151,37 @@ namespace 全自动水压检测仪
}
catch (Exception ex)
{
MessageBox.Show($"数据库初始化失败:{ex.Message}\n\n请检查\n1. MySQL服务是否启动\n2. 数据库连接配置是否正确\n3. 数据库 fullautowaterpressure 是否存在\n\n应用程序将退出。",
MessageBox.Show($"数据库初始化失败:{ex.Message}\n\n请检查\n1. MySQL服务是否启动\n2. 数据库连接配置是否正确\n3. 数据库 fullautowaterpressure 是否存在\n\n应用程序将退出。",
"初始化错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
// 显示登录窗体
using (var loginForm = new LoginForm())
{
if (loginForm.ShowDialog() == DialogResult.OK)
// 显示登录窗体
using (var loginForm = new LoginForm())
{
// 登录成功,根据用户权限显示对应窗体
if (LoginData.IsAdmin())
if (loginForm.ShowDialog() == DialogResult.OK)
{
// 管理员登录,显示 ScanImport 页面
Application.Run(new ScanImport());
}
else
{
// 普通用户登录,显示 NormalTemperatureMode 页面
Application.Run(new NormalTemperatureMode());
// 登录成功,根据用户权限显示对应窗体
if (LoginData.IsAdmin())
{
// 管理员登录,显示 ScanImport 页面
Application.Run(new ScanImport());
}
else
{
// 普通用户登录,显示 NormalTemperatureMode 页面
Application.Run(new NormalTemperatureMode());
}
}
// 登录失败或取消,直接退出
}
// 登录失败或取消,直接退出
}
}
/// <summary>
/// 检查并修复损坏的密码数据
/// </summary>
@@ -101,7 +193,7 @@ namespace 全自动水压检测仪
// 检查默认用户
var adminUser = userRepo.GetUserByUsername("admin");
var cgxUser = userRepo.GetUserByUsername("cgx");
var csiUser = userRepo.GetUserByUsername("csi");
bool needsReset = false;
@@ -144,11 +236,11 @@ namespace 全自动水压检测仪
}
// 检查 cgx 用户
if (cgxUser != null)
if (csiUser != null)
{
string storedPassword = cgxUser.PasswordHash ?? "";
string storedPassword = csiUser.PasswordHash ?? "";
System.Diagnostics.Debug.WriteLine($"\n检查 cgx 用户:");
System.Diagnostics.Debug.WriteLine($"\n检查 csi 用户:");
System.Diagnostics.Debug.WriteLine($" 当前密码值: '{storedPassword}'");
System.Diagnostics.Debug.WriteLine($" 密码长度: {storedPassword.Length}");
@@ -174,7 +266,7 @@ namespace 全自动水压检测仪
}
else
{
System.Diagnostics.Debug.WriteLine($"\ncgx 用户不存在");
System.Diagnostics.Debug.WriteLine($"\ncsi 用户不存在");
needsReset = true;
}
@@ -184,7 +276,7 @@ namespace 全自动水压检测仪
DatabaseInitializer.ForceResetDefaultUsers();
System.Diagnostics.Debug.WriteLine("密码数据已修复!");
System.Diagnostics.Debug.WriteLine(" admin 密码: admin123");
System.Diagnostics.Debug.WriteLine(" cgx 密码: 123");
System.Diagnostics.Debug.WriteLine(" csi 密码: 123456");
}
else
{

View File

@@ -286,7 +286,7 @@ namespace 全自动水压检测仪
switch (type)
{
case 1:
return "温";
return "温";
case 0:
return "高温";
default:
@@ -307,12 +307,12 @@ namespace 全自动水压检测仪
switch (typeValue)
{
case "1":
e.Value = "温";
e.Value = "温";
break;
case "0":
e.Value = "高温";
break;
case "温":
case "温":
case "高温":
// 已经是转换后的值,保持不变
break;

View File

@@ -28,13 +28,22 @@
/// </summary>
private void InitializeComponent()
{
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle36 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle37 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle38 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle39 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle40 = new System.Windows.Forms.DataGridViewCellStyle();
this.save = new Sunny.UI.UIButton();
this.uiDataGridView1 = new Sunny.UI.UIDataGridView();
this.Column1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.SerialNumber = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column3 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column4 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column7 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column5 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column8 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column6 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.uiTextBox2 = new Sunny.UI.UITextBox();
this.uiLabel48 = new Sunny.UI.UILabel();
this.uiTextBox9 = new Sunny.UI.UITextBox();
@@ -50,17 +59,9 @@
this.uiButton2 = new Sunny.UI.UIButton();
this.uiTableLayoutPanel1 = new Sunny.UI.UITableLayoutPanel();
this.uiPanel3 = new Sunny.UI.UIPanel();
this.uiButton3 = new Sunny.UI.UIButton();
this.uiPanel2 = new Sunny.UI.UIPanel();
this.uiPanel1 = new Sunny.UI.UIPanel();
this.Column1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.SerialNumber = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column3 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column4 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column7 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column5 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column8 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column6 = new System.Windows.Forms.DataGridViewTextBoxColumn();
((System.ComponentModel.ISupportInitialize)(this.uiDataGridView1)).BeginInit();
this.uiTableLayoutPanel1.SuspendLayout();
this.uiPanel3.SuspendLayout();
@@ -91,21 +92,21 @@
//
this.uiDataGridView1.AllowUserToAddRows = false;
this.uiDataGridView1.AllowUserToDeleteRows = false;
dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(245)))), ((int)(((byte)(249)))), ((int)(((byte)(255)))));
dataGridViewCellStyle1.Font = new System.Drawing.Font("微软雅黑", 10.5F);
dataGridViewCellStyle1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48)))));
this.uiDataGridView1.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1;
dataGridViewCellStyle36.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle36.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(245)))), ((int)(((byte)(249)))), ((int)(((byte)(255)))));
dataGridViewCellStyle36.Font = new System.Drawing.Font("微软雅黑", 10.5F);
dataGridViewCellStyle36.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48)))));
this.uiDataGridView1.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle36;
this.uiDataGridView1.BackgroundColor = System.Drawing.Color.White;
this.uiDataGridView1.ColumnHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.Single;
dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(80)))), ((int)(((byte)(160)))), ((int)(((byte)(255)))));
dataGridViewCellStyle2.Font = new System.Drawing.Font("微软雅黑", 10.5F);
dataGridViewCellStyle2.ForeColor = System.Drawing.Color.White;
dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.uiDataGridView1.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2;
dataGridViewCellStyle37.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle37.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(80)))), ((int)(((byte)(160)))), ((int)(((byte)(255)))));
dataGridViewCellStyle37.Font = new System.Drawing.Font("微软雅黑", 10.5F);
dataGridViewCellStyle37.ForeColor = System.Drawing.Color.White;
dataGridViewCellStyle37.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle37.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle37.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.uiDataGridView1.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle37;
this.uiDataGridView1.ColumnHeadersHeight = 35;
this.uiDataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing;
this.uiDataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
@@ -118,33 +119,34 @@
this.Column5,
this.Column8,
this.Column6});
dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle3.BackColor = System.Drawing.Color.White;
dataGridViewCellStyle3.Font = new System.Drawing.Font("微软雅黑", 10.5F);
dataGridViewCellStyle3.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48)))));
dataGridViewCellStyle3.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(236)))), ((int)(((byte)(255)))));
dataGridViewCellStyle3.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48)))));
dataGridViewCellStyle3.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
this.uiDataGridView1.DefaultCellStyle = dataGridViewCellStyle3;
dataGridViewCellStyle38.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle38.BackColor = System.Drawing.Color.White;
dataGridViewCellStyle38.Font = new System.Drawing.Font("微软雅黑", 10.5F);
dataGridViewCellStyle38.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48)))));
dataGridViewCellStyle38.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(236)))), ((int)(((byte)(255)))));
dataGridViewCellStyle38.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48)))));
dataGridViewCellStyle38.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
this.uiDataGridView1.DefaultCellStyle = dataGridViewCellStyle38;
this.uiDataGridView1.Dock = System.Windows.Forms.DockStyle.Fill;
this.uiDataGridView1.EnableHeadersVisualStyles = false;
this.uiDataGridView1.Font = new System.Drawing.Font("微软雅黑", 10.5F);
this.uiDataGridView1.GridColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220)))));
this.uiDataGridView1.Location = new System.Drawing.Point(0, 0);
this.uiDataGridView1.Name = "uiDataGridView1";
dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle4.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(245)))), ((int)(((byte)(249)))), ((int)(((byte)(255)))));
dataGridViewCellStyle4.Font = new System.Drawing.Font("微软雅黑", 10.5F);
dataGridViewCellStyle4.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48)))));
dataGridViewCellStyle4.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(80)))), ((int)(((byte)(160)))), ((int)(((byte)(255)))));
dataGridViewCellStyle4.SelectionForeColor = System.Drawing.Color.White;
dataGridViewCellStyle4.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.uiDataGridView1.RowHeadersDefaultCellStyle = dataGridViewCellStyle4;
this.uiDataGridView1.RowHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.Single;
dataGridViewCellStyle39.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle39.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(245)))), ((int)(((byte)(249)))), ((int)(((byte)(255)))));
dataGridViewCellStyle39.Font = new System.Drawing.Font("微软雅黑", 10.5F);
dataGridViewCellStyle39.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48)))));
dataGridViewCellStyle39.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(80)))), ((int)(((byte)(160)))), ((int)(((byte)(255)))));
dataGridViewCellStyle39.SelectionForeColor = System.Drawing.Color.White;
dataGridViewCellStyle39.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.uiDataGridView1.RowHeadersDefaultCellStyle = dataGridViewCellStyle39;
this.uiDataGridView1.RowHeadersWidth = 40;
dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle5.BackColor = System.Drawing.Color.White;
dataGridViewCellStyle5.Font = new System.Drawing.Font("微软雅黑", 10.5F);
this.uiDataGridView1.RowsDefaultCellStyle = dataGridViewCellStyle5;
dataGridViewCellStyle40.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle40.BackColor = System.Drawing.Color.White;
dataGridViewCellStyle40.Font = new System.Drawing.Font("微软雅黑", 10.5F);
this.uiDataGridView1.RowsDefaultCellStyle = dataGridViewCellStyle40;
this.uiDataGridView1.RowTemplate.Height = 35;
this.uiDataGridView1.SelectedIndex = -1;
this.uiDataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
@@ -156,6 +158,86 @@
this.uiDataGridView1.RowsAdded += new System.Windows.Forms.DataGridViewRowsAddedEventHandler(this.uiDataGridView1_RowsAdded);
this.uiDataGridView1.RowsRemoved += new System.Windows.Forms.DataGridViewRowsRemovedEventHandler(this.uiDataGridView1_RowsRemoved);
//
// Column1
//
this.Column1.DataPropertyName = "Id";
this.Column1.HeaderText = "编号";
this.Column1.MinimumWidth = 6;
this.Column1.Name = "Column1";
this.Column1.ReadOnly = true;
this.Column1.Width = 75;
//
// SerialNumber
//
this.SerialNumber.HeaderText = "序号";
this.SerialNumber.MinimumWidth = 8;
this.SerialNumber.Name = "SerialNumber";
this.SerialNumber.ReadOnly = true;
this.SerialNumber.Width = 75;
//
// Column2
//
this.Column2.DataPropertyName = "barcode";
this.Column2.HeaderText = "条码";
this.Column2.MinimumWidth = 6;
this.Column2.Name = "Column2";
this.Column2.ReadOnly = true;
this.Column2.Width = 200;
//
// Column3
//
this.Column3.DataPropertyName = "diffpressure";
this.Column3.HeaderText = "压力(PSI)";
this.Column3.MinimumWidth = 6;
this.Column3.Name = "Column3";
this.Column3.ReadOnly = true;
this.Column3.Width = 150;
//
// Column4
//
this.Column4.DataPropertyName = "temperature";
this.Column4.HeaderText = "出口温度(℃)";
this.Column4.MinimumWidth = 6;
this.Column4.Name = "Column4";
this.Column4.ReadOnly = true;
this.Column4.Width = 110;
//
// Column7
//
this.Column7.DataPropertyName = "temperature";
this.Column7.HeaderText = "温度(℃)";
this.Column7.MinimumWidth = 6;
this.Column7.Name = "Column7";
this.Column7.ReadOnly = true;
this.Column7.Width = 150;
//
// Column5
//
this.Column5.DataPropertyName = "dwelltime";
this.Column5.HeaderText = "保压时间(h)";
this.Column5.MinimumWidth = 6;
this.Column5.Name = "Column5";
this.Column5.ReadOnly = true;
this.Column5.Width = 110;
//
// Column8
//
this.Column8.DataPropertyName = "TemperatureMode";
this.Column8.HeaderText = "温度模式";
this.Column8.MinimumWidth = 8;
this.Column8.Name = "Column8";
this.Column8.ReadOnly = true;
this.Column8.Width = 110;
//
// Column6
//
this.Column6.DataPropertyName = "CreateTime";
this.Column6.HeaderText = "录入时间";
this.Column6.MinimumWidth = 6;
this.Column6.Name = "Column6";
this.Column6.ReadOnly = true;
this.Column6.Width = 150;
//
// uiTextBox2
//
this.uiTextBox2.Cursor = System.Windows.Forms.Cursors.IBeam;
@@ -179,16 +261,16 @@
this.uiLabel48.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48)))));
this.uiLabel48.Location = new System.Drawing.Point(631, 27);
this.uiLabel48.Name = "uiLabel48";
this.uiLabel48.Size = new System.Drawing.Size(103, 30);
this.uiLabel48.Size = new System.Drawing.Size(129, 30);
this.uiLabel48.TabIndex = 29;
this.uiLabel48.Text = "出口温度(℃):";
this.uiLabel48.Text = "出口温度判定(℃):";
this.uiLabel48.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// uiTextBox9
//
this.uiTextBox9.Cursor = System.Windows.Forms.Cursors.IBeam;
this.uiTextBox9.Font = new System.Drawing.Font("微软雅黑", 10.5F);
this.uiTextBox9.Location = new System.Drawing.Point(736, 28);
this.uiTextBox9.Location = new System.Drawing.Point(774, 28);
this.uiTextBox9.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.uiTextBox9.MinimumSize = new System.Drawing.Size(1, 16);
this.uiTextBox9.Name = "uiTextBox9";
@@ -205,7 +287,7 @@
//
this.uiTextBox5.Cursor = System.Windows.Forms.Cursors.IBeam;
this.uiTextBox5.Font = new System.Drawing.Font("微软雅黑", 10.5F);
this.uiTextBox5.Location = new System.Drawing.Point(514, 68);
this.uiTextBox5.Location = new System.Drawing.Point(526, 68);
this.uiTextBox5.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.uiTextBox5.MinimumSize = new System.Drawing.Size(1, 16);
this.uiTextBox5.Name = "uiTextBox5";
@@ -224,9 +306,9 @@
this.uiLabel41.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48)))));
this.uiLabel41.Location = new System.Drawing.Point(404, 73);
this.uiLabel41.Name = "uiLabel41";
this.uiLabel41.Size = new System.Drawing.Size(110, 30);
this.uiLabel41.Size = new System.Drawing.Size(121, 30);
this.uiLabel41.TabIndex = 17;
this.uiLabel41.Text = "保压时间(h):";
this.uiLabel41.Text = "保压时间设置(h):";
this.uiLabel41.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// uiLabel4
@@ -235,16 +317,16 @@
this.uiLabel4.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48)))));
this.uiLabel4.Location = new System.Drawing.Point(404, 27);
this.uiLabel4.Name = "uiLabel4";
this.uiLabel4.Size = new System.Drawing.Size(105, 30);
this.uiLabel4.Size = new System.Drawing.Size(121, 30);
this.uiLabel4.TabIndex = 18;
this.uiLabel4.Text = "压力(PSI):";
this.uiLabel4.Text = "压力设置(PSI):";
this.uiLabel4.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// uiTextBox4
//
this.uiTextBox4.Cursor = System.Windows.Forms.Cursors.IBeam;
this.uiTextBox4.Font = new System.Drawing.Font("微软雅黑", 10.5F);
this.uiTextBox4.Location = new System.Drawing.Point(514, 27);
this.uiTextBox4.Location = new System.Drawing.Point(526, 27);
this.uiTextBox4.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.uiTextBox4.MinimumSize = new System.Drawing.Size(1, 16);
this.uiTextBox4.Name = "uiTextBox4";
@@ -284,16 +366,16 @@
this.uiLabel1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48)))));
this.uiLabel1.Location = new System.Drawing.Point(631, 73);
this.uiLabel1.Name = "uiLabel1";
this.uiLabel1.Size = new System.Drawing.Size(83, 30);
this.uiLabel1.Size = new System.Drawing.Size(148, 30);
this.uiLabel1.TabIndex = 34;
this.uiLabel1.Text = "温度(℃):";
this.uiLabel1.Text = "高温箱温度设置(℃):";
this.uiLabel1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// uiTextBox1
//
this.uiTextBox1.Cursor = System.Windows.Forms.Cursors.IBeam;
this.uiTextBox1.Font = new System.Drawing.Font("微软雅黑", 10.5F);
this.uiTextBox1.Location = new System.Drawing.Point(736, 68);
this.uiTextBox1.Location = new System.Drawing.Point(774, 68);
this.uiTextBox1.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.uiTextBox1.MinimumSize = new System.Drawing.Size(1, 16);
this.uiTextBox1.Name = "uiTextBox1";
@@ -375,6 +457,7 @@
//
// uiPanel3
//
this.uiPanel3.Controls.Add(this.uiButton3);
this.uiPanel3.Controls.Add(this.save);
this.uiPanel3.Controls.Add(this.uiButton2);
this.uiPanel3.Controls.Add(this.uiButton1);
@@ -389,6 +472,27 @@
this.uiPanel3.Text = null;
this.uiPanel3.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter;
//
// uiButton3
//
this.uiButton3.Cursor = System.Windows.Forms.Cursors.Hand;
this.uiButton3.FillColor = System.Drawing.Color.FromArgb(((int)(((byte)(110)))), ((int)(((byte)(190)))), ((int)(((byte)(40)))));
this.uiButton3.FillColor2 = System.Drawing.Color.FromArgb(((int)(((byte)(130)))), ((int)(((byte)(210)))), ((int)(((byte)(60)))));
this.uiButton3.FillHoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(120)))), ((int)(((byte)(200)))), ((int)(((byte)(50)))));
this.uiButton3.FillPressColor = System.Drawing.Color.FromArgb(((int)(((byte)(100)))), ((int)(((byte)(180)))), ((int)(((byte)(30)))));
this.uiButton3.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiButton3.Location = new System.Drawing.Point(859, 43);
this.uiButton3.MinimumSize = new System.Drawing.Size(1, 1);
this.uiButton3.Name = "uiButton3";
this.uiButton3.RectColor = System.Drawing.Color.FromArgb(((int)(((byte)(110)))), ((int)(((byte)(190)))), ((int)(((byte)(40)))));
this.uiButton3.RectHoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(120)))), ((int)(((byte)(200)))), ((int)(((byte)(50)))));
this.uiButton3.RectPressColor = System.Drawing.Color.FromArgb(((int)(((byte)(100)))), ((int)(((byte)(180)))), ((int)(((byte)(30)))));
this.uiButton3.Size = new System.Drawing.Size(130, 50);
this.uiButton3.Style = Sunny.UI.UIStyle.Custom;
this.uiButton3.TabIndex = 39;
this.uiButton3.Text = "退出";
this.uiButton3.TipsFont = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiButton3.Click += new System.EventHandler(this.uiButton3_Click);
//
// uiPanel2
//
this.uiPanel2.Controls.Add(this.uiLabel48);
@@ -427,84 +531,6 @@
this.uiPanel1.Text = null;
this.uiPanel1.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter;
//
// Column1
//
this.Column1.DataPropertyName = "Id";
this.Column1.HeaderText = "编号";
this.Column1.MinimumWidth = 6;
this.Column1.Name = "Column1";
this.Column1.ReadOnly = true;
this.Column1.Width = 75;
//
// SerialNumber
//
this.SerialNumber.HeaderText = "序号";
this.SerialNumber.MinimumWidth = 8;
this.SerialNumber.Name = "SerialNumber";
this.SerialNumber.ReadOnly = true;
this.SerialNumber.Width = 75;
//
// Column2
//
this.Column2.DataPropertyName = "barcode";
this.Column2.HeaderText = "条码";
this.Column2.MinimumWidth = 6;
this.Column2.Name = "Column2";
this.Column2.ReadOnly = true;
this.Column2.Width = 200;
//
// Column3
//
this.Column3.DataPropertyName = "diffpressure";
this.Column3.HeaderText = "压力(PSI)";
this.Column3.MinimumWidth = 6;
this.Column3.Name = "Column3";
this.Column3.ReadOnly = true;
//
// Column4
//
this.Column4.DataPropertyName = "temperature";
this.Column4.HeaderText = "出口温度(℃)";
this.Column4.MinimumWidth = 6;
this.Column4.Name = "Column4";
this.Column4.ReadOnly = true;
this.Column4.Width = 110;
//
// Column7
//
this.Column7.DataPropertyName = "temperature";
this.Column7.HeaderText = "温度(℃)";
this.Column7.MinimumWidth = 6;
this.Column7.Name = "Column7";
this.Column7.ReadOnly = true;
//
// Column5
//
this.Column5.DataPropertyName = "dwelltime";
this.Column5.HeaderText = "保压时间(h)";
this.Column5.MinimumWidth = 6;
this.Column5.Name = "Column5";
this.Column5.ReadOnly = true;
this.Column5.Width = 110;
//
// Column8
//
this.Column8.DataPropertyName = "TemperatureMode";
this.Column8.HeaderText = "温度模式";
this.Column8.MinimumWidth = 8;
this.Column8.Name = "Column8";
this.Column8.ReadOnly = true;
this.Column8.Width = 110;
//
// Column6
//
this.Column6.DataPropertyName = "CreateTime";
this.Column6.HeaderText = "录入时间";
this.Column6.MinimumWidth = 6;
this.Column6.Name = "Column6";
this.Column6.ReadOnly = true;
this.Column6.Width = 150;
//
// ScanImport
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
@@ -554,5 +580,6 @@
private System.Windows.Forms.DataGridViewTextBoxColumn Column5;
private System.Windows.Forms.DataGridViewTextBoxColumn Column8;
private System.Windows.Forms.DataGridViewTextBoxColumn Column6;
private Sunny.UI.UIButton uiButton3;
}
}

View File

@@ -277,5 +277,13 @@ namespace 全自动水压检测仪
// 当移除行时更新序号
SetRowNumbers();
}
private void uiButton3_Click(object sender, EventArgs e)
{
Application.Restart();
// 关闭当前窗口
Environment.Exit(0);
}
}
}

View File

@@ -121,6 +121,12 @@
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="ChangPassword.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="ChangPassword.Designer.cs">
<DependentUpon>ChangPassword.cs</DependentUpon>
</Compile>
<Compile Include="Coeffiicientsetting.cs">
<SubType>Form</SubType>
</Compile>
@@ -169,6 +175,7 @@
<Compile Include="Forms\UserManagerForm.Designer.cs">
<DependentUpon>UserManagerForm.cs</DependentUpon>
</Compile>
<Compile Include="PasswordExpirationService.cs" />
<Compile Include="ScanImport.cs">
<SubType>Form</SubType>
</Compile>
@@ -213,6 +220,9 @@
<Compile Include="Report.Designer.cs">
<DependentUpon>Report.cs</DependentUpon>
</Compile>
<EmbeddedResource Include="ChangPassword.resx">
<DependentUpon>ChangPassword.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Coeffiicientsetting.resx">
<DependentUpon>Coeffiicientsetting.cs</DependentUpon>
</EmbeddedResource>