Exemple #1
0
        public async void SaveFeedbackToCloud(Feedback fb)
        {
            if (!AppService.IsConnected()) return;

            try
            {
                AzureMobileService.Current.PushToCloud(fb);
             
                Messenger.Default.Send<GeneralSystemWideMessage>(new GeneralSystemWideMessage("writing ...") { Identifier = "CLOUD BAR", SourceId = "AzureMobileService", Action = "WRITE" });
            }
            catch
            {
                Messenger.Default.Send<GeneralSystemWideMessage>(new GeneralSystemWideMessage("writing ...") { Identifier = "CLOUD BAR", SourceId = "AzureMobileService", Action = "ERROR" });
            }
        }
Exemple #2
0
        public async void PushToCloud(Feedback feedback)
        {
            if (!AppService.IsConnected()) return;

            try
            {
                if (!string.IsNullOrEmpty(feedback.MSId))
                {
                    string id = feedback.Id;
                    feedback.Id = feedback.MSId;
                    feedback.MSId = id;
                    await mstFeedback.UpdateAsync(feedback);
                    feedback.Id = id;
                }
                else
                {
                    feedback.Id = string.Empty;
                    feedback.MSId = string.Empty;
                    await mstFeedback.InsertAsync(feedback);
                    //AppDatabase.Current.UpdateFavouriteField(favourite.AggregateId, "MSId", favourite.Id, false);
                }

                Messenger.Default.Send<GeneralSystemWideMessage>(new GeneralSystemWideMessage("writing ...") { Identifier = "CLOUD BAR", SourceId = "AzureMobileService", Action = "WRITE" });
            }
            catch
            {
                Messenger.Default.Send<GeneralSystemWideMessage>(new GeneralSystemWideMessage("writing ...") { Identifier = "CLOUD BAR", SourceId = "AzureMobileService", Action = "ERROR" });
            }
        }