Beispiel #1
0
        public async Task <IActionResult> Delete(Coupon coupon)
        {
            if (!await iCouponRepository.DeleteCoupon(coupon))
            {
                return(NotFound());
            }

            return(RedirectToAction(nameof(Index)));
        }
Beispiel #2
0
 public bool DeleteCoupon(PhieuNhapXuat couponToDelete)
 {
     try
     {
         _couponrepository.DeleteCoupon(couponToDelete);
     }
     catch
     {
         return(false);
     }
     return(true);
 }
 public IActionResult DeleteCoupon(int couponId)
 {
     try
     {
         couponRepository.DeleteCoupon(couponId);
         return(Ok());
     }
     catch (Exception e)
     {
         return(NotFound(e.Message));
     }
 }
Beispiel #4
0
        public async Task <IActionResult> DeleteCoupon(int couponID)
        {
            var coupon = await couponRepository.GetCouponAsync(couponID);

            if (coupon == null)
            {
                return(NotFound());
            }

            couponRepository.DeleteCoupon(coupon);
            await couponRepository.SaveAsync();

            return(NoContent());
        }
        public async Task <bool> DeleteCoupon(int couponId)
        {
            try
            {
                bool result = await _iCoupounRepositoty.DeleteCoupon(couponId);

                if (result == true)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch
            {
                throw;
            }
        }
Beispiel #6
0
        /// <summary>
        /// deleting  coupon based on couponid
        /// </summary>
        /// <param name="couponId"></param>
        /// <returns></returns>
        public async Task <bool> DeleteCoupon(int couponId)
        {
            log.Info("In CouponManagementHelper :  DeleteCoupon(int couponId)");
            try
            {
                bool result = await _iCoupounRepositoty.DeleteCoupon(couponId);

                if (result == true)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception e)
            {
                log.Error("Exception CouponManagementHelper:  DeleteCoupon(int couponId)" + e.Message);
                throw;
            }
        }
 public ActionResult DeleteCoupon(int id)
 {
     _couponRepository.DeleteCoupon(id);
     return(Ok("Product deleted Successfully"));
 }
Beispiel #8
0
 public bool DeleteCoupon(System.Int32 CouponId)
 {
     return(_iCouponRepository.DeleteCoupon(CouponId));
 }
        public async Task <ActionResult> DeleteCoupon(int portalId, int couponId)
        {
            await _couponRepository.DeleteCoupon(portalId, couponId);

            return(Ok());
        }