From 54ef796c5afa8d1ccb4b8b148d765f590b4de03a Mon Sep 17 00:00:00 2001 From: Roy Ben Shabat Date: Wed, 20 May 2020 17:46:21 +0300 Subject: Improved Gateway environments handling. --- .../Tango.MachineService.Gateway/Controllers/GatewayController.cs | 5 +++-- .../Web/Tango.MachineService.Gateway/DB/ENVIRONMENT.cs | 6 ++++++ .../Tango.MachineService.Gateway/DTO/EnvironmentConfiguration.cs | 1 + 3 files changed, 10 insertions(+), 2 deletions(-) (limited to 'Software/Visual_Studio/Web/Tango.MachineService.Gateway') diff --git a/Software/Visual_Studio/Web/Tango.MachineService.Gateway/Controllers/GatewayController.cs b/Software/Visual_Studio/Web/Tango.MachineService.Gateway/Controllers/GatewayController.cs index e3391cd5d..e393c7264 100644 --- a/Software/Visual_Studio/Web/Tango.MachineService.Gateway/Controllers/GatewayController.cs +++ b/Software/Visual_Studio/Web/Tango.MachineService.Gateway/Controllers/GatewayController.cs @@ -20,7 +20,7 @@ namespace Tango.MachineService.Gateway.Controllers using (GatewayDbContext db = GatewayDbContext.CreateDefault()) { - var envs = db.Environments.ToList(); + var envs = db.Environments.Where(x => x.Active).ToList(); foreach (var env in envs) { @@ -29,7 +29,8 @@ namespace Tango.MachineService.Gateway.Controllers ID = env.ID.ToString(), Name = env.Name, Description = env.Description, - MachineServiceAddress = env.MachineServiceAddress + MachineServiceAddress = env.MachineServiceAddress, + DisplayIndex = env.DisplayIndex }); } } diff --git a/Software/Visual_Studio/Web/Tango.MachineService.Gateway/DB/ENVIRONMENT.cs b/Software/Visual_Studio/Web/Tango.MachineService.Gateway/DB/ENVIRONMENT.cs index 66cd2ff0c..7ab5bddbc 100644 --- a/Software/Visual_Studio/Web/Tango.MachineService.Gateway/DB/ENVIRONMENT.cs +++ b/Software/Visual_Studio/Web/Tango.MachineService.Gateway/DB/ENVIRONMENT.cs @@ -20,5 +20,11 @@ namespace Tango.MachineService.Gateway.DB [Column("MACHINE_SERVICE_ADDRESS")] public String MachineServiceAddress { get; set; } + + [Column("DISPLAY_INDEX")] + public int DisplayIndex { get; set; } + + [Column("ACTIVE")] + public bool Active { get; set; } } } \ No newline at end of file diff --git a/Software/Visual_Studio/Web/Tango.MachineService.Gateway/DTO/EnvironmentConfiguration.cs b/Software/Visual_Studio/Web/Tango.MachineService.Gateway/DTO/EnvironmentConfiguration.cs index 0da9de5e5..25ba9ba3d 100644 --- a/Software/Visual_Studio/Web/Tango.MachineService.Gateway/DTO/EnvironmentConfiguration.cs +++ b/Software/Visual_Studio/Web/Tango.MachineService.Gateway/DTO/EnvironmentConfiguration.cs @@ -11,5 +11,6 @@ namespace Tango.MachineService.Gateway.DTO public String Name { get; set; } public String Description { get; set; } public String MachineServiceAddress { get; set; } + public int DisplayIndex { get; set; } } } \ No newline at end of file -- cgit v1.3.1