aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Web/Tango.MachineService
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2020-02-24 16:51:04 +0200
committerRoy Ben-Shabat <Roy@Twine-s.com>2020-02-24 16:51:04 +0200
commitefde98a69746f41c1055858142b1935955d82fb0 (patch)
tree6b317f70d8f0f89acd71529e3ca82c502b47475f /Software/Visual_Studio/Web/Tango.MachineService
parentddf4a6b20db496a512d4fe8ccd56c1ec7fed104a (diff)
downloadTango-efde98a69746f41c1055858142b1935955d82fb0.tar.gz
Tango-efde98a69746f41c1055858142b1935955d82fb0.zip
Implemented job runs reset on factory restore.
Diffstat (limited to 'Software/Visual_Studio/Web/Tango.MachineService')
-rw-r--r--Software/Visual_Studio/Web/Tango.MachineService/Controllers/PPCController.cs22
-rw-r--r--Software/Visual_Studio/Web/Tango.MachineService/Tango.MachineService.csproj15
-rw-r--r--Software/Visual_Studio/Web/Tango.MachineService/Web.config4
-rw-r--r--Software/Visual_Studio/Web/Tango.MachineService/packages.config3
4 files changed, 42 insertions, 2 deletions
diff --git a/Software/Visual_Studio/Web/Tango.MachineService/Controllers/PPCController.cs b/Software/Visual_Studio/Web/Tango.MachineService/Controllers/PPCController.cs
index b132a4c48..71e540dbf 100644
--- a/Software/Visual_Studio/Web/Tango.MachineService/Controllers/PPCController.cs
+++ b/Software/Visual_Studio/Web/Tango.MachineService/Controllers/PPCController.cs
@@ -24,6 +24,7 @@ using Tango.Web.ActiveDirectory;
using Tango.Core.Cryptography;
using Tango.MachineService.Filters;
using Tango.BL.DTO;
+using Z.EntityFramework.Plus;
namespace Tango.MachineService.Controllers
{
@@ -170,6 +171,27 @@ namespace Tango.MachineService.Controllers
Token = response.NotifyCompletedToken,
TangoUpdateGuid = tangoUpdate.Guid,
});
+
+ Task.Factory.StartNew(() =>
+ {
+ using (ObservablesContext b = ObservablesContextHelper.CreateContext())
+ {
+ //Reset Job Runs.
+ try
+ {
+ b.JobRuns.Where(x => x.MachineGuid == machine.Guid && x.IsSynchronized).Update(x => new JobRun() { IsSynchronized = false });
+ }
+ catch (Exception ex)
+ {
+ LogManager.Log(ex, $"Error resetting synchronized job runs for machine '{machine.SerialNumber}'.");
+ }
+
+ //Reset Events.
+ //b.MachinesEvents.Where(x => x.MachineGuid == machine.Guid).Update(x => new MachinesEvent() { IsSynchronized = false });
+ //Reset Jobs.
+ //b.Jobs.Where(x => x.MachineGuid == machine.Guid).Update(x => new Job() { IsSynchronized = false });
+ }
+ });
}
return response;
diff --git a/Software/Visual_Studio/Web/Tango.MachineService/Tango.MachineService.csproj b/Software/Visual_Studio/Web/Tango.MachineService/Tango.MachineService.csproj
index a05fee42f..ee5f3440e 100644
--- a/Software/Visual_Studio/Web/Tango.MachineService/Tango.MachineService.csproj
+++ b/Software/Visual_Studio/Web/Tango.MachineService/Tango.MachineService.csproj
@@ -274,6 +274,15 @@
<Private>True</Private>
<HintPath>..\..\packages\Antlr.3.4.1.9004\lib\Antlr3.Runtime.dll</HintPath>
</Reference>
+ <Reference Include="Z.EntityFramework.Extensions, Version=4.0.50.0, Culture=neutral, PublicKeyToken=59b66d028979105b, processorArchitecture=MSIL">
+ <HintPath>..\..\packages\Z.EntityFramework.Extensions.4.0.50\lib\net45\Z.EntityFramework.Extensions.dll</HintPath>
+ </Reference>
+ <Reference Include="Z.EntityFramework.Plus.EF6, Version=1.12.13.0, Culture=neutral, PublicKeyToken=59b66d028979105b, processorArchitecture=MSIL">
+ <HintPath>..\..\packages\Z.EntityFramework.Plus.EF6.1.12.13\lib\net45\Z.EntityFramework.Plus.EF6.dll</HintPath>
+ </Reference>
+ <Reference Include="Z.Expressions.Eval, Version=3.1.5.0, Culture=neutral, PublicKeyToken=59b66d028979105b, processorArchitecture=MSIL">
+ <HintPath>..\..\packages\Z.Expressions.Eval.3.1.5\lib\net45\Z.Expressions.Eval.dll</HintPath>
+ </Reference>
</ItemGroup>
<ItemGroup>
<Reference Include="Microsoft.ApplicationInsights">
@@ -370,7 +379,9 @@
</Content>
</ItemGroup>
<ItemGroup>
- <Content Include="packages.config" />
+ <Content Include="packages.config">
+ <SubType>Designer</SubType>
+ </Content>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\FSE\Tango.FSE.Web\Tango.FSE.Web.csproj">
@@ -461,7 +472,7 @@
<SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
</WebProjectProperties>
</FlavorProperties>
- <UserProperties BuildVersion_StartDate="2000/1/1" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" />
+ <UserProperties BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UseGlobalSettings="False" BuildVersion_StartDate="2000/1/1" />
</VisualStudio>
</ProjectExtensions>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
diff --git a/Software/Visual_Studio/Web/Tango.MachineService/Web.config b/Software/Visual_Studio/Web/Tango.MachineService/Web.config
index 85b89ec38..1da22f45b 100644
--- a/Software/Visual_Studio/Web/Tango.MachineService/Web.config
+++ b/Software/Visual_Studio/Web/Tango.MachineService/Web.config
@@ -185,6 +185,10 @@
<assemblyIdentity name="Microsoft.Owin" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
</dependentAssembly>
+ <dependentAssembly>
+ <assemblyIdentity name="Z.EntityFramework.Extensions" publicKeyToken="59b66d028979105b" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-4.0.50.0" newVersion="4.0.50.0" />
+ </dependentAssembly>
</assemblyBinding>
</runtime>
<system.codedom>
diff --git a/Software/Visual_Studio/Web/Tango.MachineService/packages.config b/Software/Visual_Studio/Web/Tango.MachineService/packages.config
index 54144fcea..599e31535 100644
--- a/Software/Visual_Studio/Web/Tango.MachineService/packages.config
+++ b/Software/Visual_Studio/Web/Tango.MachineService/packages.config
@@ -44,4 +44,7 @@
<package id="System.Data.SQLite.EF6" version="1.0.108.0" targetFramework="net46" />
<package id="System.Data.SQLite.Linq" version="1.0.108.0" targetFramework="net46" />
<package id="WebGrease" version="1.5.2" targetFramework="net45" />
+ <package id="Z.EntityFramework.Extensions" version="4.0.50" targetFramework="net461" />
+ <package id="Z.EntityFramework.Plus.EF6" version="1.12.13" targetFramework="net461" />
+ <package id="Z.Expressions.Eval" version="3.1.5" targetFramework="net461" />
</packages> \ No newline at end of file