public ActionResult DeletePost(int id)
        {
            var service = new ShopService();

            service.DeleteShop(id);
            TempData["SaveResult"] = "The shop has been deleted.";
            return(RedirectToAction("Index"));
        }
 public ActionResult Delete(string Id)
 {
     if (_shopService.DeleteShop(Id))
     {
         return(new HttpStatusCodeResult(System.Net.HttpStatusCode.OK));
     }
     return(new HttpStatusCodeResult(System.Net.HttpStatusCode.BadRequest));
 }
Exemple #3
0
        public async Task <IActionResult> Delete(string id)
        {
            _logger.LogInfo("Deleting shop");

            await shopService.DeleteShop(id);

            _logger.LogInfo("Shop deleted");

            return(Ok());
        }
        public IActionResult Delete(Guid ShopId)
        {
            var shopService = new ShopService();
            var res         = shopService.DeleteShop(ShopId);

            if (res.Success == false)
            {
                return(StatusCode(400, res.Data));
            }
            else
            {
                return(StatusCode(200, res.Data));
            }
        }
        public ActionResult Delete(int id, ShopViewModel model)
        {
            try
            {
                bool result = _shopService.DeleteShop(id);

                if (result)
                {
                    return(RedirectToAction(nameof(Index)));
                }
                throw new Exception();
            }
            catch
            {
                ModelState.AddModelError(string.Empty, "Ooops! Something went wrong!");
                return(View());
            }
        }
Exemple #6
0
        public async Task <IActionResult> DeleteShop(int shopId)
        {
            await _service.DeleteShop(shopId);

            return(Ok());
        }