工具表定模块 使用科学计数法
This commit is contained in:
@@ -233,9 +233,6 @@ namespace MesWork
|
||||
}
|
||||
|
||||
|
||||
// ====================================================================
|
||||
// 称重业务数据库方法(调用存储过程,统一 result/msg 返回格式)
|
||||
// ====================================================================
|
||||
|
||||
/// <summary>
|
||||
/// 根据订货号匹配工件管理规则,查询机型参数(加油量/抽油量/密度/残油量上下限)
|
||||
@@ -263,6 +260,52 @@ namespace MesWork
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询指定工位的工具标定配置。
|
||||
/// </summary>
|
||||
public static bool QueryToolCalibration(string opName, out string toolName, out string calibrationValue, out string formula, out string description, out string msg)
|
||||
{
|
||||
toolName = "";
|
||||
calibrationValue = "";
|
||||
formula = "";
|
||||
description = "";
|
||||
msg = "";
|
||||
|
||||
try
|
||||
{
|
||||
using (var conn = new SqlConnection(MesWorkForm.ConnectionString))
|
||||
using (var cmd = conn.CreateCommand())
|
||||
{
|
||||
cmd.CommandText = @"
|
||||
SELECT TOP 1 [工具名称], [重量标定], [计算公式], [说明]
|
||||
FROM [工具管理]
|
||||
WHERE [工位号] = @工位号
|
||||
ORDER BY [ID]";
|
||||
cmd.Parameters.Add(new SqlParameter("@工位号", opName ?? ""));
|
||||
conn.Open();
|
||||
using (var reader = cmd.ExecuteReader())
|
||||
{
|
||||
if (!reader.Read())
|
||||
{
|
||||
msg = $"未找到[{opName}]工具标定配置";
|
||||
return false;
|
||||
}
|
||||
|
||||
toolName = reader["工具名称"]?.ToString() ?? "";
|
||||
calibrationValue = reader["重量标定"]?.ToString() ?? "";
|
||||
formula = reader["计算公式"]?.ToString() ?? "";
|
||||
description = reader["说明"]?.ToString() ?? "";
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
msg = $"查询[{opName}]工具标定配置失败:{err.Message}";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 插入称重记录
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user