private void Authors(object sender, RoutedEventArgs e) { AuthorsWindow mw = new AuthorsWindow(); mw.Show(); this.Close(); }
private void BackWard(object sender, RoutedEventArgs e) { AuthorsWindow aw = new AuthorsWindow(); aw.Show(); this.Close(); }
public bool AddAuthor(string Surname, string FirstName, string MiddleName) { if (Surname == "" || FirstName == "" || MiddleName == "") { MessageBox.Show("Возникла ошибка! Возможно вы не заполнили поля"); return(false); } else { Authors authors = new Authors(); authors.Surname = Surname; authors.FirstName = FirstName; authors.MiddleName = MiddleName; db.Authors.Add(authors); db.SaveChanges(); MessageBox.Show("Добавлен автор"); AuthorsWindow aw = new AuthorsWindow(); aw.Show(); this.Close(); return(true); } }