コード例 #1
0
        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);
        }
コード例 #2
0
        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"));
        }
コード例 #3
0
 public ActionResult Delete(GiftCardViewModel giftCard)
 {
     try
     {
         _giftCardService.DeleteGiftCard(giftCard);
         return(Ok());
     }
     catch (Exception ex)
     {
         return(BadRequest(ex));
     }
 }
コード例 #4
0
        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"));
        }
コード例 #5
0
        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"));
        }
コード例 #6
0
 public string DeleteGiftCard(string giftCardId) => _giftCardService.DeleteGiftCard(giftCardId);
コード例 #7
0
 public void TearDown()
 {
     _giftCardService.DeleteGiftCard(_giftCard1);
     _giftCardService.DeleteGiftCard(_giftCard2);
 }