参数管理 大于0 才开始跟新

dep
我叫锄头 10 months ago
parent 9f68524f3e
commit ebb9677066

@ -153,9 +153,14 @@ namespace Mesnac.Action.ChemicalWeighing.OliveEQSetting
foreach (var v in pressureSettingViews)
{
string sql =
$"update PressureSetting set LowLimit={v.LowLimit},HighLimit={v.HighLimit} where Id={v.Id}";
DBHelp.ExecuteNonQuery(sql);
if(v.LowLimit>0 || v.HighLimit > 0)
{
string sql =
$"update PressureSetting set LowLimit={v.LowLimit},HighLimit={v.HighLimit} where Id={v.Id}";
DBHelp.ExecuteNonQuery(sql);
}
}
DataTable table =
@ -182,9 +187,13 @@ namespace Mesnac.Action.ChemicalWeighing.OliveEQSetting
var views = ProportionalPlc.UpFromPlc();
foreach (var v in views)
{
string sql =
$"update ProportionalSetting set SV={v.SV},PV={v.PV} where Id={v.Id}";
DBHelp.ExecuteNonQuery(sql);
if(v.SV>0 || v.PV > 0)
{
string sql =
$"update ProportionalSetting set SV={v.SV},PV={v.PV} where Id={v.Id}";
DBHelp.ExecuteNonQuery(sql);
}
}
@ -211,9 +220,13 @@ namespace Mesnac.Action.ChemicalWeighing.OliveEQSetting
var views = WeightSettingPlc.UpFromPlc();
foreach (var v in views)
{
string sql =
$"update WeightSetting set LowWeight={v.LowWeight},HighWeight={v.HighWeight} where Id={v.Id}";
DBHelp.ExecuteNonQuery(sql);
if(v.LowWeight>0 || v.HighWeight > 0)
{
string sql =
$"update WeightSetting set LowWeight={v.LowWeight},HighWeight={v.HighWeight} where Id={v.Id}";
DBHelp.ExecuteNonQuery(sql);
}
}
DataTable table =
@ -238,9 +251,13 @@ namespace Mesnac.Action.ChemicalWeighing.OliveEQSetting
var view = ElectricalPlc.UpFromPlc();
foreach (var v in view)
{
string sql =
$"update ElectricalSetting set Speed={v.Speed} where Id={v.Id}";
DBHelp.ExecuteNonQuery(sql);
if (v.Speed > 0)
{
string sql =
$"update ElectricalSetting set Speed={v.Speed} where Id={v.Id}";
DBHelp.ExecuteNonQuery(sql);
}
}
DataTable table =
@ -264,9 +281,14 @@ namespace Mesnac.Action.ChemicalWeighing.OliveEQSetting
var view = MetagePlc.UpFromPlc();
foreach (var v in view)
{
string sql =
$"update MetageSetting set HighSpeed={v.HighSpeed},LowSpeed={v.LowSpeed},WeightSlow={v.WeightSlow},Precut={v.Precut},JogTime={v.JogTime} where Id={v.Id}";
DBHelp.ExecuteNonQuery(sql);
if(v.HighSpeed > 0 || v.LowSpeed>0 || v.WeightSlow>0 || v.Precut>0 || v.JogTime > 0)
{
string sql =
$"update MetageSetting set HighSpeed={v.HighSpeed},LowSpeed={v.LowSpeed}," +
$"WeightSlow={v.WeightSlow},Precut={v.Precut},JogTime={v.JogTime} where Id={v.Id}";
DBHelp.ExecuteNonQuery(sql);
}
}
DataTable table =

Loading…
Cancel
Save