Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        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);
        }
Ejemplo n.º 4
0
        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);
        }
Ejemplo n.º 5
0
        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);
        }
Ejemplo n.º 6
0
        public static bool CancelReserveDoctor(int id)
        {
            string url = RestClientUtil.GetSpliceUrl("/api/UserReserveRecord/Delete", new Dictionary <string, string>
            {
                { "id", id.ToString() }
            });
            bool res = ParseResponseJsonContent.ParseBool(RestClientUtil.DeleteToken(url), out string msg);

            if (!res)
            {
                Device.BeginInvokeOnMainThread(() => DependencyService.Get <IToast>().ShortAlert(msg));
            }
            else
            {
                Device.BeginInvokeOnMainThread(() => DependencyService.Get <IToast>().ShortAlert("取消预约成功!"));
            }
            return(res);
        }