protected void grid_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "DeleteCoupon") { CouponService.DeleteCoupon(Convert.ToInt32(e.CommandArgument)); } }
protected void grid_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "DeleteCoupon") { CouponService.DeleteCoupon(SQLDataHelper.GetInt(e.CommandArgument)); } }
public void DeleteCoupon() { var couponCommand = new CouponDeleted() { CouponID = 5 }; var response = couponService.DeleteCoupon(couponCommand); Assert.AreEqual(response.Type, Common.ServiceResponseTypes.Success); }
protected void lbDeleteSelected_Click(object sender, EventArgs e) { if ((_selectionFilter != null) && (_selectionFilter.Values != null)) { if (!_inverseSelection) { foreach (var id in _selectionFilter.Values) { CouponService.DeleteCoupon(Convert.ToInt32(id)); } } else { var itemsIds = _paging.ItemsIds <int>("CouponID as ID"); foreach (int couponeId in itemsIds.Where(cId => !_selectionFilter.Values.Contains(cId.ToString(CultureInfo.InvariantCulture)))) { CouponService.DeleteCoupon(couponeId); } } } }