Exemple #1
0
 private bool authorLastNameValidation()
 {
     if (AuthorLastName.Equals(string.Empty))
     {
         textBoxAuthorLastName.BackColor = Color.Red;
         return(false);
     }
     else
     {
         textBoxAuthorLastName.BackColor = Color.White;
         return(true);
     }
 }
Exemple #2
0
        /// <summary>
        /// Returns true if Book instances are equal
        /// </summary>
        /// <param name="other">Instance of Book to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(Book other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Id == other.Id ||
                     Id != null &&
                     Id.Equals(other.Id)
                     ) &&
                 (
                     AuthorFirstName == other.AuthorFirstName ||
                     AuthorFirstName != null &&
                     AuthorFirstName.Equals(other.AuthorFirstName)
                 ) &&
                 (
                     AuthorLastName == other.AuthorLastName ||
                     AuthorLastName != null &&
                     AuthorLastName.Equals(other.AuthorLastName)
                 ) &&
                 (
                     Title == other.Title ||
                     Title != null &&
                     Title.Equals(other.Title)
                 ) &&
                 (
                     Description == other.Description ||
                     Description != null &&
                     Description.Equals(other.Description)
                 ));
        }