public async Task GetServiceArticles(AccessToken token, int position, int pageIndex = 1) { try { var url = ""; switch (position) { case 0: url = string.Format(ApiUtils.ArticleHome, pageIndex, pageSize); break; case 1: url = string.Format(ApiUtils.ArticleHot, pageIndex, pageSize); break; } var result = await OkHttpUtils.Instance(token).GetAsyn(url); if (result.IsError) { articlesView.GetServiceArticlesFail(result.Message); } else { var articles = JsonConvert.DeserializeObject <List <ArticlesModel> >(result.Message); await SQLiteUtils.Instance().UpdateArticles(articles); articlesView.GetServiceArticlesSuccess(articles); } } catch (Exception ex) { articlesView.GetServiceArticlesFail(ex.Message); } }
public async Task GetServiceNews(AccessToken token, int id) { try { var result = await OkHttpUtils.Instance(token).GetAsyn(string.Format(ApiUtils.NewsBody, id)); if (result.IsError) { newsView.GetServiceNewsFail(result.Message); } else { await SQLiteUtils.Instance().QueryNew(id).ContinueWith(async(response) => { var news = response.Result; news.Body = result.Message; await SQLiteUtils.Instance().UpdateNew(news); newsView.GetServiceNewsSuccess(news); }); } } catch (Exception ex) { newsView.GetServiceNewsFail(ex.Message); } }
public void UserRefreshToken(AccessToken token, string basic) { try { var param = new List <OkHttpUtils.Param>() { new OkHttpUtils.Param("grant_type", "refresh_token"), new OkHttpUtils.Param("refresh_token", token.refresh_token) }; OkHttpUtils.Instance(token).Post(ApiUtils.Token, basic, param, async(call, response) => { var code = response.Code(); var body = await response.Body().StringAsync(); if (code == (int)System.Net.HttpStatusCode.OK) { token = JsonConvert.DeserializeObject <AccessToken>(body); token.RefreshTime = DateTime.Now; UserShared.Update(context, token); } else { UserShared.Update(context, new AccessToken()); } }, (call, ex) => { }); } catch (Exception ex) { } }
public async Task GetServiceKbArticle(AccessToken token, int id) { try { var result = await OkHttpUtils.Instance(token).GetAsyn(string.Format(ApiUtils.KbArticlesBody, id)); if (result.IsError) { kbarticleView.GetServiceKbArticleFail(result.Message); } else { await SQLiteUtils.Instance().QueryKbArticle(id).ContinueWith(async(response) => { var article = response.Result; article.Body = result.Message; await SQLiteUtils.Instance().UpdateKbArticle(article); kbarticleView.GetServiceKbArticleSuccess(article); }); } } catch (Exception ex) { kbarticleView.GetServiceKbArticleFail(ex.Message); } }
public async Task LoginAsync(AccessToken token, string basic, string account, string password) { try { var param = new List <OkHttpUtils.Param>() { new OkHttpUtils.Param("grant_type", "password"), new OkHttpUtils.Param("username", account), new OkHttpUtils.Param("password", password) }; OkHttpUtils.Instance(token).Post(ApiUtils.Token, basic, param, async(call, response) => { var code = response.Code(); var body = await response.Body().StringAsync(); if (code == (int)System.Net.HttpStatusCode.OK) { token = JsonConvert.DeserializeObject <AccessToken>(body); token.RefreshTime = DateTime.Now; var result = await OkHttpUtils.Instance(token).GetAsyn(ApiUtils.Users); if (result.IsError) { loginView.LoginFail(result.Message); } else { var user = JsonConvert.DeserializeObject <UserModel>(result.Message); await SQLiteUtils.Instance().UpdateUser(user); loginView.LoginSuccess(token, user); } } else { try { var error = JsonConvert.DeserializeObject <LoginErrorMessage>(body); if (error != null && error.Error != null) { loginView.LoginFail("µÇ¼ʧ°Ü,Óû§Ãû»òÃÜÂë´íÎó"); } } catch (Exception e) { loginView.LoginFail(e.Message); } } }, (call, ex) => { loginView.LoginFail(ex.Message); }); } catch (Exception ex) { loginView.LoginFail(ex.Message); } }
public void PostComment(AccessToken token, int questionId, int answerId, string content) { try { var url = string.Format(ApiUtils.QuestionsAnswerCommentsAdd, questionId, answerId.ToString()); var param = new List <OkHttpUtils.Param>() { new OkHttpUtils.Param("ParentCommentId", "0"), new OkHttpUtils.Param("Content", content), }; OkHttpUtils.Instance(token).Post(url, param, async(call, response) => { var code = response.Code(); var body = await response.Body().StringAsync(); if (code == (int)System.Net.HttpStatusCode.OK) { var user = await SQLiteUtils.Instance().QueryUser(); QuestionCommentsModel news = new QuestionCommentsModel(); news.PostUserInfo = new QuestionUserInfoModel() { UserID = user.SpaceUserId, IconName = user.Face, UCUserID = user.UserId, UserName = user.DisplayName, QScore = user.Score }; news.Content = content; news.DateAdded = DateTime.Now; news.CommentID = answerId; commentsView.PostCommentSuccess(news); } else { try { var error = JsonConvert.DeserializeObject <ErrorMessage>(body); commentsView.PostCommentFail(error.Message); } catch (Exception e) { commentsView.PostCommentFail(e.Message); } } }, (call, ex) => { commentsView.PostCommentFail(ex.Message); }); } catch (Exception e) { commentsView.PostCommentFail(e.Message); } }
public void PostComment(AccessToken token, int id, string content) { try { var url = string.Format(ApiUtils.NewsCommentAdd, id.ToString()); var param = new List <OkHttpUtils.Param>() { new OkHttpUtils.Param("ParentId", "0"), new OkHttpUtils.Param("Content", content), }; OkHttpUtils.Instance(token).Post(url, param, async(call, response) => { var code = response.Code(); var body = await response.Body().StringAsync(); if (code == (int)System.Net.HttpStatusCode.Created) { var user = await SQLiteUtils.Instance().QueryUser(); NewsCommentModel news = new NewsCommentModel(); news.UserName = user.DisplayName; news.FaceUrl = user.Face; news.CommentContent = content; news.DateAdded = DateTime.Now; news.Floor = 0; news.CommentID = Convert.ToInt32(body); news.AgreeCount = 0; news.AntiCount = 0; news.ContentID = 0; news.UserGuid = user.UserId; commentView.PostCommentSuccess(news); } else { try { var error = JsonConvert.DeserializeObject <ErrorMessage>(body); commentView.PostCommentFail(error.Message); } catch (Exception e) { commentView.PostCommentFail(e.Message); } } }, (call, ex) => { commentView.PostCommentFail(ex.Message); }); } catch (Exception e) { commentView.PostCommentFail(e.Message); } }
public void StatusAdd(AccessToken token, string content, bool isPrivate) { try { var url = ApiUtils.StatusADD; var param = new List <OkHttpUtils.Param>() { new OkHttpUtils.Param("IsPrivate", isPrivate.ToString()), new OkHttpUtils.Param("Content", content), }; OkHttpUtils.Instance(token).Post(url, param, async(call, response) => { var code = response.Code(); var body = await response.Body().StringAsync(); if (code == (int)System.Net.HttpStatusCode.OK) { var user = await SQLiteUtils.Instance().QueryUser(); StatusModel status = new StatusModel(); status.UserDisplayName = user.DisplayName; status.UserIconUrl = user.Face; status.Content = content; status.IsPrivate = isPrivate; status.DateAdded = DateTime.Now; status.UserGuid = user.UserId; statusView.StatusAddSuccess(status); } else { try { var error = JsonConvert.DeserializeObject <ErrorMessage>(body); statusView.StatusAddFail(error.Message); } catch (Exception e) { statusView.StatusAddFail(e.Message); } } }, (call, ex) => { statusView.StatusAddFail(ex.Message); }); } catch (Exception e) { statusView.StatusAddFail(e.Message); } }
public void BookmarkEdit(AccessToken token, BookmarksModel bookmark, int position) { try { var url = string.Format(ApiUtils.BookmarkEdit, bookmark.WzLinkId); var param = new List <OkHttpUtils.Param>() { new OkHttpUtils.Param("WzLinkId", bookmark.WzLinkId.ToString()), new OkHttpUtils.Param("LinkUrl", bookmark.LinkUrl), new OkHttpUtils.Param("Title", bookmark.Title), new OkHttpUtils.Param("Summary", bookmark.Summary), new OkHttpUtils.Param("Tags", bookmark.Tag), new OkHttpUtils.Param("DateAdded", bookmark.DateAdded.ToString()), new OkHttpUtils.Param("FromCNBlogs", bookmark.FromCNBlogs.ToString()) }; OkHttpUtils.Instance(token).Patch(url, param, async(call, response) => { var code = response.Code(); var body = await response.Body().StringAsync(); if (code == (int)System.Net.HttpStatusCode.OK) { await SQLiteUtils.Instance().UpdateBookmark(bookmark); bookmarkView.BookmarkEditSuccess(position); } else { try { var error = JsonConvert.DeserializeObject <ErrorMessage>(body); bookmarkView.BookmarkEditFail(error.Message); } catch (Exception e) { bookmarkView.BookmarkEditFail(e.Message); } } }, (call, ex) => { bookmarkView.BookmarkEditFail(ex.Message); }); } catch (Exception e) { bookmarkView.BookmarkEditFail(e.Message); } }
public async Task GetServiceQuestions(AccessToken token, int position, int pageIndex = 1) { try { string url = ""; switch (position) { case 0: url = string.Format(ApiUtils.Questions, pageIndex, pageSize); break; case 1: url = string.Format(ApiUtils.QuestionsType, "highscore", pageIndex, pageSize); break; case 2: url = string.Format(ApiUtils.QuestionsType, "noanswer", pageIndex, pageSize); break; case 3: url = string.Format(ApiUtils.QuestionsType, "solved", pageIndex, pageSize); break; case 4: url = string.Format(ApiUtils.QuestionsType, "myquestion", pageIndex, pageSize); break; } var result = await OkHttpUtils.Instance(token).GetAsyn(url); if (result.IsError) { questionView.GetServiceQuestionsFail(result.Message); } else { var questions = JsonConvert.DeserializeObject <List <QuestionsModel> >(result.Message); if (position != 4) { await SQLiteUtils.Instance().UpdateQuestions(questions); } questionView.GetServiceQuestionsSuccess(questions); } } catch (Exception ex) { questionView.GetServiceQuestionsFail(ex.Message); } }
public async Task GetServiceNews(AccessToken token, int position, int pageIndex = 1) { try { var url = ""; switch (position) { case 0: url = string.Format(ApiUtils.NewsHome, pageIndex, pageSize); break; case 1: url = string.Format(ApiUtils.NewsRecommend, pageIndex, pageSize); break; case 2: url = string.Format(ApiUtils.NewsWorkHot, pageIndex, pageSize); break; } var result = await OkHttpUtils.Instance(token).GetAsyn(url); if (result.IsError) { newsView.GetServiceNewsFail(result.Message); } else { var news = JsonConvert.DeserializeObject <List <NewsModel> >(result.Message); switch (position) { case 1: news.ForEach(s => s.IsRecommend = true); break; case 2: news.ForEach(s => s.IsHot = true); break; } await SQLiteUtils.Instance().UpdateNews(news); newsView.GetServiceNewsSuccess(news); } } catch (Exception ex) { newsView.GetServiceNewsFail(ex.Message); } }
public void BookmarkAdd(AccessToken token, BookmarksModel bookmark) { try { var url = ApiUtils.BookmarkAdd; var param = new List <OkHttpUtils.Param>() { new OkHttpUtils.Param("LinkUrl", bookmark.LinkUrl), new OkHttpUtils.Param("Title", bookmark.Title), new OkHttpUtils.Param("Summary", bookmark.Summary), new OkHttpUtils.Param("Tags", bookmark.Tag), new OkHttpUtils.Param("FromCNBlogs", bookmark.FromCNBlogs.ToString()) }; OkHttpUtils.Instance(token).Post(url, param, async(call, response) => { var code = response.Code(); var body = await response.Body().StringAsync(); if (code == (int)System.Net.HttpStatusCode.Created) { bookmarkView.BookmarkAddSuccess(); } else { try { var error = JsonConvert.DeserializeObject <ErrorMessage>(body); bookmarkView.BookmarkAddFail(error.Message); } catch (Exception e) { bookmarkView.BookmarkAddFail(e.Message); } } }, (call, ex) => { bookmarkView.BookmarkAddFail(ex.Message); }); } catch (Exception e) { bookmarkView.BookmarkAddFail(e.Message); } }
public void QuestionAdd(AccessToken token, string title, string content, string tags, int flags) { try { var url = string.Format(ApiUtils.QuestionADD); var param = new List <OkHttpUtils.Param>() { new OkHttpUtils.Param("Title", title), new OkHttpUtils.Param("Content", content), new OkHttpUtils.Param("Tags", tags), new OkHttpUtils.Param("Flags", flags.ToString()), }; OkHttpUtils.Instance(token).Post(url, param, async(call, response) => { var code = response.Code(); var body = await response.Body().StringAsync(); if (code == (int)System.Net.HttpStatusCode.OK) { questionView.QuestionAddSuccess(null); } else { try { var error = JsonConvert.DeserializeObject <ErrorMessage>(body); questionView.QuestionAddFail(error.Message); } catch (Exception e) { questionView.QuestionAddFail(e.Message); } } }, (call, ex) => { questionView.QuestionAddFail(ex.Message); }); } catch (Exception e) { questionView.QuestionAddFail(e.Message); } }
public void PostComment(AccessToken token, string blogApp, int id, string content) { try { var url = string.Format(ApiUtils.ArticleCommentAdd, blogApp, id); OkHttpUtils.Instance(token).Post(url, content, async(call, response) => { var code = response.Code(); var body = await response.Body().StringAsync(); if (code == (int)System.Net.HttpStatusCode.OK) { var user = await SQLiteUtils.Instance().QueryUser(); ArticleCommentModel article = new ArticleCommentModel(); article.Author = user.DisplayName; article.AuthorUrl = user.Avatar; article.FaceUrl = user.Face; article.Body = content; article.DateAdded = DateTime.Now; article.Floor = 0; article.Id = 0; commentView.PostCommentSuccess(article); } else { try { var error = JsonConvert.DeserializeObject <ErrorMessage>(body); commentView.PostCommentFail(error.Message); } catch (Exception e) { commentView.PostCommentFail(e.Message); } } }, (call, ex) => { commentView.PostCommentFail(ex.Message); }); } catch (Exception e) { commentView.PostCommentFail(e.Message); } }
public void AnswersAdd(AccessToken token, int questionId, string content) { try { var url = string.Format(ApiUtils.QuestionsAnswerAdd, questionId); var param = new List <OkHttpUtils.Param>() { new OkHttpUtils.Param("Answer", content), }; OkHttpUtils.Instance(token).Post(url, param, async(call, response) => { var code = response.Code(); var body = await response.Body().StringAsync(); if (code == (int)System.Net.HttpStatusCode.OK) { answersView.AnswersAddSuccess(null); } else { try { var error = JsonConvert.DeserializeObject <ErrorMessage>(body); answersView.AnswersAddFail(error.Message); } catch (Exception e) { answersView.AnswersAddFail(e.Message); } } }, (call, ex) => { answersView.AnswersAddFail(ex.Message); }); } catch (Exception e) { answersView.AnswersAddFail(e.Message); } }
public async Task GetComment(AccessToken token, int id, int pageIndex = 1) { try { var result = await OkHttpUtils.Instance(token).GetAsyn(string.Format(ApiUtils.NewsComment, id, pageIndex, pageSize)); if (result.IsError) { commentView.GetCommentFail(result.Message); } else { var comments = JsonConvert.DeserializeObject <List <NewsCommentModel> >(result.Message); commentView.GetCommentSuccess(comments); } } catch (Exception ex) { commentView.GetCommentFail(ex.Message); } }
public async Task GetServiceNews(AccessToken token, int pageIndex = 1) { try { var result = await OkHttpUtils.Instance(token).GetAsyn(string.Format(ApiUtils.News, pageIndex, pageSize)); if (result.IsError) { newsView.GetServiceNewsFail(result.Message); } else { var news = JsonConvert.DeserializeObject <List <NewsModel> >(result.Message); newsView.GetServiceNewsSuccess(news); } } catch (Exception ex) { newsView.GetServiceNewsFail(ex.Message); } }
public async Task GetAnswers(AccessToken token, int id, int pageIndex = 1) { try { var result = await OkHttpUtils.Instance(token).GetAsyn(string.Format(ApiUtils.QuestionsAnswers, id)); if (result.IsError) { answersView.GetAnswersFail(result.Message); } else { var answers = JsonConvert.DeserializeObject <List <QuestionAnswersModel> >(result.Message); answersView.GetAnswersSuccess(answers); } } catch (Exception ex) { answersView.GetAnswersFail(ex.Message); } }
public async Task GetServiceComments(AccessToken token, int id) { try { var result = await OkHttpUtils.Instance(token).GetAsyn(string.Format(ApiUtils.QuestionsAnswerComments, id)); if (result.IsError) { commentsView.GetCommentsFail(result.Message); } else { var comments = JsonConvert.DeserializeObject <List <QuestionCommentsModel> >(result.Message); commentsView.GetCommentsSuccess(comments); } } catch (Exception ex) { commentsView.GetCommentsFail(ex.Message); } }
public void GetAccessToken(AccessToken token, string basic) { try { var param = new List <OkHttpUtils.Param>() { new OkHttpUtils.Param("grant_type", "client_credentials") }; OkHttpUtils.Instance(token).Post(ApiUtils.Token, basic, param, async(call, response) => { var code = response.Code(); var body = await response.Body().StringAsync(); if (code == (int)System.Net.HttpStatusCode.OK) { token = JsonConvert.DeserializeObject <AccessToken>(body); token.RefreshTime = DateTime.Now; splashView.GetAccessTokenSuccess(token); } else { try { var error = JsonConvert.DeserializeObject <ErrorMessage>(body); splashView.GetAccessTokenFail(error.Message); } catch (Exception e) { splashView.GetAccessTokenFail(e.Message); } } }, (call, ex) => { splashView.GetAccessTokenFail(ex.Message); }); } catch (Exception ex) { splashView.GetAccessTokenFail(ex.Message); } }
public async void CheckAnswersByUser(AccessToken token, int questionId) { try { var user = await SQLiteUtils.Instance().QueryUser(); var url = string.Format(ApiUtils.QuestionsAnswerByUser, questionId, user.SpaceUserId); if (await OkHttpUtils.Instance(token).HeadAsyn(url)) { answersView.CheckAnswersUserSuccess(); } else { answersView.CheckAnswersUserFail(null); } } catch (Exception e) { answersView.CheckAnswersUserFail(e.Message); } }
public void Login(AccessToken token, string content) { try { OkHttpUtils.Instance(token).Post(ApiUtils.Token, content, "application/x-www-form-urlencoded", async(call, response) => { var code = response.Code(); var body = await response.Body().StringAsync(); if (code == (int)System.Net.HttpStatusCode.OK) { token = JsonConvert.DeserializeObject <AccessToken>(body); token.RefreshTime = DateTime.Now; var result = await OkHttpUtils.Instance(token).GetAsyn(ApiUtils.Users); if (result.IsError) { loginView.LoginFail(result.Message); } else { var user = JsonConvert.DeserializeObject <UserModel>(result.Message); await SQLiteUtils.Instance().UpdateUser(user); loginView.LoginSuccess(token, user); } } else { loginView.LoginFail("»ñÈ¡tokenʧ°Ü"); } }, (call, ex) => { loginView.LoginFail(ex.Message); }); } catch (Exception ex) { loginView.LoginFail(ex.Message); } }
public async Task GetServiceBookmarks(AccessToken token, int pageIndex = 1) { try { var result = await OkHttpUtils.Instance(token).GetAsyn(string.Format(ApiUtils.Bookmarks, pageIndex, pageSize)); if (result.IsError) { bookmarksView.GetServiceBookmarksFail(result.Message); } else { var bookmarks = JsonConvert.DeserializeObject <List <BookmarksModel> >(result.Message); await SQLiteUtils.Instance().UpdateBookmarks(bookmarks); bookmarksView.GetServiceBookmarksSuccess(bookmarks); } } catch (Exception ex) { bookmarksView.GetServiceBookmarksFail(ex.Message); } }
public async Task GetServiceBlogPosts(AccessToken token, string blogApp, int pageIndex) { try { var result = await OkHttpUtils.Instance(token).GetAsyn(string.Format(ApiUtils.BlogPosts, blogApp, pageIndex)); if (result.IsError) { blogView.GetServiceBlogPostsFail(result.Message); } else { var articles = JsonConvert.DeserializeObject <List <ArticlesModel> >(result.Message); await SQLiteUtils.Instance().UpdateArticles(articles); blogView.GetServiceBlogPostsSuccess(articles); } } catch (Exception ex) { blogView.GetServiceBlogPostsFail(ex.Message); } }
public async Task GetServiceStatus(AccessToken token, int id) { try { var result = await OkHttpUtils.Instance(token).GetAsyn(string.Format(ApiUtils.StatusBody, id)); if (result.IsError) { statusView.GetServiceStatusFail(result.Message); } else { var status = JsonConvert.DeserializeObject <StatusModel>(result.Message); await SQLiteUtils.Instance().UpdateStatus(status); statusView.GetServiceStatusSuccess(status); } } catch (Exception e) { statusView.GetServiceStatusFail(e.Message); } }
public async Task GetServiceQuestion(AccessToken token, int id) { try { var result = await OkHttpUtils.Instance(token).GetAsyn(string.Format(ApiUtils.QuestionDetails, id)); if (result.IsError) { questionView.GetServiceQuestionFail(result.Message); } else { var question = JsonConvert.DeserializeObject <QuestionsModel>(result.Message); await SQLiteUtils.Instance().UpdateQuestion(question); questionView.GetServiceQuestionSuccess(question); } } catch (Exception ex) { questionView.GetServiceQuestionFail(ex.Message); } }
public async void DeleteBookmarkAsync(AccessToken token, int id) { try { var url = string.Format(ApiUtils.BookmarkDelete, id); await SQLiteUtils.Instance().DeleteBookmark(id); OkHttpUtils.Instance(token).Delete(url, async(call, response) => { var code = response.Code(); var body = await response.Body().StringAsync(); if (code == (int)System.Net.HttpStatusCode.OK) { bookmarksView.DeleteBookmarkSuccess(id); } else { try { var error = JsonConvert.DeserializeObject <ErrorMessage>(body); bookmarksView.DeleteBookmarkFail(id, error.Message); } catch (Exception e) { bookmarksView.DeleteBookmarkFail(id, e.Message); } } }, (call, ex) => { bookmarksView.DeleteBookmarkFail(id, ex.Message); }); } catch (Exception ex) { bookmarksView.DeleteBookmarkFail(id, ex.Message); } }
public async Task GetServiceBlog(AccessToken token, string blogApp) { try { var result = await OkHttpUtils.Instance(token).GetAsyn(string.Format(ApiUtils.BlogApp, blogApp)); if (result.IsError) { blogView.GetServiceBlogFail(result.Message); } else { var blog = JsonConvert.DeserializeObject <BlogModel>(result.Message); blog.BlogApp = blogApp; await SQLiteUtils.Instance().UpdateBlog(blog); blogView.GetServiceBlogSuccess(blog); } } catch (Exception ex) { blogView.GetServiceBlogFail(ex.Message); } }
public void DeleteAnswer(AccessToken token, int questionId, int answerId) { try { var url = string.Format(ApiUtils.QuestionsAnswerDelete, questionId, answerId); OkHttpUtils.Instance(token).Delete(url, async(call, response) => { var code = response.Code(); var body = await response.Body().StringAsync(); if (code == (int)System.Net.HttpStatusCode.OK) { answersView.DeleteAnswerSuccess(answerId); } else { try { var error = JsonConvert.DeserializeObject <ErrorMessage>(body); answersView.DeleteAnswerFail(answerId, error.Message); } catch (Exception e) { answersView.DeleteAnswerFail(answerId, e.Message); } } }, (call, ex) => { answersView.DeleteAnswerFail(answerId, ex.Message); }); } catch (Exception ex) { answersView.DeleteAnswerFail(answerId, ex.Message); } }
public async Task GetServiceStatus(AccessToken token, int position, int pageIndex = 1) { try { string statusType = "all"; switch (position) { case 0: statusType = "all"; break; case 1: statusType = "following"; break; case 2: statusType = "my"; break; case 3: statusType = "mycomment"; break; case 4: statusType = "recentcomment"; break; case 5: statusType = "mention"; break; case 6: statusType = "comment"; break; default: statusType = "all"; break; } var url = string.Format(ApiUtils.Status, statusType, pageIndex, pageSize); var result = await OkHttpUtils.Instance(token).GetAsyn(url); if (result.IsError) { statusView.GetServiceStatusFail(result.Message); return; } else { var statuses = JsonConvert.DeserializeObject <List <StatusModel> >(result.Message); if (position == 0) { await SQLiteUtils.Instance().UpdateStatuses(statuses); } statusView.GetServiceStatusSuccess(statuses); } } catch (Exception ex) { statusView.GetServiceStatusFail(ex.Message); } }