Exemple #1
0
 public Customer Get(int id)
 {
     using (var service = new ServiceModeloNegocio.ServiceClient())
     {
         var customer = service.GetCustomerById(id);
         return(customer);
     }
 }
Exemple #2
0
 // GET: Customer/Delete/5
 public ActionResult Delete(int id)
 {
     using (var service = new ServiceModeloNegocio.ServiceClient())
     {
         var customer = service.GetCustomerById(id);
         return(View(customer));
     }
 }
Exemple #3
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 #4
0
        // GET: Customer/Edit/5
        public ActionResult Edit(int id)
        {
            using (var service = new ServiceModeloNegocio.ServiceClient())
            {
                var customer = service.GetCustomerById(id);

                ViewBag.EstadosCustomer       = GetEstadosCustomer();
                ViewBag.TipoDocumentos        = GetTipoDocumentos();
                ViewBag.EstadoDelCustomer     = customer.Estado;
                ViewBag.TipoDocumentoCustomer = customer.Document_type;

                return(View(customer));
            }
        }
Exemple #5
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"));
     }
 }