Exemplo n.º 1
0
        /// <summary>
        /// Add a creature diet record
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnAddCreatureDiet_Click(object sender, RoutedEventArgs e)
        {
            var dietForm = new frmAddEditCreatureDiet(_creatureDietManager);
            var result   = dietForm.ShowDialog();

            if (result == true)
            {
                refreshCreatureDietList();
                refreshCreatureList();
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// Edit the selected creature diet record
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnEditCreatureDiet_Click(object sender, RoutedEventArgs e)
 {
     if (this.dgCreatureDiets.SelectedItems.Count > 0)
     {
         var dietForm = new frmAddEditCreatureDiet(_creatureDietManager, (CreatureDiet)this.dgCreatureDiets.SelectedItem, CreatureDietForm.Edit);
         var result   = dietForm.ShowDialog();
         if (result == true)
         {
             refreshCreatureDietList();
             refreshCreatureList();
         }
     }
     else
     {
         MessageBox.Show("You must select a creature diet!");
     }
 }