public void Invoke(object Sender, object Element) { if (Element is CommandParameters) { CommandParameters cp = (CommandParameters)Element; string[] elemsToDelete = MCGrid.GetCheckedCollection(((CommandManager)Sender).Page, cp.CommandArguments["GridId"]); using (DbTransaction tran = DbTransaction.Begin()) { foreach (string elem in elemsToDelete) { int id = Convert.ToInt32(elem.Split(new string[] { "::" }, StringSplitOptions.RemoveEmptyEntries)[0], CultureInfo.InvariantCulture); if (id > 0) { if (Incident.CanUpdate(id)) { Issue2.UpPriority(id, false); } } } tran.Commit(); } CHelper.RequireBindGrid(); } }