public async Task <ActionResult> Edit(int id, mstProdukAsuransi Emp)
        {
            HttpResponseMessage responseMessage = await client.PutAsJsonAsync(url + "/" + id, Emp);

            if (responseMessage.IsSuccessStatusCode)
            {
                return(RedirectToAction("Index"));
            }
            return(RedirectToAction("Error"));
        }
        public async Task <ActionResult> Create(mstProdukAsuransi Emp)
        {
            Emp.IsActive    = true;
            Emp.CreatedDate = DateTime.Today;
            Emp.CreatedUser = tokenContainer.UserId.ToString();
            HttpResponseMessage responseMessage = await client.PostAsJsonAsync(url, Emp);

            if (responseMessage.IsSuccessStatusCode)
            {
                return(RedirectToAction("Index"));
            }
            return(RedirectToAction("Error"));
        }
        public async Task <ActionResult> UpdateLineProduk(mstProdukAsuransi myData)
        {
            HttpResponseMessage responseMessage1 = await client.PutAsJsonAsync(url + "/" + myData.IdMstProdukAsuransi, myData);

            if (responseMessage1.IsSuccessStatusCode)
            {
                //RedirectToAction("Index");
                HttpResponseMessage responseMessage = await client.GetAsync(url);

                if (responseMessage.IsSuccessStatusCode)
                {
                    var responseData = responseMessage.Content.ReadAsStringAsync().Result;
                    var Employees    = JsonConvert.DeserializeObject <List <mstProdukAsuransi> >(responseData);
                    return(PartialView("_Index", Employees));
                }
            }
            return(RedirectToAction("Error"));
        }
Example #4
0
 public IHttpActionResult Put(int id, mstProdukAsuransi myData)
 {
     _repository.Put(id, myData);
     return(StatusCode(HttpStatusCode.NoContent));
 }
Example #5
0
 public IHttpActionResult Post(mstProdukAsuransi myData)
 {
     _repository.Post(myData);
     return(Ok(myData));
 }