Exemplo n.º 1
0
        public void OnPost()
        {
            var           res = PlanResponse.PlanGet(planId);
            IRestResponse res1, res2;
            string        status1;

            OriginalStatus = JsonConvert.DeserializeObject <Plan>(res.Content).Status.ToString();
            if (OriginalStatus == "ACTIVE")
            {
                res1    = PlanResponse.PlanDeactivate(planId);
                status1 = res1.StatusCode.ToString();
                if (status1 == "NoContent")
                {
                    res2   = PlanResponse.PlanGet(planId);
                    Status = JsonConvert.DeserializeObject <Plan>(res2.Content).Status.ToString();
                    Result = res2.Content;
                }
            }
            else
            {
                res1    = PlanResponse.PlanActivate(planId);
                status1 = res1.StatusCode.ToString();
                if (status1 == "NoContent")
                {
                    res2   = PlanResponse.PlanGet(planId);
                    Status = JsonConvert.DeserializeObject <Plan>(res2.Content).Status.ToString();
                    Result = res2.Content;
                }
            }
        }
        public void OnPost()
        {
            PlanId = id;
            var res = PlanResponse.PlanGet(PlanId);

            GetStatus = res.StatusCode.ToString();
            GetResult = res.Content;
        }
        public void OnPostUpdatePlan()
        {
            PlanId = id;
            var res = PatchPlan(PlanId);

            UpdateStatus = res.StatusCode.ToString();
            if (res.StatusCode.ToString() == "NoContent")
            {
                var res1 = PlanResponse.PlanGet(PlanId);
                UpdateResult = res1.Content;
            }
        }
Exemplo n.º 4
0
        public void OnGet()
        {
            var res = PlanResponse.PlanGet(planId);

            Status = JsonConvert.DeserializeObject <Plan>(res.Content).Status.ToString();
        }