Ejemplo n.º 1
0
        public void DeleteFood(FoodDTO dto)
        {
            try
            {
                log.Debug(FoodDTO.FormatFoodDTO(dto));

                R_Food t = FoodDTO.ConvertDTOtoEntity(dto);

                // delete
                Repository.DeleteFood(t);
                dto.IsDeleted = t.IsDeleted;

                log.Debug("result: 'success'");
            }
            catch (System.Exception e)
            {
                // error
                log.Error(e.ToString());

                throw;
            }
        }
Ejemplo n.º 2
0
        public IActionResult DeleteConfirmed(int id)
        {
            try
            {
                _foodRepository.DeleteFood(id);
            }
            catch (DbUpdateException /* ex */)
            {
                //Log the error (uncomment ex variable name and write a log.
                ModelState.AddModelError("", "Delete failed. Try again, and if the problem persists " +
                                         "see your system administrator.");
            }

            return(RedirectToAction("Index"));
        }
Ejemplo n.º 3
0
 public void DeleteFood(int?idFood)
 {
     foodRepository.DeleteFood(idFood);
 }
Ejemplo n.º 4
0
 public async Task DeleteFood(int id)
 {
     await _foodRepository.DeleteFood(id);
 }
Ejemplo n.º 5
0
 public async Task <DeleteFoodResult> DeleteFood(DeleteFoodRequest request)
 {
     return(await orderRepository.DeleteFood(request));
 }
Ejemplo n.º 6
0
        public async Task <bool> DeleteFood(int id)
        {
            await _repository.DeleteFood(id);

            return(true);
        }