protected override void Add() { string firstName = _ui.ReadString("First name", "X"); string lastName = _ui.ReadString("Last name", "Y"); DateTime defaultDate = new DateTime(1900, 5, 28); DateTime birthDate = _ui.ReadDate("Birth date", defaultDate.Date); _authorDao.Add(new Author(firstName, lastName, birthDate)); }
public bool Add(Author author) { if (validation.Validate(author).Count > 0) { foreach (var res in validation.Validate(author)) { if (res.IsValidate) { logger.Error(res.ValidationMessage.ToString()); } } } return(authors.Add(author)); }