Kaynağa Gözat

PRS MOBILE - fix to android after settings page changes Settings

Nick-PRSDigital@bitbucket.org 2 yıl önce
ebeveyn
işleme
879bb22923
1 değiştirilmiş dosya ile 13 ekleme ve 36 silme
  1. 13 36
      prs.mobile/comal.timesheets/Main/App.xaml.cs

+ 13 - 36
prs.mobile/comal.timesheets/Main/App.xaml.cs

@@ -67,43 +67,20 @@ namespace comal.timesheets
 
                 DBSettings = new LocalConfiguration<DatabaseSettings>().Load();
 
-                if (DBSettings.URLs.Count() == 0 || string.IsNullOrWhiteSpace(DBSettings.URLs[0]))
-                {
-                    if (string.IsNullOrWhiteSpace(Settings.URL))
-                        TryLoadFromSecureCache();
-
-                    if (string.IsNullOrWhiteSpace(Settings.URL))
-                        MobileUtils.LoadDemoSettings(DBSettings);
-                    else
-                    {                        
-                        if (Settings.URL.ToUpper().Contains("COM-AL"))
-                        {
-                            List<string> list = new List<string>();
-                            list.Add("http://remote.com-al.com.au:" + Settings.Port);
-                            list.Add("http://remote2.com-al.com.au:" + Settings.Port);
-                            list.Add("http://remote3.com-al.com.au:" + Settings.Port);
-
-                            DBSettings.URLs = list.ToArray();
-                        }
-                        DBSettings.UserID = Settings.UserID;
-                        DBSettings.Password = Settings.Password;
-                    }                    
-                }
-                
-                if (DBSettings.URLs.Count() > 0)
-                {
-                    if (DBSettings.URLs[0].ToUpper().Contains("COM-AL"))
-                    {
-                        List<string> list = new List<string>();
-                        list.Add("http://remote.com-al.com.au:" + Settings.Port);
-                        list.Add("http://remote2.com-al.com.au:" + Settings.Port);
-                        list.Add("http://remote3.com-al.com.au:" + Settings.Port);
+                if (!string.IsNullOrWhiteSpace(Settings.UserID) && string.IsNullOrWhiteSpace(DBSettings.UserID))
+                    DBSettings.UserID = Settings.UserID;
+                if (!string.IsNullOrWhiteSpace(Settings.Password) && string.IsNullOrWhiteSpace(DBSettings.Password))
+                    DBSettings.Password = Settings.Password;
 
-                        DBSettings.URLs = list.ToArray();
-                    }
-                    new LocalConfiguration<DatabaseSettings>().Save(DBSettings);
-                    MobileUtils.SaveToSecureStorage();
-                }
+                List<string> list = new List<string>();
+                list.Add("remote.com-al.com.au:8000");
+                list.Add("remote2.com-al.com.au:8000");
+                list.Add("remote3.com-al.com.au:8000");
+
+                DBSettings.URLs = list.ToArray();
+
+                new LocalConfiguration<DatabaseSettings>().Save(DBSettings);
+                MobileUtils.SaveToSecureStorage();
 
                 //if (!string.IsNullOrWhiteSpace(GlobalVariables.LoadFromLinkString))
                 //{