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

            if (responseMessage.IsSuccessStatusCode)
            {
                return(RedirectToAction("Index"));
            }
            return(RedirectToAction("Error"));
        }
        public async Task <ActionResult> Delete(int id, rptAsuransi Emp)
        {
            HttpResponseMessage responseMessage = await client.DeleteAsync(url + "/" + id);

            if (responseMessage.IsSuccessStatusCode)
            {
                return(RedirectToAction("Index"));
            }
            return(RedirectToAction("Error"));
        }
        public async Task <ActionResult> Create(rptAsuransi Emp)
        {
            HttpResponseMessage responseMessage = await client.PostAsJsonAsync(url, Emp);

            if (responseMessage.IsSuccessStatusCode)
            {
                return(RedirectToAction("Index"));
            }
            return(RedirectToAction("Error"));
        }
예제 #4
0
 public IHttpActionResult Put(int id, rptAsuransi myData)
 {
     _repository.Put(id, myData);
     return(StatusCode(HttpStatusCode.NoContent));
 }
예제 #5
0
 public IHttpActionResult Post(rptAsuransi myData)
 {
     _repository.Post(myData);
     return(Ok(myData));
 }