diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjDeliver/DeliverInitAction.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjDeliver/DeliverInitAction.cs index 73f565c..199eb01 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjDeliver/DeliverInitAction.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjDeliver/DeliverInitAction.cs @@ -247,25 +247,7 @@ namespace Mesnac.Action.ChemicalWeighing.LjDeliver private void Sss(Db2101LinEntity entity,int no) { var a = entity; - //开始中 - if (a.Start=true && a.End==false) - { - SuSong data = new SuSong(); - data.Start = 1; - data.No = no; - data.EndInfo = 0; - data.UpdateTime = DateTime.Now; - data.CreateTime = DateTime.Now; - data.Soure = a.Soure; - data.Model = a.model; - data.Destination = a.Get(); - data.Number = a.number; - data.Remark = "开始"; - - FreeDb.FreeSqlUnit.Instance.Insert(data).ExecuteAffrows(); - - - } + if (a.Start == true && a.End == false) { @@ -283,6 +265,22 @@ namespace Mesnac.Action.ChemicalWeighing.LjDeliver .Set(x => x.Remark == "运行中") .Where(x => x.Id == su.Id).ExecuteUpdated(); } + else + { + SuSong data = new SuSong(); + data.Start = 1; + data.No = no; + data.EndInfo = 0; + data.UpdateTime = DateTime.Now; + data.CreateTime = DateTime.Now; + data.Soure = a.Soure; + data.Model = a.model; + data.Destination = a.Get(); + data.Number = a.number; + data.Remark = "开始"; + + FreeDb.FreeSqlUnit.Instance.Insert(data).ExecuteAffrows(); + } } //结束 @@ -306,9 +304,11 @@ namespace Mesnac.Action.ChemicalWeighing.LjDeliver } SuSong su =FreeDb.FreeSqlUnit.Instance. - Queryable().Where(s => s.No == no) + Queryable(). + Where(s => s.No == no) .Where(x=>x.Start==1) - .Where(s => s.EndInfo==0).OrderByDescending(s => s.CreateTime).First(); + .Where(s => s.EndInfo==0). + OrderByDescending(s => s.CreateTime).First(); if (su != null) {