Exemple #1
0
 public HttpResponseMessage Delete(int id)
 {
     using (var service = new ServiceModeloNegocio.ServiceClient())
     {
         var customer = service.GetCustomerById(id);
         service.DeleteCustomer(customer);
         return(Request.CreateResponse(HttpStatusCode.Gone));
     }
 }
Exemple #2
0
 public ActionResult Delete(int id, FormCollection collection)
 {
     try
     {
         using (var service = new ServiceModeloNegocio.ServiceClient())
         {
             var customer = service.GetCustomerById(id);
             service.DeleteCustomer(customer);
             return(RedirectToAction("Index"));
         }
     }
     catch
     {
         return(View("Index"));
     }
 }