示例#1
0
        private async Task <TaskStatus> BusyStatus()
        {
            using (var client = ClientHelper.GetClient(CrossSettings.Current.GetValueOrDefault("token", "")))
            {
                TaskService.InitializeClient(client);
                var o_data = await TaskService.Abort(StaticTask.comment);

                if (o_data.Status == System.Net.HttpStatusCode.OK)
                {
                    //o_data.Message = "Успешно авторизован!";
                    Toast.MakeText(Activity, o_data.ResponseData.Message, ToastLength.Long).Show();
                    return(TaskStatus.OK);
                }
                else
                {
                    Toast.MakeText(Activity, o_data.Message, ToastLength.Long).Show();//"Unexpected character encountered while parsing value: {. Path 'ORDERS[0].last_stage_at', line 2, position 1086."
                    return(TaskStatus.ServerError);
                }
            }
        }
示例#2
0
        private async void AbortTask()
        {
            using (var client = ClientHelper.GetClient(CrossSettings.Current.GetValueOrDefault("token", "")))
            {
                TaskService.InitializeClient(client);
                var o_data = await TaskService.Abort(StaticTask.comment);

                if (o_data.Status == System.Net.HttpStatusCode.OK)
                {
                    //o_data.Message = "Успешно авторизован!";
                    StaticTask.IsStoppedGettingTasks = false;
                    StartUp.StartTracking(context, 1);
                    Toast.MakeText(context, o_data.ResponseData.Message, ToastLength.Long).Show();
                }
                else
                {
                    Toast.MakeText(context, o_data.Message, ToastLength.Long).Show();//"Unexpected character encountered while parsing value: {. Path 'ORDERS[0].last_stage_at', line 2, position 1086."
                }

                TaskActivity act = new TaskActivity();
                manager.Replace(Resource.Id.frameDriverlayout, act);
                manager.Commit();
            }
        }