private void BackClick(object sender, RoutedEventArgs e)
      {
          ReaderList op = new ReaderList();

          op.Show();
          this.Close();
      }
Exemple #2
0
        private void ReaderList(object sender, RoutedEventArgs e)
        {
            ReaderList open = new ReaderList();

            open.Show();
            this.Close();
        }
 private void InsertClick(object sender, RoutedEventArgs e)
 {
     if (FirstName != null && LastName != null && MiddleName != null && PhoneNumber != null && NumberList != null)
     {
         Tenant Tenant = new Tenant();
         Tenant.FirstName   = FirstName.Text;
         Tenant.LastName    = LastName.Text;
         Tenant.MiddleName  = MiddleName.Text;
         Tenant.PhoneNumber = PhoneNumber.Text;
         Tenant.LibraryCard = int.Parse(NumberList.Text);
         db.Tenant.Add(Tenant);
         db.SaveChanges();
         MessageBox.Show("Создание прошло успешно");
         ReaderList op = new ReaderList();
         op.Show();
         this.Close();
     }
     else
     {
         MessageBox.Show("Неправильно введены ");
     }
 }