コード例 #1
0
        public static async Task CmdAddOrUpdateFeedback(TSFeedback ParTSFeedback)
        {
            httpClient.DefaultRequestHeaders.Accept.Clear();
            httpClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
            httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", LocalData.CurrJWT);

            GlobalFunctions.CmdTrimEntity(ParTSFeedback);

            TSFeedback tsFeedbackForSend = GlobalFunctions.CopyObject <TSFeedback>(ParTSFeedback);


            LocalData.currFeedback = await httpClient.MyPostJsonGetJsonAsync("feedback/Add", tsFeedbackForSend);


            if (string.IsNullOrEmpty(LocalData.currFeedback.Text))
            {
                LocalData.oldFeedbackText = string.Empty;
            }
            else
            {
                LocalData.oldFeedbackText = LocalData.currFeedback.Text.ToLower();
            }

            httpClient.DefaultRequestHeaders.Accept.Clear();
        }
コード例 #2
0
        public static async Task CmdAddOrUpdateReaction(TSReaction ParTSReaction)
        {
            httpClient.DefaultRequestHeaders.Accept.Clear();
            httpClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
            httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", LocalData.CurrJWT);

            GlobalFunctions.CmdTrimEntity(ParTSReaction);

            TSReaction tsReactionForSend = GlobalFunctions.CopyObject <TSReaction>(ParTSReaction);


            LocalData.currReaction = await httpClient.MyPostJsonGetJsonAsync("reaction/add", tsReactionForSend);

            httpClient.DefaultRequestHeaders.Accept.Clear();
        }
コード例 #3
0
        public static async Task <string> CmdAddCategory(TSCategory ParTSCategory)
        {
            httpClient.DefaultRequestHeaders.Accept.Clear();
            httpClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
            httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", LocalData.CurrJWT);

            GlobalFunctions.CmdTrimEntity(ParTSCategory);

            TSCategory tsCategoryForSend = GlobalFunctions.CopyObject <TSCategory>(ParTSCategory);


            string result = await httpClient.PostJsonAsync <string>("category/add", tsCategoryForSend);


            httpClient.DefaultRequestHeaders.Accept.Clear();


            return(result);
        }
コード例 #4
0
        public static async Task <string> CmdTSUserChangePassword(TSUser ParTSUser)
        {
            httpClient.DefaultRequestHeaders.Accept.Clear();
            httpClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
            httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", LocalData.CurrJWT);

            GlobalFunctions.CmdTrimEntity(ParTSUser);

            TSUser tsUserForSend = GlobalFunctions.CopyObject <TSUser>(ParTSUser);



            string result = await httpClient.PostJsonAsync <string>("user/changepassword", tsUserForSend);

            httpClient.DefaultRequestHeaders.Accept.Clear();


            return(result);
        }
コード例 #5
0
        public static async Task <string> CmdUpdateTodo(TSTodo ParTSTodo)
        {
            httpClient.DefaultRequestHeaders.Accept.Clear();
            httpClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
            httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", LocalData.CurrJWT);

            GlobalFunctions.CmdTrimEntity(ParTSTodo);

            TSTodo tsTodoForSend = GlobalFunctions.CopyObject <TSTodo>(ParTSTodo);

            GlobalFunctions.CmdAdjustDate(tsTodoForSend, true);


            string result = await httpClient.PutJsonAsync <string>("todo/update", tsTodoForSend);


            httpClient.DefaultRequestHeaders.Accept.Clear();


            return(result);
        }