Пример #1
0
        public async Task <ActionResult> Create(mstTypeOfRekanan Emp)
        {
            HttpResponseMessage responseMessage = await client.PostAsJsonAsync(url, Emp);

            if (responseMessage.IsSuccessStatusCode)
            {
                return(RedirectToAction("Index"));
            }
            return(RedirectToAction("Error"));
        }
Пример #2
0
        public async Task <ActionResult> Delete(int id, mstTypeOfRekanan Emp)
        {
            HttpResponseMessage responseMessage = await client.DeleteAsync(url + "/" + id);

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