Beispiel #1
0
        public async void SaveCommentToCloud(Comment comment)
        {
            if (!AppService.IsConnected()) return;

            try
            {
                //var items = AppDatabase.Current.RetrieveSolutionsByGrouping(sessionId);
                //foreach (var item in items)
                //{
                AzureMobileService.Current.PushToCloud(comment);
                //}

                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" });
            }
        }
Beispiel #2
0
        public async void PushToCloud(Comment comment)
        {
            if (!AppService.IsConnected()) return;

            try
            {
                if (!string.IsNullOrEmpty(comment.MSId))
                {
                    string id = comment.Id;
                    comment.Id = comment.MSId;
                    comment.MSId = id;
                    await mstComment.UpdateAsync(comment);
                    comment.Id = id;
                }
                else
                {
                    comment.Id = string.Empty;
                    comment.MSId = string.Empty;
                    await mstComment.InsertAsync(comment);
                }

                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" });
            }
        }