Esempio n. 1
0
 public ActionResult DeleteProductPost(int id)
 {
     try {
         bool result = productHandler.Delete(id);
         if (result)
         {
             return(RedirectToAction("GetProductList"));
         }
         else
         {
             this.ModelState.AddModelError("", "Something got wrong when delete product. Product not deleted!");
             return(GetProductList());
         }
     }
     catch (Exception ex) {
         this.ModelState.AddModelError("", ex.Message);
         if (ex.InnerException != null)
         {
             this.ModelState.AddModelError("", ex.InnerException.Message);
         }
         return(GetProductList());
     }
 }
Esempio n. 2
0
 public async Task Delete(Guid productId)
 {
     await Task.Run(() => {
         _productHandler.Delete(productId);
     });
 }
Esempio n. 3
0
 public void Delete(Guid id)
 {
     _prodHandler.Delete(id);
 }
        // [Authorize(Roles="Admin")]
        public CommandResult Delete(string id)
        {
            var result = _handler.Delete(id);

            return(result);
        }
Esempio n. 5
0
        public async Task <ActionResult <MovieDto> > DeleteMovie(int id)
        {
            var movie = await handler.Delete(id);

            return(Ok(movie));
        }