public virtual async Task DeleteGiftCard(GiftCard giftCard) { await _giftCardService.DeleteGiftCard(giftCard); //activity log await _customerActivityService.InsertActivity("DeleteGiftCard", giftCard.Id, _localizationService.GetResource("ActivityLog.DeleteGiftCard"), giftCard.GiftCardCouponCode); }
public virtual IActionResult Delete(int id) { if (!_permissionService.Authorize(StandardPermissionProvider.ManageGiftCards)) { return(AccessDeniedView()); } //try to get a gift card with the specified id var giftCard = _giftCardService.GetGiftCardById(id); if (giftCard == null) { return(RedirectToAction("List")); } _giftCardService.DeleteGiftCard(giftCard); //activity log _customerActivityService.InsertActivity("DeleteGiftCard", string.Format(_localizationService.GetResource("ActivityLog.DeleteGiftCard"), giftCard.GiftCardCouponCode), giftCard); SuccessNotification(_localizationService.GetResource("Admin.GiftCards.Deleted")); return(RedirectToAction("List")); }
public ActionResult Delete(GiftCardViewModel giftCard) { try { _giftCardService.DeleteGiftCard(giftCard); return(Ok()); } catch (Exception ex) { return(BadRequest(ex)); } }
public ActionResult DeleteConfirmed(int id) { var giftCard = _giftCardService.GetGiftCardById(id); if (giftCard == null) { return(RedirectToAction("List")); } _giftCardService.DeleteGiftCard(giftCard); _customerActivityService.InsertActivity("DeleteGiftCard", _services.Localization.GetResource("ActivityLog.DeleteGiftCard"), giftCard.GiftCardCouponCode); NotifySuccess(_services.Localization.GetResource("Admin.GiftCards.Deleted")); return(RedirectToAction("List")); }
public ActionResult DeleteConfirmed(int id) { if (!_permissionService.Authorize(StandardPermissionProvider.ManageGiftCards)) { return(AccessDeniedView()); } var giftCard = _giftCardService.GetGiftCardById(id); _giftCardService.DeleteGiftCard(giftCard); //activity log _customerActivityService.InsertActivity("DeleteGiftCard", _localizationService.GetResource("ActivityLog.DeleteGiftCard"), giftCard.GiftCardCouponCode); SuccessNotification(_localizationService.GetResource("Admin.GiftCards.Deleted")); return(RedirectToAction("List")); }
public string DeleteGiftCard(string giftCardId) => _giftCardService.DeleteGiftCard(giftCardId);
public void TearDown() { _giftCardService.DeleteGiftCard(_giftCard1); _giftCardService.DeleteGiftCard(_giftCard2); }