示例#1
0
        private void RemoveSelectedAward()
        {
            if (ctlUsers.SelectedCells.Count > 0)
            {
                Award award = (Award)ctlAwards.SelectedCells[0].OwningRow.DataBoundItem;

                awards.Remove(award);
                awards.Remove(award, users);
                DisplayAwards();
            }
        }
示例#2
0
        //
        // GET: /Award/Delete/5

        public ActionResult Delete(int id)
        {
            var currentAward = awards.GetList().FirstOrDefault(u => u.Id == id);

            if (currentAward != null)
            {
                awards.Remove(currentAward);
            }

            return(RedirectToAction("Index"));
        }