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