Esempio n. 1
0
        public async Task <IActionResult> DeleteAsync(int id)
        {
            var result = await _supplierRepository.DeleteAsync(id);


            return(Ok(result));
        }
Esempio n. 2
0
        public async Task <IActionResult> DeleteConfirmed(int id)
        {
            var suppliers = await _supplierRepository.GetOneAsync(id);

            await _supplierRepository.DeleteAsync(suppliers);

            return(RedirectToAction(nameof(Index)));
        }
Esempio n. 3
0
        public async Task <IActionResult> DeleteProduct(int productId)
        {
            Product deletedProduct = await _supplierRepository.GetByIdAsync(productId);

            var result = await _supplierRepository.DeleteAsync(deletedProduct);

            if (!result)
            {
                return(BadRequest("Could not delete product"));
            }

            return(Ok());
        }
Esempio n. 4
0
        public async Task <IActionResult> DeleteById(int id)
        {
            var result = await _suppliers.DeleteAsync(id);

            if (result)
            {
                return(Ok("Supplier deleted Successfully"));
            }
            else
            {
                return(BadRequest("Something Went Wrong while deleting"));
            }
        }
Esempio n. 5
0
        public async Task <ActionResult> Delete(Guid id)
        {
            try
            {
                var result = shipperRepo.Retrieve().FirstOrDefault(x => x.SupplierID == id);
                if (result == null)
                {
                    return(NotFound());
                }

                await shipperRepo.DeleteAsync(id);

                return(NoContent());
            }
            catch (Exception)
            {
                return(BadRequest());
            }
        }
Esempio n. 6
0
 public async Task <bool> DeleteSupplier(SupplierDto dto)
 {
     return(await _supplierRepository.DeleteAsync(dto));
 }
Esempio n. 7
0
 public async Task <bool> DeleteAsync(int id)
 => await _supplierRepository.DeleteAsync(id);
Esempio n. 8
0
 public async Task RemoveAsync(int id)
 {
     await _supplierRepository.DeleteAsync(id);
 }