private void AuthorProcessControl(string message) { try { bool result = _authorController.Add(currentAuthor); if (result) { message = "Yazar"; } authorID = _authorController.GetAuthorbyName(currentAuthor); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void AddAuthorBtn_Click(object sender, RoutedEventArgs e) { InitDataSource(ref authorItems, Mapper.AuthorsToAuthorViewModels, authorController.Get); AddAuthor addAuthor = new AddAuthor(); if (addAuthor.ShowDialog().Value) { string name = addAuthor.Name.Text; string surname = addAuthor.Surname.Text; if (name != null && surname != null) { Author author = new Author(name, surname); authorController.Add(author); authorItems.Add(Mapper.AuthorToAuthorViewModel(author)); return; } } }