Exemple #1
0
 private bool authorFirstNameValidation()
 {
     if (AuthorFirstName.Equals(string.Empty))
     {
         textBoxAuthorFirstName.BackColor = Color.Red;
         return(false);
     }
     else
     {
         textBoxAuthorFirstName.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)
                 ));
        }