partial void SyncButton_TouchUpInside(UIButton sender)
 {
     if (AppData.online == false)
     {
         UIAlertView alertView = new UIAlertView();
         alertView.Title = "Failed to sync";
         alertView.AddButton("Ok");
         alertView.Message = "Please login with TidyHQ to sync";
         alertView.Show();
     }
     else
     {
         ReadWriteDisk.writeContacts();
         ReadWriteDisk.writeCourses();
         ReadWriteDisk.writeLocation();
         ReadWriteDisk.writeRecord();
         ReadWriteDisk.writeRaceResults();
         saveDataToCloud.Save();
         UIAlertView alertView = new UIAlertView();
         alertView.Title = "Sync";
         alertView.AddButton("Ok");
         alertView.Message = "Synching with Firebase completed";
         alertView.Show();
     }
 }
Beispiel #2
0
        private AppData()
        {
            offlineCourseList     = new List <CoursesClass>();
            offlineContactList    = new List <ContactClass>();
            offlineRecordList     = new List <RecordClass>();
            offlineRaceResultList = new List <RaceResultClass>();

            App.Configure(); // Goes through the Googleservices plist and connects to firebase

            CourseNode     = Database.DefaultInstance.GetRootReference().GetChild("courses");
            ContactNode    = Database.DefaultInstance.GetRootReference().GetChild("contacts");
            LocationNode   = Database.DefaultInstance.GetRootReference().GetChild("location");
            RaceResultNode = Database.DefaultInstance.GetRootReference().GetChild("raceresults");
            RecordNode     = Database.DefaultInstance.GetRootReference().GetChild("record");
            auth           = Auth.DefaultInstance;
            ReadWriteDisk.readContacts();
            ReadWriteDisk.readCourses();
            //PrepareLocationFirstList.Prepare();
            ReadWriteDisk.readLocation();
            ReadWriteDisk.readRaceResults();
            ReadWriteDisk.readRecord();
        }