|
@@ -149,6 +149,8 @@ namespace comal.timesheets
|
|
|
{
|
|
|
try
|
|
|
{
|
|
|
+ DBSettings = new DatabaseSettings();
|
|
|
+
|
|
|
Settings = new LocalConfiguration<ConnectionSettings>().Load();
|
|
|
|
|
|
DBSettings = new LocalConfiguration<DatabaseSettings>().Load();
|
|
@@ -157,10 +159,38 @@ namespace comal.timesheets
|
|
|
DBSettings.UserID = Settings.UserID;
|
|
|
if (!string.IsNullOrWhiteSpace(Settings.Password) && string.IsNullOrWhiteSpace(DBSettings.Password))
|
|
|
DBSettings.Password = Settings.Password;
|
|
|
+
|
|
|
+ if (string.IsNullOrWhiteSpace(DBSettings.UserID)
|
|
|
+ && string.IsNullOrWhiteSpace(DBSettings.Password)
|
|
|
+ && DBUrslBlank())
|
|
|
+ ApplyDemoSettings();
|
|
|
+ if (DBUrslBlank())
|
|
|
+ ApplyDemoURLs();
|
|
|
}
|
|
|
catch { }
|
|
|
}
|
|
|
|
|
|
+ private void ApplyDemoSettings()
|
|
|
+ {
|
|
|
+ DBSettings.UserID = "GUEST";
|
|
|
+ DBSettings.Password = "guest";
|
|
|
+ ApplyDemoURLs();
|
|
|
+ }
|
|
|
+
|
|
|
+ private void ApplyDemoURLs()
|
|
|
+ {
|
|
|
+ DBSettings.URLs[0] = "demo.prsdigital.com.au:8003";
|
|
|
+ DBSettings.URLs[1] = "demo2.prsdigital.com.au:8003";
|
|
|
+ DBSettings.URLs[2] = "demo3.prsdigital.com.au:8003";
|
|
|
+ }
|
|
|
+
|
|
|
+ private bool DBUrslBlank()
|
|
|
+ {
|
|
|
+ if (DBSettings.URLs.Count() == 0 || string.IsNullOrWhiteSpace(DBSettings.URLs[0]))
|
|
|
+ return true;
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
private void InitAndRegister()
|
|
|
{
|
|
|
try
|