This commit is contained in:
xyy
2026-01-24 14:20:24 +08:00
parent c2beefc51a
commit 8cd9143a6b
4 changed files with 92 additions and 73 deletions

View File

@@ -65,6 +65,11 @@ namespace 材料热传导系数
/// </summary>
public double diffpressure { get; set; }
/// <summary>
/// 出口温度
/// </summary>
public double exit_temperature { get; set; }
/// <summary>
/// 温度
/// </summary>
@@ -123,9 +128,9 @@ namespace 材料热传导系数
{
connection.Open();
var sql = @"INSERT INTO scandata
(barcode,diffpressure,temperature, dwelltime,CreateTime)
(barcode,diffpressure,exit_temperature,temperature, dwelltime,CreateTime)
VALUES
(@barcode,@diffpressure, @temperature , @dwelltime ,CURRENT_TIMESTAMP)";
(@barcode,@diffpressure,@exit_temperature,@temperature , @dwelltime ,CURRENT_TIMESTAMP)";
connection.Execute(sql, data);
}
}

View File

@@ -35,12 +35,6 @@
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = 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.Column2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column3 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column4 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column5 = 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();
@@ -51,6 +45,13 @@
this.uiButton1 = new Sunny.UI.UIButton();
this.uiLabel1 = new Sunny.UI.UILabel();
this.uiTextBox1 = new Sunny.UI.UITextBox();
this.Column1 = 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.Column6 = new System.Windows.Forms.DataGridViewTextBoxColumn();
((System.ComponentModel.ISupportInitialize)(this.uiDataGridView1)).BeginInit();
this.SuspendLayout();
//
@@ -58,7 +59,7 @@
//
this.save.Cursor = System.Windows.Forms.Cursors.Hand;
this.save.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.save.Location = new System.Drawing.Point(521, 72);
this.save.Location = new System.Drawing.Point(870, 43);
this.save.MinimumSize = new System.Drawing.Size(1, 1);
this.save.Name = "save";
this.save.Size = new System.Drawing.Size(100, 35);
@@ -88,12 +89,13 @@
this.Column2,
this.Column3,
this.Column4,
this.Column7,
this.Column5,
this.Column6});
dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle3.BackColor = System.Drawing.SystemColors.Window;
dataGridViewCellStyle3.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle3.ForeColor = System.Drawing.SystemColors.ControlText;
dataGridViewCellStyle3.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48)))));
dataGridViewCellStyle3.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle3.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle3.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
@@ -101,7 +103,7 @@
this.uiDataGridView1.EnableHeadersVisualStyles = false;
this.uiDataGridView1.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiDataGridView1.GridColor = System.Drawing.Color.FromArgb(((int)(((byte)(80)))), ((int)(((byte)(160)))), ((int)(((byte)(255)))));
this.uiDataGridView1.Location = new System.Drawing.Point(12, 118);
this.uiDataGridView1.Location = new System.Drawing.Point(12, 125);
this.uiDataGridView1.Name = "uiDataGridView1";
dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle4.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(243)))), ((int)(((byte)(255)))));
@@ -117,58 +119,10 @@
this.uiDataGridView1.RowsDefaultCellStyle = dataGridViewCellStyle5;
this.uiDataGridView1.RowTemplate.Height = 27;
this.uiDataGridView1.SelectedIndex = -1;
this.uiDataGridView1.Size = new System.Drawing.Size(958, 556);
this.uiDataGridView1.Size = new System.Drawing.Size(958, 549);
this.uiDataGridView1.StripeOddColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(243)))), ((int)(((byte)(255)))));
this.uiDataGridView1.TabIndex = 1;
//
// Column1
//
this.Column1.DataPropertyName = "Id";
this.Column1.HeaderText = "序号";
this.Column1.MinimumWidth = 6;
this.Column1.Name = "Column1";
this.Column1.Width = 60;
//
// Column2
//
this.Column2.DataPropertyName = "barcode";
this.Column2.HeaderText = "条码";
this.Column2.MinimumWidth = 6;
this.Column2.Name = "Column2";
this.Column2.Width = 180;
//
// Column3
//
this.Column3.DataPropertyName = "diffpressure";
this.Column3.HeaderText = "压力";
this.Column3.MinimumWidth = 6;
this.Column3.Name = "Column3";
this.Column3.Width = 70;
//
// Column4
//
this.Column4.DataPropertyName = "temperature";
this.Column4.HeaderText = "进气温度";
this.Column4.MinimumWidth = 6;
this.Column4.Name = "Column4";
this.Column4.Width = 150;
//
// Column5
//
this.Column5.DataPropertyName = "dwelltime";
this.Column5.HeaderText = "保压时间";
this.Column5.MinimumWidth = 6;
this.Column5.Name = "Column5";
this.Column5.Width = 125;
//
// Column6
//
this.Column6.DataPropertyName = "CreateTime";
this.Column6.HeaderText = "录入时间";
this.Column6.MinimumWidth = 6;
this.Column6.Name = "Column6";
this.Column6.Width = 125;
//
// uiTextBox2
//
this.uiTextBox2.Cursor = System.Windows.Forms.Cursors.IBeam;
@@ -274,7 +228,7 @@
//
this.uiButton1.Cursor = System.Windows.Forms.Cursors.Hand;
this.uiButton1.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiButton1.Location = new System.Drawing.Point(419, 84);
this.uiButton1.Location = new System.Drawing.Point(870, 84);
this.uiButton1.MinimumSize = new System.Drawing.Size(1, 1);
this.uiButton1.Name = "uiButton1";
this.uiButton1.Size = new System.Drawing.Size(100, 35);
@@ -286,7 +240,7 @@
//
this.uiLabel1.Font = new System.Drawing.Font("微软雅黑", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiLabel1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48)))));
this.uiLabel1.Location = new System.Drawing.Point(517, 47);
this.uiLabel1.Location = new System.Drawing.Point(517, 84);
this.uiLabel1.Name = "uiLabel1";
this.uiLabel1.Size = new System.Drawing.Size(83, 30);
this.uiLabel1.TabIndex = 34;
@@ -297,7 +251,7 @@
//
this.uiTextBox1.Cursor = System.Windows.Forms.Cursors.IBeam;
this.uiTextBox1.Font = new System.Drawing.Font("微软雅黑", 10.5F);
this.uiTextBox1.Location = new System.Drawing.Point(708, 49);
this.uiTextBox1.Location = new System.Drawing.Point(708, 84);
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";
@@ -310,10 +264,65 @@
this.uiTextBox1.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter;
this.uiTextBox1.Watermark = "";
//
// Column1
//
this.Column1.DataPropertyName = "Id";
this.Column1.HeaderText = "序号";
this.Column1.MinimumWidth = 6;
this.Column1.Name = "Column1";
this.Column1.Width = 60;
//
// Column2
//
this.Column2.DataPropertyName = "barcode";
this.Column2.HeaderText = "条码";
this.Column2.MinimumWidth = 6;
this.Column2.Name = "Column2";
this.Column2.Width = 180;
//
// Column3
//
this.Column3.DataPropertyName = "diffpressure";
this.Column3.HeaderText = "压力";
this.Column3.MinimumWidth = 6;
this.Column3.Name = "Column3";
this.Column3.Width = 70;
//
// Column4
//
this.Column4.DataPropertyName = "temperature";
this.Column4.HeaderText = "出口温度";
this.Column4.MinimumWidth = 6;
this.Column4.Name = "Column4";
this.Column4.Width = 150;
//
// Column7
//
this.Column7.DataPropertyName = "temperature";
this.Column7.HeaderText = "温度";
this.Column7.MinimumWidth = 6;
this.Column7.Name = "Column7";
this.Column7.Width = 125;
//
// Column5
//
this.Column5.DataPropertyName = "dwelltime";
this.Column5.HeaderText = "保压时间";
this.Column5.MinimumWidth = 6;
this.Column5.Name = "Column5";
this.Column5.Width = 125;
//
// Column6
//
this.Column6.DataPropertyName = "CreateTime";
this.Column6.HeaderText = "录入时间";
this.Column6.MinimumWidth = 6;
this.Column6.Name = "Column6";
this.Column6.Width = 125;
//
// ScanImport
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.ClientSize = new System.Drawing.Size(982, 693);
this.Controls.Add(this.uiLabel1);
this.Controls.Add(this.uiTextBox1);
@@ -347,14 +356,15 @@
private Sunny.UI.UILabel uiLabel41;
private Sunny.UI.UILabel uiLabel4;
private Sunny.UI.UITextBox uiTextBox4;
private Sunny.UI.UIButton uiButton1;
private Sunny.UI.UILabel uiLabel1;
private Sunny.UI.UITextBox uiTextBox1;
private System.Windows.Forms.DataGridViewTextBoxColumn Column1;
private System.Windows.Forms.DataGridViewTextBoxColumn Column2;
private System.Windows.Forms.DataGridViewTextBoxColumn Column3;
private System.Windows.Forms.DataGridViewTextBoxColumn Column4;
private System.Windows.Forms.DataGridViewTextBoxColumn Column7;
private System.Windows.Forms.DataGridViewTextBoxColumn Column5;
private System.Windows.Forms.DataGridViewTextBoxColumn Column6;
private Sunny.UI.UIButton uiButton1;
private Sunny.UI.UILabel uiLabel1;
private Sunny.UI.UITextBox uiTextBox1;
}
}

View File

@@ -24,18 +24,19 @@ namespace 全自动水压检测仪
private void save_Click(object sender, EventArgs e)
{
double diffpressure = 0, temperature = 0, dwelltime = 0;
double diffpressure = 0, exit_temperature = 0, dwelltime = 0, temperature = 0;
double.TryParse(uiTextBox4.Text, out diffpressure);
double.TryParse(uiTextBox9.Text, out temperature);
double.TryParse(uiTextBox9.Text, out exit_temperature);
double.TryParse(uiTextBox5.Text, out dwelltime);
double.TryParse(uiTextBox1.Text, out temperature);
_repository.InsertScanItems(new ScanData
{
barcode = uiTextBox4.Text,
diffpressure = diffpressure,
temperature = temperature,
exit_temperature = exit_temperature,
dwelltime = dwelltime,
IsHighMode = temperature > 0
IsHighMode = temperature > 0,
temperature = temperature
});
LoadData();

View File

@@ -129,6 +129,9 @@
<metadata name="Column4.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column7.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column5.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>