aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Tango.PPC.UI
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2019-01-21 13:53:00 +0200
committerRoy Ben-Shabat <Roy@Twine-s.com>2019-01-21 13:53:00 +0200
commit63579cee4493c4a8e3d64348d644fd2eecaca055 (patch)
treebc8e92b3a2751c5fe186ad9af08d88ad8fc02628 /Software/Visual_Studio/PPC/Tango.PPC.UI
parent1d69ae8399a8e2419af3c4391ea387f5180561c3 (diff)
downloadTango-63579cee4493c4a8e3d64348d644fd2eecaca055.tar.gz
Tango-63579cee4493c4a8e3d64348d644fd2eecaca055.zip
PPC v1.0.0
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI')
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/App.config81
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/MainWindow.xaml.cs2
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs2
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Properties/AssemblyInfo.cs2
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoadingViewVM.cs15
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest2
6 files changed, 19 insertions, 85 deletions
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/App.config b/Software/Visual_Studio/PPC/Tango.PPC.UI/App.config
index c4cbcdc32..330ca08df 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/App.config
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/App.config
@@ -9,86 +9,7 @@
</startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
- <dependentAssembly>
- <assemblyIdentity name="System.Collections.Immutable" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-1.2.2.0" newVersion="1.2.2.0" />
- </dependentAssembly>
- <dependentAssembly>
- <assemblyIdentity name="System.Reflection.Metadata" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-1.4.2.0" newVersion="1.4.2.0" />
- </dependentAssembly>
- <dependentAssembly>
- <assemblyIdentity name="System.IO.FileSystem" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
- </dependentAssembly>
- <dependentAssembly>
- <assemblyIdentity name="System.ValueTuple" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
- </dependentAssembly>
- <dependentAssembly>
- <assemblyIdentity name="System.IO.Compression" publicKeyToken="b77a5c561934e089" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-4.1.2.0" newVersion="4.1.2.0" />
- </dependentAssembly>
- <dependentAssembly>
- <assemblyIdentity name="System.IO.FileSystem.Primitives" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
- </dependentAssembly>
- <dependentAssembly>
- <assemblyIdentity name="System.Security.Cryptography.Primitives" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
- </dependentAssembly>
- <dependentAssembly>
- <assemblyIdentity name="System.Xml.XPath.XDocument" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
- </dependentAssembly>
- <dependentAssembly>
- <assemblyIdentity name="System.Console" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
- </dependentAssembly>
- <dependentAssembly>
- <assemblyIdentity name="System.Diagnostics.StackTrace" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
- </dependentAssembly>
- <dependentAssembly>
- <assemblyIdentity name="System.Reactive.Core" publicKeyToken="94bc3704cddfc263" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-3.0.3000.0" newVersion="3.0.3000.0" />
- </dependentAssembly>
- <dependentAssembly>
- <assemblyIdentity name="Microsoft.Data.Edm" publicKeyToken="31bf3856ad364e35" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-5.6.4.0" newVersion="5.6.4.0" />
- </dependentAssembly>
- <dependentAssembly>
- <assemblyIdentity name="Microsoft.Data.Services.Client" publicKeyToken="31bf3856ad364e35" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-5.6.4.0" newVersion="5.6.4.0" />
- </dependentAssembly>
- <dependentAssembly>
- <assemblyIdentity name="Microsoft.Data.OData" publicKeyToken="31bf3856ad364e35" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-5.6.4.0" newVersion="5.6.4.0" />
- </dependentAssembly>
- <dependentAssembly>
- <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
- </dependentAssembly>
- <dependentAssembly>
- <assemblyIdentity name="Microsoft.IdentityModel.Clients.ActiveDirectory" publicKeyToken="31bf3856ad364e35" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-3.19.8.16603" newVersion="3.19.8.16603" />
- </dependentAssembly>
- <dependentAssembly>
- <assemblyIdentity name="Microsoft.IdentityModel.Clients.ActiveDirectory.Platform" publicKeyToken="31bf3856ad364e35" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-3.19.8.16603" newVersion="3.19.8.16603" />
- </dependentAssembly>
- <dependentAssembly>
- <assemblyIdentity name="System.Web.Http" publicKeyToken="31bf3856ad364e35" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-5.2.2.0" newVersion="5.2.2.0" />
- </dependentAssembly>
- <dependentAssembly>
- <assemblyIdentity name="System.Net.Http.Formatting" publicKeyToken="31bf3856ad364e35" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-5.2.2.0" newVersion="5.2.2.0" />
- </dependentAssembly>
- <dependentAssembly>
- <assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-1.5.2.14234" newVersion="1.5.2.14234" />
- </dependentAssembly>
+
</assemblyBinding>
</runtime>
<entityFramework>
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/MainWindow.xaml.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/MainWindow.xaml.cs
index 302e401fb..765c792b1 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/MainWindow.xaml.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/MainWindow.xaml.cs
@@ -51,7 +51,7 @@ namespace Tango.PPC.UI
WindowStyle = WindowStyle.None;
ResizeMode = ResizeMode.NoResize;
WindowStartupLocation = WindowStartupLocation.Manual;
- Topmost = true; // sure?
+ Topmost = false; // sure?
Left = touch_screen.Bounds.Left;
Top = touch_screen.Bounds.Top;
Width = touch_screen.Bounds.Width;
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs
index 3916d6345..2929908cc 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs
@@ -172,7 +172,7 @@ namespace Tango.PPC.UI.PPCApplication
LogManager.Log("Initializing ObservablesStaticCollections...");
ObservablesStaticCollections.Instance.Initialize();
LogManager.Log("Loading machine from database...");
- _machine = new MachineBuilder(ObservablesContext.CreateDefault()).SetFirst().WithOrganization().WithConfiguration().Build();
+ _machine = new MachineBuilder(ObservablesContext.CreateDefault()).SetFirst().WithOrganization().WithConfiguration().WithSpools().Build();
}
initialized = true;
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Properties/AssemblyInfo.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Properties/AssemblyInfo.cs
index d4951edda..e9e31e73b 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Properties/AssemblyInfo.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Properties/AssemblyInfo.cs
@@ -8,4 +8,4 @@ using System.Windows;
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Tango PPC Application")]
-[assembly: AssemblyVersion("2.0.18.1608")]
+[assembly: AssemblyVersion("1.0.0.0")]
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoadingViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoadingViewVM.cs
index 516349a18..f926a0f4c 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoadingViewVM.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoadingViewVM.cs
@@ -21,6 +21,7 @@ using Tango.PPC.Jobs;
using Tango.SharedUI;
using System.Data.Entity;
using Tango.BL.Enumerations;
+using Tango.BL.Builders;
namespace Tango.PPC.UI.ViewModels
{
@@ -79,7 +80,19 @@ namespace Tango.PPC.UI.ViewModels
if (db.Users.Count() == 1 || machine.AutoLogin)
{
- var user = await db.Users.FirstAsync();
+ var user = await new UserBuilder(db).SetFirst().WithRolesAndPermissions().BuildAsync();
+
+ if (!user.HasRole(Roles.PPCUser))
+ {
+ var role = db.Roles.Single(x => x.Code == (int)Roles.PPCUser);
+ user.Roles.Add(role);
+ db.UsersRoles.Add(new BL.Entities.UsersRole()
+ {
+ User = user,
+ Role = role,
+ });
+ await db.SaveChangesAsync();
+ }
LogManager.Log($"Application started. Single user/Auto login detected ({user.Email}). Skipping LoginView...");
await AuthenticationProvider.Login(user.Email, user.Password, false);
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest b/Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest
index efc5f8179..d72e75011 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest
@@ -16,7 +16,7 @@
Remove this element if your application requires this virtualization for backwards
compatibility.
-->
- <!--<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />-->
+ <requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
</requestedPrivileges>
</security>
</trustInfo>