private void CheckDeath() { if (Stay.Died == true && Stay.ValidValues()) { MessageBoxResult result = MessageBox.Show("Založit nový záznam o úhynu?", "Confirmation", MessageBoxButton.YesNo, MessageBoxImage.Question); if (result == MessageBoxResult.Yes) { if (Stay.FinishDate != null) { OpenDeathCreation(); } } } }
public void UpdateStay() { if (Stay.ValidValues()) { if ((Start < Finish)) { IsWorking = true; Stay.UpdateStay(); Filter(); MessageBox.Show("Upraveno."); CheckDeath(); CheckEscape(); } else { MessageBox.Show("Pobyt nesmí končit před jeho začátkem."); } } else { MessageBox.Show("Vyplňte prosím počáteční datum."); } }
public void SaveToDatabase() { if (Animal.ValidValues() && Stay.ValidValues()) { Animal.ImagePath = Image.SaveImage(); Animal.SaveAnimal(); Stay.AnimalID = Animal.ID; Stay.SaveStay(); MessageBox.Show(Animal.Name + " přidán do evidence."); if (prnt != null) { prnt.UpdateAnimals(); } if (prnt1 != null) { prnt1.Home(); } TryClose(); } else { MessageBox.Show("Vyplňte prosím jméno a datum příjmu zvířete."); } }