Exemplo n.º 1
0
        public ActionResult DeletePost(int id)
        {
            var service = new ShopService();

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

            await shopService.DeleteShop(id);

            _logger.LogInfo("Shop deleted");

            return(Ok());
        }
Exemplo n.º 4
0
        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));
            }
        }
Exemplo n.º 5
0
        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());
            }
        }
Exemplo n.º 6
0
        public async Task <IActionResult> DeleteShop(int shopId)
        {
            await _service.DeleteShop(shopId);

            return(Ok());
        }