aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2019-05-05 11:43:19 +0300
committerRoy Ben-Shabat <Roy@Twine-s.com>2019-05-05 11:43:19 +0300
commit9cc18084e2f9db73ce9e2820dfebcab4e50e5730 (patch)
tree7e8751d6796a34599adf4fd90964ac62c0ee1cc7 /Software/Visual_Studio
parenteda6e4979dbb722ce5f9412955f89388dfa2af3f (diff)
downloadTango-9cc18084e2f9db73ce9e2820dfebcab4e50e5730.tar.gz
Tango-9cc18084e2f9db73ce9e2820dfebcab4e50e5730.zip
MREGE.
Diffstat (limited to 'Software/Visual_Studio')
-rw-r--r--Software/Visual_Studio/Build/Shortcuts/Machine Studio.lnkbin1518 -> 1581 bytes
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/DeveloperModuleSettings.cs13
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs13
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml4
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/MachineStudioSettings.cs2
-rw-r--r--Software/Visual_Studio/TCC/Tango.TCC.BL/Entities/Device.cs6
-rw-r--r--Software/Visual_Studio/TCC/Tango.TCC.BL/Entities/TCCEntityBase.cs5
-rw-r--r--Software/Visual_Studio/TCC/Tango.TCC.BL/Web/DefinitionResponse.cs3
-rw-r--r--Software/Visual_Studio/TCC/Tango.TCC.Service/Controllers/ColorDetectionController.cs98
-rw-r--r--Software/Visual_Studio/TCC/Tango.TCC.Service/DB/TccDbContext.cs46
-rw-r--r--Software/Visual_Studio/TCC/Tango.TCC.Service/TCCServiceConfig.cs5
-rw-r--r--Software/Visual_Studio/TCC/Tango.TCC.Service/Tango.TCC.Service.csproj5
-rw-r--r--Software/Visual_Studio/TCC/Tango.TCC.Service/Web.config3
-rw-r--r--Software/Visual_Studio/Tango.Web/Helpers/ObservablesContextHelper.cs4
14 files changed, 184 insertions, 23 deletions
diff --git a/Software/Visual_Studio/Build/Shortcuts/Machine Studio.lnk b/Software/Visual_Studio/Build/Shortcuts/Machine Studio.lnk
index 793efc9e8..c6e1d0aed 100644
--- a/Software/Visual_Studio/Build/Shortcuts/Machine Studio.lnk
+++ b/Software/Visual_Studio/Build/Shortcuts/Machine Studio.lnk
Binary files differ
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/DeveloperModuleSettings.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/DeveloperModuleSettings.cs
index e6d5674e1..2099b12d9 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/DeveloperModuleSettings.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/DeveloperModuleSettings.cs
@@ -24,9 +24,22 @@ namespace Tango.MachineStudio.Developer
public String DefaultJobRmlGuid { get; set; }
+ /// <summary>
+ /// Gets or sets a value indicating whether to enable gradient generation.
+ /// </summary>
+ public bool EnableGradientGeneration { get; set; }
+
+ /// <summary>
+ /// Gets or sets the gradient resolution in centimeters.
+ /// </summary>
+ public int GradientResolutionCM { get; set; }
+
public DeveloperModuleSettings()
{
ProcessParametersIndices = new List<ParameterIndex>();
+
+ EnableGradientGeneration = true;
+ GradientResolutionCM = 500;
}
}
}
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs
index 4ce8ab39d..3f28c2cff 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs
@@ -552,6 +552,12 @@ namespace Tango.MachineStudio.Developer.ViewModels
public IAuthenticationProvider AuthenticationProvider { get; set; }
+ public DeveloperModuleSettings Settings
+ {
+ get { return _settings; }
+ set { _settings = value; RaisePropertyChangedAuto(); }
+ }
+
#endregion
#region Commands
@@ -783,7 +789,7 @@ namespace Tango.MachineStudio.Developer.ViewModels
public override void OnApplicationReady()
{
- _settings = SettingsManager.Default.GetOrCreate<DeveloperModuleSettings>();
+ Settings = SettingsManager.Default.GetOrCreate<DeveloperModuleSettings>();
SelectedJobs = new ObservableCollection<Job>();
JobEvents = new ObservableCollection<MachinesEvent>();
@@ -972,7 +978,7 @@ namespace Tango.MachineStudio.Developer.ViewModels
{
_preparingTaskItem = _notification.PushTaskItem("Preparing job for printing...");
}
- else if (percent == 100)
+ else if (percent == 100 && _preparingTaskItem != null)
{
_preparingTaskItem.Pop();
_preparingTaskItem = null;
@@ -1341,6 +1347,9 @@ namespace Tango.MachineStudio.Developer.ViewModels
IsFree = false;
LogManager.Log("Sending job to machine operator...");
+ MachineOperator.GradientGenerationConfiguration.IsEnabled = Settings.EnableGradientGeneration;
+ MachineOperator.GradientGenerationConfiguration.ResolutionCM = Settings.GradientResolutionCM;
+
if (resumeFunc == null)
{
JobHandler = await MachineOperator.Print(ActiveJob, SelectedProcessParametersTable);
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml
index a5d137e67..8a5ec94fa 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml
@@ -867,9 +867,9 @@
<DockPanel>
<StackPanel Orientation="Horizontal" DockPanel.Dock="Right" VerticalAlignment="Center" Margin="0 0 0 0">
<TextBlock VerticalAlignment="Center" Foreground="DimGray">Generate Gradient</TextBlock>
- <ToggleButton Margin="10 0 0 0" IsChecked="{Binding ApplicationManager.ConnectedMachine.GradientGenerationConfiguration.IsEnabled,Mode=TwoWay}" />
+ <ToggleButton Margin="10 0 0 0" IsChecked="{Binding Settings.EnableGradientGeneration,Mode=TwoWay}" />
<TextBlock Margin="10 0 0 0" VerticalAlignment="Center" Foreground="DimGray">Resolution:</TextBlock>
- <mahapps:NumericUpDown HideUpDownButtons="True" Width="90" HorizontalAlignment="Left" FontSize="14" FontFamily="{StaticResource digital-7}" StringFormat="{}{0:N0} cm" Margin="5 1 0 0" Minimum="10" Maximum="1000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" BorderBrush="DimGray" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding MachineOperator.GradientGenerationConfiguration.ResolutionCM,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
+ <mahapps:NumericUpDown HideUpDownButtons="True" Width="90" HorizontalAlignment="Left" FontSize="14" FontFamily="{StaticResource digital-7}" StringFormat="{}{0:N0} cm" Margin="5 1 0 0" Minimum="10" Maximum="1000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" BorderBrush="DimGray" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding Settings.GradientResolutionCM,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<mahapps:NumericUpDown.Resources>
<StaticResource ResourceKey="SelectAllTextBoxResource"></StaticResource>
</mahapps:NumericUpDown.Resources>
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/MachineStudioSettings.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/MachineStudioSettings.cs
index e5fe63d87..0433ff7be 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/MachineStudioSettings.cs
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/MachineStudioSettings.cs
@@ -146,7 +146,7 @@ namespace Tango.MachineStudio.Common
StudioModulesBounds = new List<StudioModuleBounds>();
Environment = WorkingEnvironment.Remote;
DeploymentSlot = DeploymentSlot.DEV;
- JobUploadStrategy = JobUploadStrategy.Default;
+ JobUploadStrategy = JobUploadStrategy.JobDescriptionFile;
MaximumCacheTime = TimeSpan.FromMinutes(5);
CachingMode = ObservablesContextInMemoryCachingMode.None;
}
diff --git a/Software/Visual_Studio/TCC/Tango.TCC.BL/Entities/Device.cs b/Software/Visual_Studio/TCC/Tango.TCC.BL/Entities/Device.cs
index 709b72a21..e2b3d68e4 100644
--- a/Software/Visual_Studio/TCC/Tango.TCC.BL/Entities/Device.cs
+++ b/Software/Visual_Studio/TCC/Tango.TCC.BL/Entities/Device.cs
@@ -24,5 +24,11 @@ namespace Tango.TCC.BL.Entities
[Column("LAST_LOGIN")]
public DateTime LastLogin { get; set; }
+
+ [Column("MACHINE_REGISTERED")]
+ public bool MachineRegistered { get; set; }
+
+ [Column("ORGANIZATION_GUID")]
+ public String OrganizationGuid { get; set; }
}
}
diff --git a/Software/Visual_Studio/TCC/Tango.TCC.BL/Entities/TCCEntityBase.cs b/Software/Visual_Studio/TCC/Tango.TCC.BL/Entities/TCCEntityBase.cs
index 9e3778a3c..f003bf6f0 100644
--- a/Software/Visual_Studio/TCC/Tango.TCC.BL/Entities/TCCEntityBase.cs
+++ b/Software/Visual_Studio/TCC/Tango.TCC.BL/Entities/TCCEntityBase.cs
@@ -14,5 +14,10 @@ namespace Tango.TCC.BL.Entities
[Column("GUID")]
public String Guid { get; set; }
+
+ public TCCEntityBase()
+ {
+ Guid = System.Guid.NewGuid().ToString();
+ }
}
}
diff --git a/Software/Visual_Studio/TCC/Tango.TCC.BL/Web/DefinitionResponse.cs b/Software/Visual_Studio/TCC/Tango.TCC.BL/Web/DefinitionResponse.cs
index 5ab6cfd6d..ea09dfdef 100644
--- a/Software/Visual_Studio/TCC/Tango.TCC.BL/Web/DefinitionResponse.cs
+++ b/Software/Visual_Studio/TCC/Tango.TCC.BL/Web/DefinitionResponse.cs
@@ -18,6 +18,8 @@ namespace Tango.TCC.BL.Web
public CardDetectionHistogramMethods HistogramMethod { get; set; }
public bool EnableDoubleChecking { get; set; }
public bool EnforceBarcodeDetection { get; set; }
+ public List<String> OrganizationMachines { get; set; }
+ public bool IsRegistered { get; set; }
public DefinitionResponse()
{
@@ -29,6 +31,7 @@ namespace Tango.TCC.BL.Web
HistogramMethod = CardDetectionHistogramMethods.Chi_Square;
EnableDoubleChecking = true;
EnforceBarcodeDetection = true;
+ OrganizationMachines = new List<string>();
}
}
}
diff --git a/Software/Visual_Studio/TCC/Tango.TCC.Service/Controllers/ColorDetectionController.cs b/Software/Visual_Studio/TCC/Tango.TCC.Service/Controllers/ColorDetectionController.cs
index a9ab84931..a28c2cb12 100644
--- a/Software/Visual_Studio/TCC/Tango.TCC.Service/Controllers/ColorDetectionController.cs
+++ b/Software/Visual_Studio/TCC/Tango.TCC.Service/Controllers/ColorDetectionController.cs
@@ -11,11 +11,14 @@ using System.Security.Authentication;
using System.Web.Http;
using Tango.PMR.TCC;
using Tango.TCC.BL;
+using Tango.TCC.BL.Entities;
using Tango.TCC.BL.Web;
+using Tango.TCC.Service.DB;
using Tango.TCC.Service.Filters;
using Tango.TCC.Service.Security;
using Tango.Web.Controllers;
using Tango.Web.Security;
+using System.Data.Entity;
namespace Tango.TCC.Service.Controllers
{
@@ -28,6 +31,23 @@ namespace Tango.TCC.Service.Controllers
if (request.AppID == TCCServiceConfig.APP_ID)
{
+ using (var db = TccDbContext.CreateTCC())
+ {
+ var device = db.Devices.SingleOrDefault(x => x.DeviceID == request.DeviceID);
+
+ if (device == null)
+ {
+ device = new Device();
+ device.DeviceID = request.DeviceID;
+ device.DeviceModel = request.Device;
+ device.Email = request.Email;
+ device.LastLogin = DateTime.UtcNow;
+ device.OSVersion = request.OSVersion;
+ db.Devices.Add(device);
+ db.SaveChanges();
+ }
+ }
+
response.AccessToken = WebToken<DeviceTokenObject>.CreateNew(TCCServiceConfig.JWT_TOKEN_SECRET, new DeviceTokenObject()
{
DeviceID = request.DeviceID,
@@ -45,20 +65,40 @@ namespace Tango.TCC.Service.Controllers
[HttpPost]
public DefinitionResponse GetDefinition(DefinitionRequest request)
{
- String s = RequestToken.Object.DeviceID;
-
- return new DefinitionResponse()
+ using (var db = TccDbContext.CreateTCC())
{
- TemplateString = TCCServiceConfig.TEMPLATE_STRING,
- SampleWidth = TCCServiceConfig.SAMPLE_WIDTH,
- SampleHeight = TCCServiceConfig.SAMPLE_HEIGHT,
- CameraWidth = TCCServiceConfig.CAMERA_WIDTH,
- CameraHeight = TCCServiceConfig.CAMERA_HEIGHT,
- HistogramMethod = TCCServiceConfig.HISTOGRAM_METHOD,
- SimilarityTolerance = TCCServiceConfig.SIMILARITY_TOLERANCE,
- EnableDoubleChecking = TCCServiceConfig.ENABLE_DOUBLE_CHECKING,
- EnforceBarcodeDetection = TCCServiceConfig.ENFORCE_BARCODE_DETECTION,
- };
+ var response = new DefinitionResponse()
+ {
+ TemplateString = TCCServiceConfig.TEMPLATE_STRING,
+ SampleWidth = TCCServiceConfig.SAMPLE_WIDTH,
+ SampleHeight = TCCServiceConfig.SAMPLE_HEIGHT,
+ CameraWidth = TCCServiceConfig.CAMERA_WIDTH,
+ CameraHeight = TCCServiceConfig.CAMERA_HEIGHT,
+ HistogramMethod = TCCServiceConfig.HISTOGRAM_METHOD,
+ SimilarityTolerance = TCCServiceConfig.SIMILARITY_TOLERANCE,
+ EnableDoubleChecking = TCCServiceConfig.ENABLE_DOUBLE_CHECKING,
+ EnforceBarcodeDetection = TCCServiceConfig.ENFORCE_BARCODE_DETECTION,
+ };
+
+ var device = db.Devices.SingleOrDefault(x => x.DeviceID == RequestToken.Object.DeviceID);
+
+ if (device != null && device.MachineRegistered)
+ {
+ using (var tangoDb = TccDbContext.CreateTango())
+ {
+ var machines = tangoDb.Machines.Where(x => x.OrganizationGuid == device.OrganizationGuid);
+
+ response.IsRegistered = true;
+
+ foreach (var m in machines)
+ {
+ response.OrganizationMachines.Add(m.SerialNumber);
+ }
+ }
+ }
+
+ return response;
+ }
}
[JwtTokenFilter]
@@ -111,9 +151,37 @@ namespace Tango.TCC.Service.Controllers
{
MachineRegistrationResponse response = new MachineRegistrationResponse();
- response.OrganizationMachines.Add("0002");
+ using (var tangoDB = TccDbContext.CreateTango())
+ {
+ var machine = tangoDB.Machines.SingleOrDefault(x => x.SerialNumber == request.SerialNumber);
+
+ if (machine == null)
+ {
+ throw new AuthenticationException("Invalid serial number.");
+ }
+
+ var all_machines = tangoDB.Machines.Where(x => x.OrganizationGuid == machine.OrganizationGuid);
+
+ foreach (var m in all_machines)
+ {
+ response.OrganizationMachines.Add(m.SerialNumber);
+ }
- //throw new AuthenticationException("No such serial number...");
+ using (var db = TccDbContext.CreateTCC())
+ {
+ String deviceId = RequestToken.Object.DeviceID;
+ var device = db.Devices.SingleOrDefault(x => x.DeviceID == deviceId);
+
+ if (device == null)
+ {
+ throw new InvalidOperationException("Could not find the device id.");
+ }
+
+ device.MachineRegistered = true;
+ device.OrganizationGuid = machine.OrganizationGuid;
+ db.SaveChanges();
+ }
+ }
return response;
}
diff --git a/Software/Visual_Studio/TCC/Tango.TCC.Service/DB/TccDbContext.cs b/Software/Visual_Studio/TCC/Tango.TCC.Service/DB/TccDbContext.cs
new file mode 100644
index 000000000..de38c0b91
--- /dev/null
+++ b/Software/Visual_Studio/TCC/Tango.TCC.Service/DB/TccDbContext.cs
@@ -0,0 +1,46 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using Tango.BL;
+using Tango.Core;
+using Tango.TCC.BL.Entities;
+using Tango.Web;
+using Tango.Web.Helpers;
+
+namespace Tango.TCC.Service.DB
+{
+ public class TccDbContext
+ {
+ public static ObservablesContext CreateTango()
+ {
+ return ObservablesContextHelper.CreateContext(TCCServiceConfig.TANGO_DB_CATALOG);
+ }
+
+ public static TCCContext CreateTCC()
+ {
+ if (System.Diagnostics.Debugger.IsAttached)
+ {
+ return new TCCContext(new Core.DataSource()
+ {
+ Address = "localhost\\SQLEXPRESS",
+ Catalog = "TCC",
+ IntegratedSecurity = true,
+ Type = DataSourceType.SQLServer,
+ });
+ }
+ else
+ {
+ return new TCCContext(new Core.DataSource()
+ {
+ Address = WebConfig.DB_ADDRESS,
+ Catalog = WebConfig.DB_CATALOG,
+ IntegratedSecurity = false,
+ Type = DataSourceType.SQLServer,
+ UserName = WebConfig.DB_USER_NAME,
+ Password = WebConfig.DB_PASSWORD
+ });
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/Software/Visual_Studio/TCC/Tango.TCC.Service/TCCServiceConfig.cs b/Software/Visual_Studio/TCC/Tango.TCC.Service/TCCServiceConfig.cs
index 14e9ef8cc..343d27e0a 100644
--- a/Software/Visual_Studio/TCC/Tango.TCC.Service/TCCServiceConfig.cs
+++ b/Software/Visual_Studio/TCC/Tango.TCC.Service/TCCServiceConfig.cs
@@ -76,5 +76,10 @@ namespace Tango.TCC.Service
/// Gets the mobile application ID.
/// </summary>
public static String APP_ID => ConfigurationManager.AppSettings[nameof(APP_ID)].ToString();
+
+ /// <summary>
+ /// Gets the database catalog.
+ /// </summary>
+ public static String TANGO_DB_CATALOG => ConfigurationManager.AppSettings[nameof(TANGO_DB_CATALOG)].ToString();
}
} \ No newline at end of file
diff --git a/Software/Visual_Studio/TCC/Tango.TCC.Service/Tango.TCC.Service.csproj b/Software/Visual_Studio/TCC/Tango.TCC.Service/Tango.TCC.Service.csproj
index fe4d6e85b..b7042197c 100644
--- a/Software/Visual_Studio/TCC/Tango.TCC.Service/Tango.TCC.Service.csproj
+++ b/Software/Visual_Studio/TCC/Tango.TCC.Service/Tango.TCC.Service.csproj
@@ -175,6 +175,7 @@
<Compile Include="Controllers\AccountController.cs" />
<Compile Include="Controllers\ColorDetectionController.cs" />
<Compile Include="Controllers\HomeController.cs" />
+ <Compile Include="DB\TccDbContext.cs" />
<Compile Include="Filters\JwtTokenFilter.cs" />
<Compile Include="Global.asax.cs">
<DependentUpon>Global.asax</DependentUpon>
@@ -215,6 +216,10 @@
<None Include="Properties\PublishProfiles\TwineTCC - Production.pubxml" />
</ItemGroup>
<ItemGroup>
+ <ProjectReference Include="..\..\Tango.BL\Tango.BL.csproj">
+ <Project>{f441feee-322a-4943-b566-110e12fd3b72}</Project>
+ <Name>Tango.BL</Name>
+ </ProjectReference>
<ProjectReference Include="..\..\Tango.Core\Tango.Core.csproj">
<Project>{a34ee0f0-649d-41c8-8489-b6f1cc6924ee}</Project>
<Name>Tango.Core</Name>
diff --git a/Software/Visual_Studio/TCC/Tango.TCC.Service/Web.config b/Software/Visual_Studio/TCC/Tango.TCC.Service/Web.config
index 37e3e528d..de53d7d14 100644
--- a/Software/Visual_Studio/TCC/Tango.TCC.Service/Web.config
+++ b/Software/Visual_Studio/TCC/Tango.TCC.Service/Web.config
@@ -18,7 +18,8 @@
<add key="DB_ADDRESS" value="twine.database.windows.net" />
<add key="DB_USER_NAME" value="Roy" />
<add key="DB_PASSWORD" value="Aa123456" />
- <add key="DB_CATALOG" value="TCC_DEV" />
+ <add key="DB_CATALOG" value="TCC" />
+ <add key="TANGO_DB_CATALOG" value="Tango_TEST" />
<add key="STORAGE_ACCOUNT" value="DefaultEndpointsProtocol=https;AccountName=tangostorage;AccountKey=S4z/D+Yg6mwMis+bs/VpcDLA9yE1iZaYq23shQlRIi2KmM9E7JY8zdZjeAPOPdG3gONHoNDEpsgH6D4cqQ/bsA==;EndpointSuffix=core.windows.net" />
<add key="TENANT_ID" value="2ebd63a5-bc2f-41dc-9066-4409ed5e5dd4" />
<add key="CLIENT_ID" value="ec612854-7abc-457b-808a-5d0c5ba80c57" />
diff --git a/Software/Visual_Studio/Tango.Web/Helpers/ObservablesContextHelper.cs b/Software/Visual_Studio/Tango.Web/Helpers/ObservablesContextHelper.cs
index fcf6eb599..b0ef6b104 100644
--- a/Software/Visual_Studio/Tango.Web/Helpers/ObservablesContextHelper.cs
+++ b/Software/Visual_Studio/Tango.Web/Helpers/ObservablesContextHelper.cs
@@ -10,12 +10,12 @@ namespace Tango.Web.Helpers
{
public static class ObservablesContextHelper
{
- public static ObservablesContext CreateContext()
+ public static ObservablesContext CreateContext(String catalog = null)
{
return new ObservablesContext(new DataSource()
{
Address = WebConfig.DB_ADDRESS,
- Catalog = WebConfig.DB_CATALOG,
+ Catalog = catalog != null ? catalog : WebConfig.DB_CATALOG,
IntegratedSecurity = false,
Type = DataSourceType.SQLServer,
UserName = WebConfig.DB_USER_NAME,