Example #1
0
 public AuthorsTableView()
 {
     InitializeComponent();
     _selectedAuthor             = null;
     _authorTableModel           = ((App)Application.Current).Model.AuthorTable;
     _authorTable                = _authorTableModel.AuthorTable;
     AuthorsDataGrid.DataContext = _authorTable.DefaultView;
 }
 public SelectAuthorDlg()
 {
     InitializeComponent();
     SelectedAuthor = null;
     _authorTable   = ((App)Application.Current).Model.AuthorTable;
     TB_SelectAuthorLastName.Text  = "";
     TB_SelectAuthorFirstName.Text = "";
     Loaded += new RoutedEventHandler(PreShowSetSelectAuthorsListBox);
 }
Example #3
0
 public Model()
 {
     _formats               = new FormatTableModel();
     _categories            = new CategoryTableModel();
     _authors               = new AuthorTableModel();
     _statuses              = new StatusTableModel();
     _conditions            = new ConditionsTableModel();
     _ratings               = new RatingsTableModel();
     _forSale               = new ForSaleTableModel();
     _ownerShip             = new OwnerShipTableModel();
     _publishInfo           = new PublishInfoTableModel();
     _purchase              = new PurchaseInfoTableModel();
     _bookConditionsOptions = new ConditionOptionsTableModel();
     _volumeInSeries        = new VolumeInSeriesTable();
     _synopsis              = new SynopsisTable();
 }
        private void Btn_AddAuthorSave_Click(object sender, RoutedEventArgs e)
        {
            AuthorModel newAuthor = new AuthorModel();

            newAuthor.FirstName   = TxtBx_AuthorFirstName.Text;
            newAuthor.LastName    = TxtBx_AuthorLastName.Text;
            newAuthor.MiddleName  = TxtBx_AuthorMiddleName.Text;
            newAuthor.YearOfBirth = TxtBx_AuthorYearOfBirth.Text;
            newAuthor.YearOfDeath = TxtBx_AuthorYearOfDeath.Text;

            if (newAuthor.IsValid)
            {
                AuthorTableModel authorTableModel = ((App)Application.Current).Model.AuthorTable;
                if (authorTableModel.AddAuthor(newAuthor))
                {
                    Close();
                }
            }
        }