Exemple #1
0
        public async Task <ActionResult> Delete(int id, trxTenagaPendukung Emp)
        {
            HttpResponseMessage responseMessage = await client.DeleteAsync(url + "/" + id);

            if (responseMessage.IsSuccessStatusCode)
            {
                return(RedirectToAction("Index"));
            }
            return(RedirectToAction("Error"));
        }
Exemple #2
0
        public async Task <ActionResult> Create(trxTenagaPendukung Emp)
        {
            Emp.CreatedDate = DateTime.Today;
            Emp.CreatedUser = tokenContainer.UserId.ToString();
            Emp.IdRekanan   = (System.Guid)tokenContainer.IdRekananContact;
            HttpResponseMessage responseMessage = await client.PostAsJsonAsync(url, Emp);

            if (responseMessage.IsSuccessStatusCode)
            {
                return(RedirectToAction("Index"));
            }
            return(RedirectToAction("Error"));
        }
 public IHttpActionResult Put(int id, trxTenagaPendukung myData)
 {
     _repository.Put(id, myData);
     return(StatusCode(HttpStatusCode.NoContent));
 }
 public IHttpActionResult Post(trxTenagaPendukung myData)
 {
     _repository.Post(myData);
     return(Ok(myData));
 }