public static bool SendChatContent(ChatContentModel chatContent) { string url = "/api/ChatContent/Add"; string input = JsonConvert.SerializeObject(chatContent); bool result = ParseResponseJsonContent.ParseBool(RestClientUtil.PostToken(url, input), out string msg); if (!result) { Device.BeginInvokeOnMainThread(() => DependencyService.Get <IToast>().ShortAlert(msg)); } return(result); }
public static bool AddNewsComment(NewsCommentAddModel comment) { string url = "/api/NewsComment/Add"; string input = JsonConvert.SerializeObject(comment); bool res = ParseResponseJsonContent.ParseBool(RestClientUtil.PostToken(url, input), out string msg); if (!res) { Device.BeginInvokeOnMainThread(() => DependencyService.Get <IToast>().ShortAlert(msg)); } else { Device.BeginInvokeOnMainThread(() => DependencyService.Get <IToast>().ShortAlert("评论成功!")); } return(res); }
public static bool AddReserveDoctor(ReserveDoctorAddModel info) { string url = "/api/UserReserveRecord/Add"; string input = JsonConvert.SerializeObject(info); bool res = ParseResponseJsonContent.ParseBool(RestClientUtil.PostToken(url, input), out string msg); if (!res) { Device.BeginInvokeOnMainThread(() => DependencyService.Get <IToast>().ShortAlert(msg)); } else { Device.BeginInvokeOnMainThread(() => DependencyService.Get <IToast>().ShortAlert("预约成功!")); } return(res); }
public static bool AddCollectNews(CollectNewsAddModel info, bool isCollect) { string url = "/api/UserCollectNews/Add"; string input = JsonConvert.SerializeObject(info); bool res = ParseResponseJsonContent.ParseBool(RestClientUtil.PostToken(url, input), out string msg); if (!res) { Device.BeginInvokeOnMainThread(() => DependencyService.Get <IToast>().ShortAlert(msg)); } else { string hint = isCollect ? "取消收藏成功!" : "收藏成功!"; Device.BeginInvokeOnMainThread(() => DependencyService.Get <IToast>().ShortAlert(hint)); } return(res); }
public static bool StartDoctor(FollowDoctorModel info) { string url = "/api/UserFollowDoctor/Add"; string input = JsonConvert.SerializeObject(info); bool res = ParseResponseJsonContent.ParseBool(RestClientUtil.PostToken(url, input), out string msg); if (!res) { Device.BeginInvokeOnMainThread(() => DependencyService.Get <IToast>().ShortAlert(msg)); } else { string hint = info.IsFollow ? "取消关注医生成功!" : "关注医生成功!"; Device.BeginInvokeOnMainThread(() => DependencyService.Get <IToast>().ShortAlert(hint)); } return(res); }