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

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

            if (responseMessage.IsSuccessStatusCode)
            {
                return(RedirectToAction("Index"));
            }
            return(RedirectToAction("Error"));
        }
Пример #3
0
 public IHttpActionResult Put(int id, mstWilayah myData)
 {
     _repository.Put(id, myData);
     return(StatusCode(HttpStatusCode.NoContent));
 }
Пример #4
0
 public IHttpActionResult Post(mstWilayah myData)
 {
     _repository.Post(myData);
     return(Ok(myData));
 }