Beispiel #1
0
        public void Excluir(Guid id)
        {
            var marca = _marcaService.GetById(id);

            _marcaService.Delete(marca);
            Commit();
        }
Beispiel #2
0
        public IActionResult Delete([FromRoute] int id)
        {
            var response = _marcaService.Delete(id);

            if (response.ObjectResponse == 0)
            {
                return(NotFound());
            }

            return(Ok());
        }
 private void btnEliminarMarca_Click(object sender, EventArgs e)
 {
     if (dgMarca.SelectedRows.Count == 0)
     {
         MessageBox.Show(this, "Seleccione la marca que desea eliminar", "Error al eliminar",
                         MessageBoxButtons.OK, MessageBoxIcon.Error);
         return;
     }
     mservice.Delete(idMarca);
     MessageBox.Show("Marca eliminada");
     ClearFields();
     FillDataGridViewMarca();
 }
Beispiel #4
0
        public IActionResult DeleteMarca([FromRoute] int id)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            var currentMarca = marcaService.FindById(new Marca {
                IdMarca = id
            });

            if (currentMarca == null)
            {
                return(NotFound());
            }

            marcaService.Delete(currentMarca);

            return(Ok(currentMarca));
        }
Beispiel #5
0
 public IActionResult Delete(Guid MarcaId)
 {
     Service.Delete(MarcaId);
     return(Ok(true));
 }
Beispiel #6
0
        public async Task Delete(Guid id)
        {
            await _marcaService.Delete(id);

            return;
        }