public async Task <ActionResult> Delete(int id)
        {
            var agente = new Agente {
                AgenteId = id
            };
            var response = await ApiServicio.EliminarAsync <Response>(agente,
                                                                      new Uri(WebApp.BaseAddress),
                                                                      "api/Agentes/DeleteAgente");

            if (!response.IsSuccess)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }

            return(RedirectToAction("Index"));
        }
        public async Task <ActionResult> Delete(int id)
        {
            var salario = new SalarioBasico {
                SalarioBasicoId = id
            };
            var response = await ApiServicio.EliminarAsync <Response>(salario,
                                                                      new Uri(WebApp.BaseAddress),
                                                                      "api/SalariosBasicos/DeleteSalarioBasico");

            if (!response.IsSuccess)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }

            return(RedirectToAction("Index"));
        }
Beispiel #3
0
        public async Task <ActionResult> Delete(int id)
        {
            var vendedor = new Vendedor {
                VendedorId = id
            };
            var response = await ApiServicio.EliminarAsync <Response>(vendedor,
                                                                      new Uri(WebApp.BaseAddress),
                                                                      "api/Vendedors/DeleteVendedor");

            if (!response.IsSuccess)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }

            return(RedirectToAction("Index"));
        }
Beispiel #4
0
        public async Task <ActionResult> Delete(int id)
        {
            var tipoMulta = new TipoMultas {
                TipoMultaId = id
            };
            var response = await ApiServicio.EliminarAsync <Response>(tipoMulta,
                                                                      new Uri(WebApp.BaseAddress),
                                                                      "api/TiposMultas/DeleteTipoMulta");

            if (!response.IsSuccess)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }

            return(RedirectToAction("Index"));
        }
        public async Task <ActionResult> Delete(int id)
        {
            if (id <= 0)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            var sector = new Sector {
                SectorId = id
            };

            var sectorRequest = await ApiServicio.EliminarAsync <Response>(sector,
                                                                           new Uri(WebApp.BaseAddress),
                                                                           "api/Sectors/DeleteSector");

            if (!sectorRequest.IsSuccess)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            return(RedirectToAction("Index"));
        }