Beispiel #1
0
        public PrenumerantDetails getPrenumerant(int id)
        {
            _ = new PrenumerantDetails();
            PrenumerantMethods pm = new PrenumerantMethods();

            PrenumerantDetails pd = pm.GetPrenumerant(id, out string errormsg);


            return(pd);
        }
Beispiel #2
0
        public async Task <IActionResult> PrenumerantFormular(int p_id)
        {
            PrenumerantDetails  prenumerant = new PrenumerantDetails();
            HttpClient          client      = _api.Initial();
            HttpResponseMessage res         = await client.GetAsync("api/Values/" + p_id.ToString());

            if (res.IsSuccessStatusCode)
            {
                var result = res.Content.ReadAsStringAsync().Result;
                prenumerant = JsonConvert.DeserializeObject <PrenumerantDetails>(result);
            }
            return(View(prenumerant));
        }
Beispiel #3
0
        public async Task <IActionResult> PrenumerantFormular2(PrenumerantDetails pd)
        {
            //PrenumerantDetails prenumerant = new PrenumerantDetails();
            HttpClient          client = _api.Initial();
            HttpResponseMessage res    = await client.PutAsJsonAsync <PrenumerantDetails>("api/Values", pd);

            if (res.IsSuccessStatusCode)
            {
                TempData["p_id"] = pd.pr_Id;
                return(RedirectToAction("SkapaAnnons"));
            }

            return(Content("sämst"));
        }
Beispiel #4
0
        public void Put([FromBody] PrenumerantDetails pd)
        {
            PrenumerantMethods pm = new PrenumerantMethods();

            pm.UpdatePrenumerant(pd, out string errormsg);
        }