Exemplo n.º 1
0
        private void Authors(object sender, RoutedEventArgs e)
        {
            AuthorsWindow mw = new AuthorsWindow();

            mw.Show();
            this.Close();
        }
Exemplo n.º 2
0
        private void BackWard(object sender, RoutedEventArgs e)
        {
            AuthorsWindow aw = new AuthorsWindow();

            aw.Show();
            this.Close();
        }
Exemplo n.º 3
0
        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);
            }
        }