protected void grid_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "Delete") { OfferService.DeleteOfferList(Convert.ToInt32(e.CommandArgument)); } if (e.CommandName == "AddOfferList") { OfferService.AddOfferList(((TextBox)grid.FooterRow.FindControl("txtNewName")).Text); grid.ShowFooter = false; } if (e.CommandName == "CancelAdd") { grid.ShowFooter = false; } }
protected void lbDeleteSelected_Click(object sender, EventArgs e) { if ((_selectionFilter != null) && (_selectionFilter.Values != null)) { if (!_inverseSelection) { foreach (var id in _selectionFilter.Values) { OfferService.DeleteOfferList(Convert.ToInt32(id)); } } else { var itemsIds = _paging.ItemsIds <int>("OfferListID as ID"); foreach (int id in itemsIds.Where(id => !_selectionFilter.Values.Contains(id.ToString()))) { OfferService.DeleteOfferList(id); } } } }