示例#1
0
 public JsonResult DeleteCoupon(int id)
 {
     _couponRepository.Delete(id);
     return(Json(new {
         valid = true,
         Message = "Coupon was deleted succesfully",
         redirect = "/Coupon/AdminIndex"
     }));
 }
示例#2
0
        public ActionResult Delete(CouponsDTO entity)
        {
            Coupons c = Mapper.Map <CouponsDTO, Coupons>(entity);

            couponRepository.Delete(c);
            return(Json(entity, JsonRequestBehavior.AllowGet));
        }
示例#3
0
        public IActionResult Delete(int id)
        {
            var coupon = _coupon.Find(id);

            _coupon.Delete(coupon);

            return(RedirectToAction(nameof(Index)));
        }
        public async Task <CouponDto> DeleteById(Guid id)
        {
            var modelToDelete = await _couponRepository.FindByCondition(x => x.Id == id);

            if (!modelToDelete.Any())
            {
                throw new ApiException("No se pudo Eliminar el cupon ", HttpStatusCode.NotFound);
            }

            _couponRepository.Delete(modelToDelete.FirstOrDefault());
            return(_mapper.Map <CouponDto>(modelToDelete.FirstOrDefault()));
        }
 public async Task <ActionsResult> Delete(int id)
 {
     return(await couponRepository.Delete(id));
 }
示例#6
0
        public bool DeleteCoupon(CouponDto couponDto)
        {
            var entity = _dtoMapper.Map(couponDto);

            return(_couponRepository.Delete(entity));
        }