示例#1
0
 public void Delete()
 {
     if (_selectedItem != null)
     {
         GlossaryRepository.Delete(SelectedItem);
         Items = GlossaryRepository.Items;
     }
     else
     {
         MessageBox.Show("No item selected", "Notice");
     }
 }
示例#2
0
 public ActionResult Delete(int id, IFormCollection collection)
 {
     try
     {
         // TODO: Add delete logic here
         GlossaryItem item = new GlossaryItem();
         item.Id = id;
         _repos.Delete(item);
         return(RedirectToAction(nameof(Index)));
     }
     catch
     {
         return(View());
     }
 }