//====================================== // <Summary> // Method for saving inputed book // record to store in the database // </Summary> //====================================== private void SaveBookRecord() { string callNumber = CallNumber.Text; string barCode = BarCode.Text; string accessionNumber = AccessionNumber.Text; string bookTitle = BookTitle.Text; string publishYear = PublishYear.Text; string cat = null; if (Categories.SelectedItem != null) { cat = Categories.SelectedItem.ToString(); } int category = BooksController.GetCategoryId(cat); string year = PublishYear.Text; if (AddBookValidation.Validate(callNumber, barCode, accessionNumber, bookTitle, category, year)) { BooksController.AddBookRecord(callNumber, barCode, accessionNumber, bookTitle, category, year); this.DialogResult = DialogResult.OK; } }