Ejemplo n.º 1
0
 public ActionResult DeleteConfirmed(string id)
 {
     try
     {
         _creatureTypeManager.UpdateCreatureTypeActive(id, false);
         return(RedirectToAction("Index"));
     }
     catch (Exception ex)
     {
         return(RedirectToAction("Index", "Error", new { message = ex.Message, stackTrace = ex.StackTrace }));
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Toggle the active field of the selected creature type
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnToggleCreatureTypeActive_Click(object sender, RoutedEventArgs e)
 {
     if (this.dgCreatureTypes.SelectedItems.Count > 0)
     {
         try
         {
             _creatureTypeManager.UpdateCreatureTypeActive(((CreatureType)this.dgCreatureTypes.SelectedItem).CreatureTypeID, !((CreatureType)this.dgCreatureTypes.SelectedItem).Active);
             refreshCreatureTypeList();
         }
         catch (Exception ex)
         {
             var message = ex.Message + "\n\n" + ex.InnerException;
             MessageBox.Show(message, "Toggle Active Error!", MessageBoxButton.OK, MessageBoxImage.Exclamation);
         }
     }
     else
     {
         MessageBox.Show("You must select a creature type!");
     }
 }